qml: move menu back to topbar, move addresses and channels to walletdetails and
add walletdetails to topbar menu
This commit is contained in:
@@ -498,6 +498,21 @@ Pane {
|
||||
visible: Daemon.currentWallet && Daemon.currentWallet.canHaveLightning && !Daemon.currentWallet.isLightning
|
||||
icon.source: '../../icons/lightning.png'
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Channels')
|
||||
onClicked: app.stack.push(Qt.resolvedUrl('Channels.qml'))
|
||||
visible: Daemon.currentWallet && Daemon.currentWallet.isLightning
|
||||
icon.source: '../../icons/lightning.png'
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1
|
||||
text: qsTr('Addresses')
|
||||
onClicked: app.stack.push(Qt.resolvedUrl('Addresses.qml'))
|
||||
icon.source: '../../icons/tab_addresses.png'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,30 +55,24 @@ Item {
|
||||
}
|
||||
|
||||
id: menu
|
||||
|
||||
MenuItem {
|
||||
icon.color: 'transparent'
|
||||
action: Action {
|
||||
text: qsTr('Addresses');
|
||||
onTriggered: menu.openPage(Qt.resolvedUrl('Addresses.qml'));
|
||||
text: qsTr('Wallet details')
|
||||
enabled: Daemon.currentWallet
|
||||
icon.source: '../../icons/tab_addresses.png'
|
||||
}
|
||||
}
|
||||
MenuItem {
|
||||
icon.color: 'transparent'
|
||||
action: Action {
|
||||
text: qsTr('Channels');
|
||||
enabled: Daemon.currentWallet && Daemon.currentWallet.isLightning
|
||||
onTriggered: menu.openPage(Qt.resolvedUrl('Channels.qml'))
|
||||
icon.source: '../../icons/lightning.png'
|
||||
onTriggered: menu.openPage(true, Qt.resolvedUrl('WalletDetails.qml'))
|
||||
icon.source: '../../icons/wallet.png'
|
||||
}
|
||||
}
|
||||
|
||||
MenuSeparator { }
|
||||
|
||||
MenuItem {
|
||||
icon.color: 'transparent'
|
||||
action: Action {
|
||||
text: qsTr('Preferences');
|
||||
onTriggered: menu.openPage(Qt.resolvedUrl('Preferences.qml'))
|
||||
onTriggered: menu.openPage(false, Qt.resolvedUrl('Preferences.qml'))
|
||||
icon.source: '../../icons/preferences.png'
|
||||
}
|
||||
}
|
||||
@@ -87,13 +81,17 @@ Item {
|
||||
icon.color: 'transparent'
|
||||
action: Action {
|
||||
text: qsTr('About');
|
||||
onTriggered: menu.openPage(Qt.resolvedUrl('About.qml'))
|
||||
onTriggered: menu.openPage(false, Qt.resolvedUrl('About.qml'))
|
||||
icon.source: '../../icons/electrum.png'
|
||||
}
|
||||
}
|
||||
|
||||
function openPage(url) {
|
||||
stack.push(url)
|
||||
function openPage(onroot, url) {
|
||||
if (onroot) {
|
||||
stack.pushOnRoot(url)
|
||||
} else {
|
||||
stack.push(url)
|
||||
}
|
||||
currentIndex = -1
|
||||
}
|
||||
}
|
||||
@@ -157,21 +155,6 @@ Item {
|
||||
id: buttonContainer
|
||||
Layout.fillWidth: true
|
||||
|
||||
FlatButton {
|
||||
Layout.fillWidth: false
|
||||
Layout.preferredWidth: implicitHeight
|
||||
Layout.preferredHeight: receiveButton.implicitHeight
|
||||
|
||||
icon.source: '../../icons/hamburger.png'
|
||||
icon.height: constants.iconSizeSmall
|
||||
icon.width: constants.iconSizeSmall
|
||||
|
||||
onClicked: {
|
||||
mainView.menu.open()
|
||||
mainView.menu.y = mainView.height + app.header.height - mainView.menu.height - buttonContainer.height
|
||||
}
|
||||
}
|
||||
|
||||
FlatButton {
|
||||
id: receiveButton
|
||||
visible: Daemon.currentWallet
|
||||
|
||||
@@ -123,14 +123,6 @@ Item {
|
||||
font.pixelSize: constants.fontSizeLarge
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: balancePane
|
||||
onClicked: {
|
||||
app.stack.pushOnRoot(Qt.resolvedUrl('../WalletDetails.qml'))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// instead of all these explicit connections, we should expose
|
||||
// formatted balances directly as a property
|
||||
Connections {
|
||||
|
||||
@@ -62,25 +62,33 @@ ApplicationWindow
|
||||
Layout.rightMargin: constants.paddingMedium
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
Item {
|
||||
Layout.preferredWidth: constants.paddingXLarge
|
||||
Layout.preferredHeight: 1
|
||||
ToolButton {
|
||||
id: menuButton
|
||||
enabled: stack.currentItem && stack.currentItem.menu
|
||||
? stack.currentItem.menu.count > 0
|
||||
: false
|
||||
|
||||
text: enabled ? '≡' : ''
|
||||
font.pixelSize: constants.fontSizeXLarge
|
||||
onClicked: {
|
||||
stack.currentItem.menu.open()
|
||||
stack.currentItem.menu.y = toolbarTopLayout.height
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
visible: Daemon.currentWallet
|
||||
source: '../../icons/wallet.png'
|
||||
Layout.preferredWidth: constants.iconSizeSmall
|
||||
Layout.preferredHeight: constants.iconSizeSmall
|
||||
visible: Daemon.currentWallet
|
||||
source: '../../icons/wallet.png'
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.max(implicitHeight, toolbarTopLayout.height)
|
||||
text: stack.currentItem.title
|
||||
elide: Label.ElideRight
|
||||
// horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: constants.fontSizeMedium
|
||||
font.bold: true
|
||||
MouseArea {
|
||||
|
||||
Reference in New Issue
Block a user