Browse Source

qml: make ConfirmTxDialog flickable if content larger than window (fixes #8446)

master
Sander van Grieken 3 years ago
parent
commit
6fbe765a3e
  1. 242
      electrum/gui/qml/components/ConfirmTxDialog.qml

242
electrum/gui/qml/components/ConfirmTxDialog.qml

@ -35,165 +35,173 @@ ElDialog {
} }
ColumnLayout { ColumnLayout {
width: parent.width anchors.fill: parent
height: parent.height
spacing: 0 spacing: 0
GridLayout { Flickable {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: constants.paddingLarge Layout.fillHeight: true
Layout.rightMargin: constants.paddingLarge
columns: 2 leftMargin: constants.paddingLarge
rightMargin: constants.paddingLarge
Label { contentHeight: rootLayout.height
id: amountLabel clip: true
Layout.fillWidth: true interactive: height < contentHeight
Layout.minimumWidth: implicitWidth
text: qsTr('Amount to send')
color: Material.accentColor
}
RowLayout {
Layout.fillWidth: true
Label {
id: btcValue
font.bold: true
font.family: FixedFont
}
Label { GridLayout {
text: Config.baseUnit id: rootLayout
color: Material.accentColor width: parent.width
}
columns: 2
Label { Label {
id: fiatValue id: amountLabel
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium Layout.minimumWidth: implicitWidth
text: qsTr('Amount to send')
color: Material.accentColor
} }
RowLayout {
Component.onCompleted: updateAmountText() Layout.fillWidth: true
Connections { Label {
target: finalizer id: btcValue
function onEffectiveAmountChanged() { font.bold: true
updateAmountText() font.family: FixedFont
} }
}
}
Label { Label {
text: qsTr('Mining fee') text: Config.baseUnit
color: Material.accentColor color: Material.accentColor
} }
FormattedAmount { Label {
amount: finalizer.fee id: fiatValue
} Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium
}
Label { Component.onCompleted: updateAmountText()
visible: !finalizer.extraFee.isEmpty Connections {
text: qsTr('Extra fee') target: finalizer
color: Material.accentColor function onEffectiveAmountChanged() {
} updateAmountText()
}
}
}
FormattedAmount { Label {
visible: !finalizer.extraFee.isEmpty text: qsTr('Mining fee')
amount: finalizer.extraFee color: Material.accentColor
} }
Label { FormattedAmount {
text: qsTr('Fee rate') amount: finalizer.fee
color: Material.accentColor }
}
RowLayout {
Label { Label {
id: feeRate visible: !finalizer.extraFee.isEmpty
text: finalizer.feeRate text: qsTr('Extra fee')
font.family: FixedFont color: Material.accentColor
}
FormattedAmount {
visible: !finalizer.extraFee.isEmpty
amount: finalizer.extraFee
} }
Label { Label {
text: 'sat/vB' text: qsTr('Fee rate')
color: Material.accentColor color: Material.accentColor
} }
}
Label { RowLayout {
text: qsTr('Target') Label {
color: Material.accentColor id: feeRate
} text: finalizer.feeRate
font.family: FixedFont
}
Label { Label {
id: targetdesc text: 'sat/vB'
text: finalizer.target color: Material.accentColor
} }
}
RowLayout { Label {
Layout.columnSpan: 2 text: qsTr('Target')
Layout.fillWidth: true color: Material.accentColor
}
Label {
id: targetdesc
text: finalizer.target
}
Slider { RowLayout {
id: feeslider Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
leftPadding: constants.paddingMedium
snapMode: Slider.SnapOnRelease Slider {
stepSize: 1 id: feeslider
from: 0 Layout.fillWidth: true
to: finalizer.sliderSteps leftPadding: constants.paddingMedium
onValueChanged: { snapMode: Slider.SnapOnRelease
if (activeFocus) stepSize: 1
finalizer.sliderPos = value from: 0
} to: finalizer.sliderSteps
Component.onCompleted: {
value = finalizer.sliderPos onValueChanged: {
} if (activeFocus)
Connections { finalizer.sliderPos = value
target: finalizer }
function onSliderPosChanged() { Component.onCompleted: {
feeslider.value = finalizer.sliderPos value = finalizer.sliderPos
}
Connections {
target: finalizer
function onSliderPosChanged() {
feeslider.value = finalizer.sliderPos
}
} }
} }
}
FeeMethodComboBox { FeeMethodComboBox {
id: target id: target
feeslider: finalizer feeslider: finalizer
}
} }
}
InfoTextArea {
Layout.columnSpan: 2
Layout.fillWidth: true
Layout.topMargin: constants.paddingLarge
Layout.bottomMargin: constants.paddingLarge
visible: finalizer.warning != ''
text: finalizer.warning
iconStyle: InfoTextArea.IconStyle.Warn
}
Label {
text: qsTr('Outputs')
Layout.columnSpan: 2
color: Material.accentColor
}
Repeater { InfoTextArea {
model: finalizer.outputs
delegate: TxOutput {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: constants.paddingLarge
Layout.bottomMargin: constants.paddingLarge
visible: finalizer.warning != ''
text: finalizer.warning
iconStyle: InfoTextArea.IconStyle.Warn
}
allowShare: false Label {
model: modelData text: qsTr('Outputs')
Layout.columnSpan: 2
color: Material.accentColor
}
Repeater {
model: finalizer.outputs
delegate: TxOutput {
Layout.columnSpan: 2
Layout.fillWidth: true
allowShare: false
model: modelData
}
} }
} }
} }
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
FlatButton { FlatButton {
id: sendButton id: sendButton
Layout.fillWidth: true Layout.fillWidth: true

Loading…
Cancel
Save