Browse Source

qml: swapdialog styling fixes

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

109
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
Label { RowLayout {
text: qsTr('You send') Layout.preferredWidth: 1
color: Material.accentColor Layout.fillWidth: true
Label {
Layout.preferredWidth: 1
Layout.fillWidth: true
text: qsTr('You send')
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
} }
}
RowLayout {
Layout.preferredWidth: 1
Layout.fillWidth: true
Label { Label {
text: swaphelper.isReverse ? qsTr('(offchain)') : qsTr('(onchain)') Layout.preferredWidth: 1
Layout.fillWidth: true
text: qsTr('You receive')
color: Material.accentColor
}
Image {
Layout.preferredWidth: constants.iconSizeSmall
Layout.preferredHeight: constants.iconSizeSmall
source: swaphelper.isReverse ? '../../icons/bitcoin.png' : '../../icons/lightning.png'
visible: swaphelper.valid visible: swaphelper.valid
} }
} }
Label {
text: qsTr('You receive')
color: Material.accentColor
}
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,52 +126,60 @@ 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
onValueChanged: { onValueChanged: {
if (activeFocus) if (activeFocus)
swaphelper.sliderPos = value swaphelper.sliderPos = value
} }
Component.onCompleted: { Component.onCompleted: {
value = swaphelper.sliderPos value = swaphelper.sliderPos
} }
Connections { Connections {
target: swaphelper target: swaphelper
function onSliderPosChanged() { function onSliderPosChanged() {
swapslider.value = swaphelper.sliderPos swapslider.value = swaphelper.sliderPos
}
} }
} }
}
InfoTextArea { InfoTextArea {
Layout.columnSpan: 2 Layout.leftMargin: constants.paddingXXLarge
Layout.preferredWidth: swapslider.width Layout.rightMargin: constants.paddingXXLarge
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
visible: swaphelper.userinfo != '' Layout.alignment: Qt.AlignHCenter
text: swaphelper.userinfo visible: swaphelper.userinfo != ''
} text: swaphelper.userinfo
} }
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 } Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }

Loading…
Cancel
Save