Browse Source

request dialog improve, icons

patch-4
Sander van Grieken 3 years ago
parent
commit
50e7c082cd
  1. BIN
      electrum/gui/icons/copy_bw.png
  2. BIN
      electrum/gui/icons/delete.png
  3. BIN
      electrum/gui/icons/share.png
  4. 233
      electrum/gui/qml/components/RequestDialog.qml

BIN
electrum/gui/icons/copy_bw.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 880 B

BIN
electrum/gui/icons/delete.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

BIN
electrum/gui/icons/share.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

233
electrum/gui/qml/components/RequestDialog.qml

@ -34,137 +34,142 @@ Dialog {
font.bold: true font.bold: true
font.pixelSize: 16 font.pixelSize: 16
} }
ToolButton {
Layout.alignment: Qt.AlignBaseline
icon.source: '../../icons/closebutton.png'
icon.color: 'transparent'
icon.width: 32
icon.height: 32
onClicked: dialog.close()
visible: false
}
} }
GridLayout {
width: parent.width
rowSpacing: constants.paddingXLarge
columns: 3
Rectangle { Flickable {
height: 1 anchors.fill: parent
Layout.fillWidth: true contentHeight: rootLayout.height
Layout.columnSpan: 3 clip:true
color: Material.accentColor interactive: height < contentHeight
}
Image { GridLayout {
Layout.columnSpan: 3 id: rootLayout
Layout.alignment: Qt.AlignHCenter width: parent.width
source: 'image://qrgen/' + modelItem.address rowSpacing: constants.paddingMedium
columns: 3
Rectangle { Rectangle {
property int size: 57 // should be qr pixel multiple height: 1
color: 'white' Layout.fillWidth: true
x: (parent.width - size) / 2 Layout.columnSpan: 3
y: (parent.height - size) / 2 color: Material.accentColor
width: size
height: size
Image {
source: '../../icons/electrum.png'
x: 1
y: 1
width: parent.width - 2
height: parent.height - 2
scale: 0.9
}
} }
}
Rectangle {
height: 1
Layout.fillWidth: true
Layout.columnSpan: 3
color: Material.accentColor
}
Label { Image {
visible: modelItem.message != '' Layout.columnSpan: 3
text: qsTr('Description') Layout.alignment: Qt.AlignHCenter
} Layout.topMargin: constants.paddingSmall
Label { Layout.bottomMargin: constants.paddingSmall
visible: modelItem.message != ''
Layout.columnSpan: 2 source: 'image://qrgen/' + modelItem.address
Layout.fillWidth: true
wrapMode: Text.WordWrap Rectangle {
text: modelItem.message property int size: 57 // should be qr pixel multiple
font.pixelSize: constants.fontSizeLarge color: 'white'
} x: (parent.width - size) / 2
y: (parent.height - size) / 2
width: size
height: size
Image {
source: '../../icons/electrum.png'
x: 1
y: 1
width: parent.width - 2
height: parent.height - 2
scale: 0.9
}
}
}
Label { Rectangle {
visible: modelItem.amount > 0 height: 1
text: qsTr('Amount') Layout.fillWidth: true
} Layout.columnSpan: 3
Label { color: Material.accentColor
visible: modelItem.amount > 0 }
text: Config.formatSats(modelItem.amount, false)
font.family: FixedFont
font.pixelSize: constants.fontSizeLarge
}
Label {
visible: modelItem.amount > 0
Layout.fillWidth: true
text: Config.baseUnit
color: Material.accentColor
font.pixelSize: constants.fontSizeLarge
}
Label { RowLayout {
text: qsTr('Address') Layout.columnSpan: 3
} Layout.alignment: Qt.AlignHCenter
Label { Button {
Layout.fillWidth: true icon.source: '../../icons/delete.png'
font.family: FixedFont text: qsTr('Delete')
font.pixelSize: constants.fontSizeLarge onClicked: {
wrapMode: Text.WrapAnywhere Daemon.currentWallet.delete_request(modelItem.key)
text: modelItem.address dialog.close()
} }
ToolButton { }
icon.source: '../../icons/copy.png' Button {
icon.color: 'transparent' icon.source: '../../icons/copy_bw.png'
onClicked: { icon.color: 'transparent'
AppController.textToClipboard(modelItem.address) text: 'Copy'
enabled: false
}
Button {
icon.source: '../../icons/share.png'
text: 'Share'
enabled: false
}
}
Label {
visible: modelItem.message != ''
text: qsTr('Description')
}
Label {
visible: modelItem.message != ''
Layout.columnSpan: 2
Layout.fillWidth: true
wrapMode: Text.WordWrap
text: modelItem.message
font.pixelSize: constants.fontSizeLarge
} }
}
Label { Label {
text: qsTr('Status') visible: modelItem.amount > 0
} text: qsTr('Amount')
Label { }
Layout.columnSpan: 2 Label {
Layout.fillWidth: true visible: modelItem.amount > 0
font.pixelSize: constants.fontSizeLarge text: Config.formatSats(modelItem.amount, false)
text: modelItem.status font.family: FixedFont
} font.pixelSize: constants.fontSizeLarge
}
Label {
visible: modelItem.amount > 0
Layout.fillWidth: true
text: Config.baseUnit
color: Material.accentColor
font.pixelSize: constants.fontSizeLarge
}
RowLayout { Label {
Layout.columnSpan: 3 text: qsTr('Address')
Layout.fillHeight: true }
Layout.alignment: Qt.AlignHCenter Label {
Button { Layout.fillWidth: true
text: 'Delete' font.family: FixedFont
font.pixelSize: constants.fontSizeLarge
wrapMode: Text.WrapAnywhere
text: modelItem.address
}
ToolButton {
icon.source: '../../icons/copy_bw.png'
onClicked: { onClicked: {
Daemon.currentWallet.delete_request(modelItem.key) AppController.textToClipboard(modelItem.address)
dialog.close()
} }
} }
Button {
text: 'Copy' Label {
enabled: false text: qsTr('Status')
} }
Button { Label {
text: 'Share' Layout.columnSpan: 2
enabled: false Layout.fillWidth: true
font.pixelSize: constants.fontSizeLarge
text: modelItem.status
} }
} }
} }

Loading…
Cancel
Save