Browse Source

qml: topbar label show wallet icon only when wallet name is displayed

master
Sander van Grieken 3 years ago
parent
commit
0da1be33b7
  1. 2
      electrum/gui/qml/components/Wallets.qml
  2. 7
      electrum/gui/qml/components/main.qml

2
electrum/gui/qml/components/Wallets.qml

@ -13,6 +13,8 @@ Pane {
padding: 0 padding: 0
property string title: qsTr('Wallets')
function createWallet() { function createWallet() {
var dialog = app.newWalletWizard.createObject(app) var dialog = app.newWalletWizard.createObject(app)
dialog.open() dialog.open()

7
electrum/gui/qml/components/main.qml

@ -119,7 +119,7 @@ ApplicationWindow
Image { Image {
Layout.preferredWidth: constants.iconSizeSmall Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall Layout.preferredHeight: constants.iconSizeSmall
visible: Daemon.currentWallet && stack.currentItem.title == Daemon.currentWallet.name visible: Daemon.currentWallet && (!stack.currentItem.title || stack.currentItem.title == Daemon.currentWallet.name)
source: '../../icons/wallet.png' source: '../../icons/wallet.png'
} }
@ -127,14 +127,15 @@ ApplicationWindow
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: Math.max(implicitHeight, toolbarTopLayout.height) Layout.preferredHeight: Math.max(implicitHeight, toolbarTopLayout.height)
text: stack.currentItem.title text: stack.currentItem.title
? stack.currentItem.title
: Daemon.currentWallet.name
elide: Label.ElideRight elide: Label.ElideRight
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
font.pixelSize: constants.fontSizeMedium font.pixelSize: constants.fontSizeMedium
font.bold: true font.bold: true
MouseArea { MouseArea {
height: toolbarTopLayout.height // height: toolbarTopLayout.height
anchors.fill: parent anchors.fill: parent
// enabled: Daemon.currentWallet
onClicked: { onClicked: {
stack.getRoot().menu.open() stack.getRoot().menu.open()
stack.getRoot().menu.y = toolbar.height stack.getRoot().menu.y = toolbar.height

Loading…
Cancel
Save