Browse Source

qml: swapdialog styling fixes

master
Sander van Grieken 3 years ago
parent
commit
56e37f74d4
  1. 59
      electrum/gui/qml/components/SwapDialog.qml

59
electrum/gui/qml/components/SwapDialog.qml

@ -36,12 +36,26 @@ ElDialog {
Layout.leftMargin: constants.paddingLarge Layout.leftMargin: constants.paddingLarge
Layout.rightMargin: constants.paddingLarge Layout.rightMargin: constants.paddingLarge
RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true
Label { Label {
Layout.preferredWidth: 1
Layout.fillWidth: true
text: qsTr('You send') text: qsTr('You send')
color: Material.accentColor color: Material.accentColor
} }
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: swaphelper.isReverse ? '../../icons/lightning.png' : '../../icons/bitcoin.png'
visible: swaphelper.valid
}
}
RowLayout { RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true
Label { Label {
id: tosend id: tosend
text: Config.formatSats(swaphelper.tosend) text: Config.formatSats(swaphelper.tosend)
@ -53,18 +67,27 @@ ElDialog {
color: Material.accentColor color: Material.accentColor
visible: swaphelper.valid visible: swaphelper.valid
} }
Label {
text: swaphelper.isReverse ? qsTr('(offchain)') : qsTr('(onchain)')
visible: swaphelper.valid
}
} }
RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true
Label { Label {
Layout.preferredWidth: 1
Layout.fillWidth: true
text: qsTr('You receive') text: qsTr('You receive')
color: Material.accentColor color: Material.accentColor
} }
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: swaphelper.isReverse ? '../../icons/bitcoin.png' : '../../icons/lightning.png'
visible: swaphelper.valid
}
}
RowLayout { RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true Layout.fillWidth: true
Label { Label {
id: toreceive id: toreceive
@ -77,18 +100,18 @@ ElDialog {
color: Material.accentColor color: Material.accentColor
visible: swaphelper.valid visible: swaphelper.valid
} }
Label {
text: swaphelper.isReverse ? qsTr('(onchain)') : qsTr('(offchain)')
visible: swaphelper.valid
}
} }
Label { Label {
Layout.preferredWidth: 1
Layout.fillWidth: true
text: qsTr('Server fee') text: qsTr('Server fee')
color: Material.accentColor color: Material.accentColor
} }
RowLayout { RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true
Label { Label {
text: Config.formatSats(swaphelper.serverfee) text: Config.formatSats(swaphelper.serverfee)
font.family: FixedFont font.family: FixedFont
@ -103,26 +126,34 @@ ElDialog {
} }
Label { Label {
Layout.preferredWidth: 1
Layout.fillWidth: true
text: qsTr('Mining fee') text: qsTr('Mining fee')
color: Material.accentColor color: Material.accentColor
} }
RowLayout { RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true
Label { Label {
text: Config.formatSats(swaphelper.miningfee) text: Config.formatSats(swaphelper.miningfee)
font.family: FixedFont font.family: FixedFont
} }
Label { Label {
Layout.fillWidth: true
text: Config.baseUnit text: Config.baseUnit
color: Material.accentColor color: Material.accentColor
} }
} }
}
Slider { Slider {
id: swapslider id: swapslider
Layout.columnSpan: 2 Layout.topMargin: constants.paddingLarge
Layout.preferredWidth: 2/3 * layout.width Layout.bottomMargin: constants.paddingLarge
Layout.alignment: Qt.AlignHCenter Layout.leftMargin: constants.paddingXXLarge
Layout.rightMargin: constants.paddingXXLarge
Layout.fillWidth: true
from: swaphelper.rangeMin from: swaphelper.rangeMin
to: swaphelper.rangeMax to: swaphelper.rangeMax
@ -143,13 +174,13 @@ ElDialog {
} }
InfoTextArea { InfoTextArea {
Layout.columnSpan: 2 Layout.leftMargin: constants.paddingXXLarge
Layout.preferredWidth: swapslider.width Layout.rightMargin: constants.paddingXXLarge
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
visible: swaphelper.userinfo != '' visible: swaphelper.userinfo != ''
text: swaphelper.userinfo text: swaphelper.userinfo
} }
}
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 } Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }

Loading…
Cancel
Save