Browse Source

add watch-only indicator

use default state instead of named state
set font defaults where it is convenient
patch-4
Sander van Grieken 3 years ago
parent
commit
f60eca054d
  1. 18
      electrum/gui/qml/components/Addresses.qml
  2. 2
      electrum/gui/qml/components/OpenWallet.qml
  3. 8
      electrum/gui/qml/components/Receive.qml
  4. 16
      electrum/gui/qml/components/main.qml

18
electrum/gui/qml/components/Addresses.qml

@ -36,17 +36,14 @@ Pane {
width: ListView.view.width
height: delegateLayout.height
highlighted: ListView.isCurrentItem
font.pixelSize: constants.fontSizeMedium // set default font size for child controls
onClicked: ListView.view.currentIndex == index
? ListView.view.currentIndex = -1
: ListView.view.currentIndex = index
states: [
State {
name: 'normal'; when: !highlighted
PropertyChanges { target: drawer; visible: false }
PropertyChanges { target: labelLabel; maximumLineCount: 2 }
},
State {
name: 'highlighted'; when: highlighted
PropertyChanges { target: drawer; visible: true }
@ -54,7 +51,6 @@ Pane {
}
]
ColumnLayout {
id: delegateLayout
// x: constants.paddingSmall
@ -71,19 +67,18 @@ Pane {
columns: 2
Label {
id: indexLabel
font.pixelSize: constants.fontSizeMedium
font.bold: true
text: '#' + ('00'+model.iaddr).slice(-2)
Layout.fillWidth: true
}
Label {
font.pixelSize: constants.fontSizeMedium
font.family: FixedFont
text: model.address
Layout.fillWidth: true
}
Rectangle {
id: useIndicator
Layout.preferredWidth: constants.iconSizeMedium
Layout.preferredHeight: constants.iconSizeMedium
color: model.held
@ -107,21 +102,17 @@ Pane {
Layout.fillWidth: true
}
Label {
font.pixelSize: constants.fontSizeMedium
font.family: FixedFont
text: Config.formatSats(model.balance, false)
}
Label {
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor
text: Config.baseUnit + ','
}
Label {
font.pixelSize: constants.fontSizeMedium
text: model.numtx
}
Label {
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor
text: qsTr('tx')
}
@ -130,6 +121,7 @@ Pane {
RowLayout {
id: drawer
visible: false
Layout.fillWidth: true
Layout.preferredHeight: 50

2
electrum/gui/qml/components/OpenWallet.qml

@ -97,7 +97,7 @@ Pane {
}
onReadyChanged: {
if (ready) {
Daemon.load_wallet(Daemon.path, password.text)
Daemon.load_wallet(openwalletdialog.path, password.text)
app.stack.pop(null)
}
}

8
electrum/gui/qml/components/Receive.qml

@ -193,6 +193,8 @@ Pane {
onClicked: console.log('Request ' + index + ' clicked')
font.pixelSize: constants.fontSizeSmall // set default font size for child controls
GridLayout {
id: item
@ -227,31 +229,25 @@ Pane {
Label {
text: qsTr('Amount: ')
font.pixelSize: constants.fontSizeSmall
}
Label {
id: amount
text: Config.formatSats(model.amount, true)
font.family: FixedFont
font.pixelSize: constants.fontSizeSmall
}
Label {
text: qsTr('Timestamp: ')
font.pixelSize: constants.fontSizeSmall
}
Label {
text: model.timestamp
font.pixelSize: constants.fontSizeSmall
}
Label {
text: qsTr('Status: ')
font.pixelSize: constants.fontSizeSmall
}
Label {
text: model.status
font.pixelSize: constants.fontSizeSmall
}
Rectangle {
Layout.columnSpan: 5

16
electrum/gui/qml/components/main.qml

@ -78,12 +78,20 @@ ApplicationWindow
}
}
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
visible: Daemon.currentWallet.isWatchOnly
source: '../../icons/eye1.png'
scale: 1.5
}
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: Network.status == 'connecting' || Network.status == 'disconnected'
? '../../icons/status_disconnected.png' :
Daemon.currentWallet.isUptodate
? '../../icons/status_disconnected.png'
: Daemon.currentWallet.isUptodate
? '../../icons/status_connected.png'
: '../../icons/status_lagging.png'
}
@ -97,8 +105,8 @@ ApplicationWindow
ToolButton {
id: menuButton
visible: stack.currentItem.menu !== undefined && stack.currentItem.menu.count > 0
text: qsTr("⋮")
enabled: stack.currentItem.menu !== undefined && stack.currentItem.menu.count > 0
text: enabled ? qsTr("≡") : ''
onClicked: {
stack.currentItem.menu.open()
// position the menu to the right

Loading…
Cancel
Save