qml: small fixes, cleanup
This commit is contained in:
@@ -22,7 +22,6 @@ Pane {
|
|||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Backup');
|
text: qsTr('Backup');
|
||||||
enabled: true
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
var dialog = app.genericShareDialog.createObject(root,
|
var dialog = app.genericShareDialog.createObject(root,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ Pane {
|
|||||||
height: postext.height + constants.paddingXXLarge
|
height: postext.height + constants.paddingXXLarge
|
||||||
radius: constants.paddingXSmall
|
radius: constants.paddingXSmall
|
||||||
|
|
||||||
color: constants._alpha(Material.accentColor, 0.33)
|
color: constants.colorAlpha(Material.accentColor, 0.33)
|
||||||
border.color: Material.accentColor
|
border.color: Material.accentColor
|
||||||
opacity : vdragscroll.drag.active ? 1 : 0
|
opacity : vdragscroll.drag.active ? 1 : 0
|
||||||
Behavior on opacity { NumberAnimation { duration: 300 } }
|
Behavior on opacity { NumberAnimation { duration: 300 } }
|
||||||
@@ -92,8 +92,8 @@ Pane {
|
|||||||
onYChanged: {
|
onYChanged: {
|
||||||
if (vdragscroll.drag.active) {
|
if (vdragscroll.drag.active) {
|
||||||
listview.contentY =
|
listview.contentY =
|
||||||
Math.min(listview.contentHeight - listview.height + listview.originY,
|
|
||||||
Math.max(listview.originY,
|
Math.max(listview.originY,
|
||||||
|
Math.min(listview.contentHeight - listview.height + listview.originY,
|
||||||
(y/vdragscroll.height) * listview.contentHeight))
|
(y/vdragscroll.height) * listview.contentHeight))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Item {
|
|||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Addresses');
|
text: qsTr('Addresses');
|
||||||
onTriggered: menu.openPage(Qt.resolvedUrl('Addresses.qml'));
|
onTriggered: menu.openPage(Qt.resolvedUrl('Addresses.qml'));
|
||||||
enabled: Daemon.currentWallet != null
|
enabled: Daemon.currentWallet
|
||||||
icon.source: '../../icons/tab_addresses.png'
|
icon.source: '../../icons/tab_addresses.png'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ Item {
|
|||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Channels');
|
text: qsTr('Channels');
|
||||||
enabled: Daemon.currentWallet != null && Daemon.currentWallet.isLightning
|
enabled: Daemon.currentWallet && Daemon.currentWallet.isLightning
|
||||||
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
|
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
|
||||||
icon.source: '../../icons/lightning.png'
|
icon.source: '../../icons/lightning.png'
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 2*constants.paddingXLarge
|
spacing: 2*constants.paddingXLarge
|
||||||
visible: Daemon.currentWallet == null
|
visible: !Daemon.currentWallet
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr('No wallet loaded')
|
text: qsTr('No wallet loaded')
|
||||||
@@ -92,7 +92,7 @@ Item {
|
|||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: Daemon.currentWallet != null
|
visible: Daemon.currentWallet
|
||||||
|
|
||||||
SwipeView {
|
SwipeView {
|
||||||
id: swipeview
|
id: swipeview
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ Pane {
|
|||||||
id: changePasswordComp
|
id: changePasswordComp
|
||||||
MenuItem {
|
MenuItem {
|
||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
enabled: Daemon.currentWallet // != null
|
enabled: Daemon.currentWallet
|
||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Change Password');
|
text: qsTr('Change Password');
|
||||||
onTriggered: rootItem.changePassword()
|
onTriggered: rootItem.changePassword()
|
||||||
@@ -71,7 +71,7 @@ Pane {
|
|||||||
id: deleteWalletComp
|
id: deleteWalletComp
|
||||||
MenuItem {
|
MenuItem {
|
||||||
icon.color: 'transparent'
|
icon.color: 'transparent'
|
||||||
enabled: Daemon.currentWallet // != null
|
enabled: Daemon.currentWallet
|
||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Delete Wallet');
|
text: qsTr('Delete Wallet');
|
||||||
onTriggered: rootItem.deleteWallet()
|
onTriggered: rootItem.deleteWallet()
|
||||||
@@ -87,7 +87,7 @@ Pane {
|
|||||||
action: Action {
|
action: Action {
|
||||||
text: qsTr('Enable Lightning');
|
text: qsTr('Enable Lightning');
|
||||||
onTriggered: rootItem.enableLightning()
|
onTriggered: rootItem.enableLightning()
|
||||||
enabled: Daemon.currentWallet != null && Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning
|
enabled: Daemon.currentWallet && Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning
|
||||||
icon.source: '../../icons/lightning.png'
|
icon.source: '../../icons/lightning.png'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ Pane {
|
|||||||
|
|
||||||
// add items dynamically, if using visible: false property the menu item isn't removed but empty
|
// add items dynamically, if using visible: false property the menu item isn't removed but empty
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (Daemon.currentWallet != null) {
|
if (Daemon.currentWallet) {
|
||||||
menu.insertItem(0, sepComp.createObject(menu))
|
menu.insertItem(0, sepComp.createObject(menu))
|
||||||
if (Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning) {
|
if (Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning) {
|
||||||
menu.insertItem(0, enableLightningComp.createObject(menu))
|
menu.insertItem(0, enableLightningComp.createObject(menu))
|
||||||
@@ -118,7 +118,7 @@ Pane {
|
|||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: detailsLayout
|
id: detailsLayout
|
||||||
visible: Daemon.currentWallet != null
|
visible: Daemon.currentWallet
|
||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width
|
||||||
|
|
||||||
columns: 4
|
columns: 4
|
||||||
@@ -183,7 +183,7 @@ Pane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
visible: Daemon.currentWallet == null
|
visible: !Daemon.currentWallet
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.bottomMargin: constants.paddingXXLarge
|
Layout.bottomMargin: constants.paddingXXLarge
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class QETransactionListModel(QAbstractListModel):
|
|||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
||||||
def tx_to_model(self, tx):
|
def tx_to_model(self, tx):
|
||||||
self._logger.debug(str(tx))
|
#self._logger.debug(str(tx))
|
||||||
item = tx
|
item = tx
|
||||||
|
|
||||||
item['key'] = item['txid'] if 'txid' in item else item['payment_hash']
|
item['key'] = item['txid'] if 'txid' in item else item['payment_hash']
|
||||||
|
|||||||
Reference in New Issue
Block a user