Browse Source

qml: styling addresses/address details

patch-4
Sander van Grieken 2 years ago
parent
commit
18131e5a38
  1. 58
      electrum/gui/qml/components/AddressDetails.qml
  2. 36
      electrum/gui/qml/components/Addresses.qml

58
electrum/gui/qml/components/AddressDetails.qml

@ -11,51 +11,24 @@ Pane {
id: root id: root
width: parent.width width: parent.width
height: parent.height height: parent.height
padding: 0
property string address property string address
property string title: qsTr("Address details")
signal addressDetailsChanged signal addressDetailsChanged
property QtObject menu: Menu { ColumnLayout {
id: menu anchors.fill: parent
MenuItem { spacing: 0
icon.color: 'transparent'
action: Action {
text: qsTr('Spend from')
icon.source: '../../icons/tab_send.png'
enabled: false
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Sign/Verify')
icon.source: '../../icons/key.png'
enabled: false
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: qsTr('Encrypt/Decrypt')
icon.source: '../../icons/mail_icon.png'
enabled: false
}
}
MenuItem {
icon.color: 'transparent'
action: Action {
text: addressdetails.isFrozen ? qsTr('Unfreeze') : qsTr('Freeze')
onTriggered: addressdetails.freeze(!addressdetails.isFrozen)
icon.source: '../../icons/seal.png'
}
}
}
Flickable { Flickable {
anchors.fill: parent Layout.preferredWidth: parent.width
Layout.fillHeight: true
leftMargin: constants.paddingLarge
rightMargin: constants.paddingLarge
topMargin: constants.paddingLarge
contentHeight: rootLayout.height contentHeight: rootLayout.height
clip:true clip:true
interactive: height < contentHeight interactive: height < contentHeight
@ -63,6 +36,7 @@ Pane {
GridLayout { GridLayout {
id: rootLayout id: rootLayout
width: parent.width width: parent.width
columns: 2 columns: 2
Label { Label {
@ -255,6 +229,14 @@ Pane {
} }
} }
FlatButton {
Layout.fillWidth: true
text: addressdetails.isFrozen ? qsTr('Unfreeze address') : qsTr('Freeze address')
onClicked: addressdetails.freeze(!addressdetails.isFrozen)
icon.source: '../../icons/seal.png'
}
}
AddressDetails { AddressDetails {
id: addressdetails id: addressdetails
wallet: Daemon.currentWallet wallet: Daemon.currentWallet

36
electrum/gui/qml/components/Addresses.qml

@ -9,7 +9,6 @@ Pane {
id: rootItem id: rootItem
padding: 0 padding: 0
width: parent.width width: parent.width
property string title: Daemon.currentWallet.name + ' - ' + qsTr('Addresses')
ColumnLayout { ColumnLayout {
id: layout id: layout
@ -50,17 +49,15 @@ Pane {
ColumnLayout { ColumnLayout {
id: delegateLayout id: delegateLayout
width: parent.width
spacing: 0 spacing: 0
x: constants.paddingMedium
width: parent.width - 2*constants.paddingMedium
Item {
Layout.preferredWidth: 1
Layout.preferredHeight: constants.paddingTiny
}
GridLayout { GridLayout {
columns: 2 columns: 2
Layout.topMargin: constants.paddingSmall
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
Label { Label {
id: indexLabel id: indexLabel
font.bold: true font.bold: true
@ -137,30 +134,25 @@ Pane {
Component { Component {
id: sectionDelegate id: sectionDelegate
Rectangle { Item {
id: root id: root
width: ListView.view.width width: ListView.view.width
height: childrenRect.height height: childrenRect.height
color: 'transparent'
required property string section required property string section
RowLayout { ColumnLayout {
x: constants.paddingMedium width: parent.width
width: parent.width - 2 * constants.paddingMedium
Rectangle {
Layout.preferredHeight: 1
Layout.fillWidth: true
color: Material.accentColor
}
Label { Label {
padding: constants.paddingMedium Layout.topMargin: constants.paddingLarge
Layout.leftMargin: constants.paddingLarge
text: root.section + ' ' + qsTr('addresses') text: root.section + ' ' + qsTr('addresses')
font.bold: true font.pixelSize: constants.fontSizeLarge
font.pixelSize: constants.fontSizeMedium color: Material.accentColor
} }
Rectangle { Rectangle {
Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge
Layout.preferredHeight: 1 Layout.preferredHeight: 1
Layout.fillWidth: true Layout.fillWidth: true
color: Material.accentColor color: Material.accentColor

Loading…
Cancel
Save