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

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

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

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

@ -193,6 +193,8 @@ Pane {
onClicked: console.log('Request ' + index + ' clicked') onClicked: console.log('Request ' + index + ' clicked')
font.pixelSize: constants.fontSizeSmall // set default font size for child controls
GridLayout { GridLayout {
id: item id: item
@ -227,31 +229,25 @@ Pane {
Label { Label {
text: qsTr('Amount: ') text: qsTr('Amount: ')
font.pixelSize: constants.fontSizeSmall
} }
Label { Label {
id: amount id: amount
text: Config.formatSats(model.amount, true) text: Config.formatSats(model.amount, true)
font.family: FixedFont font.family: FixedFont
font.pixelSize: constants.fontSizeSmall
} }
Label { Label {
text: qsTr('Timestamp: ') text: qsTr('Timestamp: ')
font.pixelSize: constants.fontSizeSmall
} }
Label { Label {
text: model.timestamp text: model.timestamp
font.pixelSize: constants.fontSizeSmall
} }
Label { Label {
text: qsTr('Status: ') text: qsTr('Status: ')
font.pixelSize: constants.fontSizeSmall
} }
Label { Label {
text: model.status text: model.status
font.pixelSize: constants.fontSizeSmall
} }
Rectangle { Rectangle {
Layout.columnSpan: 5 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 { Image {
Layout.preferredWidth: constants.iconSizeSmall Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall Layout.preferredHeight: constants.iconSizeSmall
source: Network.status == 'connecting' || Network.status == 'disconnected' source: Network.status == 'connecting' || Network.status == 'disconnected'
? '../../icons/status_disconnected.png' : ? '../../icons/status_disconnected.png'
Daemon.currentWallet.isUptodate : Daemon.currentWallet.isUptodate
? '../../icons/status_connected.png' ? '../../icons/status_connected.png'
: '../../icons/status_lagging.png' : '../../icons/status_lagging.png'
} }
@ -97,8 +105,8 @@ ApplicationWindow
ToolButton { ToolButton {
id: menuButton id: menuButton
visible: stack.currentItem.menu !== undefined && stack.currentItem.menu.count > 0 enabled: stack.currentItem.menu !== undefined && stack.currentItem.menu.count > 0
text: qsTr("⋮") text: enabled ? qsTr("≡") : ''
onClicked: { onClicked: {
stack.currentItem.menu.open() stack.currentItem.menu.open()
// position the menu to the right // position the menu to the right

Loading…
Cancel
Save