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
width: parent.width
height: parent.height
padding: 0
property string address
property string title: qsTr("Address details")
signal addressDetailsChanged
property QtObject menu: Menu {
id: menu
MenuItem {
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'
}
}
}
ColumnLayout {
anchors.fill: parent
spacing: 0
Flickable {
anchors.fill: parent
Layout.preferredWidth: parent.width
Layout.fillHeight: true
leftMargin: constants.paddingLarge
rightMargin: constants.paddingLarge
topMargin: constants.paddingLarge
contentHeight: rootLayout.height
clip:true
interactive: height < contentHeight
@ -63,6 +36,7 @@ Pane {
GridLayout {
id: rootLayout
width: parent.width
columns: 2
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 {
id: addressdetails
wallet: Daemon.currentWallet

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

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

Loading…
Cancel
Save