Browse Source

qml: small fixes, cleanup

patch-4
Sander van Grieken 3 years ago
parent
commit
dea30f96a1
  1. 1
      electrum/gui/qml/components/ChannelDetails.qml
  2. 4
      electrum/gui/qml/components/History.qml
  3. 8
      electrum/gui/qml/components/WalletMainView.qml
  4. 12
      electrum/gui/qml/components/Wallets.qml
  5. 2
      electrum/gui/qml/qetransactionlistmodel.py

1
electrum/gui/qml/components/ChannelDetails.qml

@ -22,7 +22,6 @@ Pane {
icon.color: 'transparent'
action: Action {
text: qsTr('Backup');
enabled: true
onTriggered: {
var dialog = app.genericShareDialog.createObject(root,
{

4
electrum/gui/qml/components/History.qml

@ -84,7 +84,7 @@ Pane {
height: postext.height + constants.paddingXXLarge
radius: constants.paddingXSmall
color: constants._alpha(Material.accentColor, 0.33)
color: constants.colorAlpha(Material.accentColor, 0.33)
border.color: Material.accentColor
opacity : vdragscroll.drag.active ? 1 : 0
Behavior on opacity { NumberAnimation { duration: 300 } }
@ -92,8 +92,8 @@ Pane {
onYChanged: {
if (vdragscroll.drag.active) {
listview.contentY =
Math.min(listview.contentHeight - listview.height + listview.originY,
Math.max(listview.originY,
Math.min(listview.contentHeight - listview.height + listview.originY,
(y/vdragscroll.height) * listview.contentHeight))
}
}

8
electrum/gui/qml/components/WalletMainView.qml

@ -15,7 +15,7 @@ Item {
action: Action {
text: qsTr('Addresses');
onTriggered: menu.openPage(Qt.resolvedUrl('Addresses.qml'));
enabled: Daemon.currentWallet != null
enabled: Daemon.currentWallet
icon.source: '../../icons/tab_addresses.png'
}
}
@ -39,7 +39,7 @@ Item {
icon.color: 'transparent'
action: Action {
text: qsTr('Channels');
enabled: Daemon.currentWallet != null && Daemon.currentWallet.isLightning
enabled: Daemon.currentWallet && Daemon.currentWallet.isLightning
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
icon.source: '../../icons/lightning.png'
}
@ -73,7 +73,7 @@ Item {
anchors.centerIn: parent
width: parent.width
spacing: 2*constants.paddingXLarge
visible: Daemon.currentWallet == null
visible: !Daemon.currentWallet
Label {
text: qsTr('No wallet loaded')
@ -92,7 +92,7 @@ Item {
ColumnLayout {
anchors.fill: parent
visible: Daemon.currentWallet != null
visible: Daemon.currentWallet
SwipeView {
id: swipeview

12
electrum/gui/qml/components/Wallets.qml

@ -59,7 +59,7 @@ Pane {
id: changePasswordComp
MenuItem {
icon.color: 'transparent'
enabled: Daemon.currentWallet // != null
enabled: Daemon.currentWallet
action: Action {
text: qsTr('Change Password');
onTriggered: rootItem.changePassword()
@ -71,7 +71,7 @@ Pane {
id: deleteWalletComp
MenuItem {
icon.color: 'transparent'
enabled: Daemon.currentWallet // != null
enabled: Daemon.currentWallet
action: Action {
text: qsTr('Delete Wallet');
onTriggered: rootItem.deleteWallet()
@ -87,7 +87,7 @@ Pane {
action: Action {
text: qsTr('Enable Lightning');
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'
}
}
@ -100,7 +100,7 @@ Pane {
// add items dynamically, if using visible: false property the menu item isn't removed but empty
Component.onCompleted: {
if (Daemon.currentWallet != null) {
if (Daemon.currentWallet) {
menu.insertItem(0, sepComp.createObject(menu))
if (Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning) {
menu.insertItem(0, enableLightningComp.createObject(menu))
@ -118,7 +118,7 @@ Pane {
GridLayout {
id: detailsLayout
visible: Daemon.currentWallet != null
visible: Daemon.currentWallet
Layout.preferredWidth: parent.width
columns: 4
@ -183,7 +183,7 @@ Pane {
}
ColumnLayout {
visible: Daemon.currentWallet == null
visible: !Daemon.currentWallet
Layout.alignment: Qt.AlignHCenter
Layout.bottomMargin: constants.paddingXXLarge

2
electrum/gui/qml/qetransactionlistmodel.py

@ -54,7 +54,7 @@ class QETransactionListModel(QAbstractListModel):
self.endResetModel()
def tx_to_model(self, tx):
self._logger.debug(str(tx))
#self._logger.debug(str(tx))
item = tx
item['key'] = item['txid'] if 'txid' in item else item['payment_hash']

Loading…
Cancel
Save