1
0

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

This commit is contained in:
Sander van Grieken
2023-05-31 11:29:14 +02:00
committed by SomberNight
parent 10574bb14d
commit 6d8ace4abe

View File

@@ -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') GridLayout {
color: Material.accentColor id: rootLayout
} width: parent.width
RowLayout {
Layout.fillWidth: true columns: 2
Label {
id: btcValue
font.bold: true
font.family: FixedFont
}
Label { Label {
text: Config.baseUnit id: amountLabel
Layout.fillWidth: true
Layout.minimumWidth: implicitWidth
text: qsTr('Amount to send')
color: Material.accentColor color: Material.accentColor
} }
RowLayout {
Label {
id: fiatValue
Layout.fillWidth: true Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium Label {
} id: btcValue
font.bold: true
Component.onCompleted: updateAmountText() font.family: FixedFont
Connections {
target: finalizer
function onEffectiveAmountChanged() {
updateAmountText()
} }
}
}
Label { Label {
text: qsTr('Mining fee') text: Config.baseUnit
color: Material.accentColor color: Material.accentColor
}
FormattedAmount {
amount: finalizer.fee
}
Label {
visible: !finalizer.extraFee.isEmpty
text: qsTr('Extra fee')
color: Material.accentColor
}
FormattedAmount {
visible: !finalizer.extraFee.isEmpty
amount: finalizer.extraFee
}
Label {
text: qsTr('Fee rate')
color: Material.accentColor
}
RowLayout {
Label {
id: feeRate
text: finalizer.feeRate
font.family: FixedFont
}
Label {
text: 'sat/vB'
color: Material.accentColor
}
}
Label {
text: qsTr('Target')
color: Material.accentColor
}
Label {
id: targetdesc
text: finalizer.target
}
RowLayout {
Layout.columnSpan: 2
Layout.fillWidth: true
Slider {
id: feeslider
Layout.fillWidth: true
leftPadding: constants.paddingMedium
snapMode: Slider.SnapOnRelease
stepSize: 1
from: 0
to: finalizer.sliderSteps
onValueChanged: {
if (activeFocus)
finalizer.sliderPos = value
} }
Component.onCompleted: {
value = finalizer.sliderPos Label {
id: fiatValue
Layout.fillWidth: true
font.pixelSize: constants.fontSizeMedium
} }
Component.onCompleted: updateAmountText()
Connections { Connections {
target: finalizer target: finalizer
function onSliderPosChanged() { function onEffectiveAmountChanged() {
feeslider.value = finalizer.sliderPos updateAmountText()
} }
} }
} }
FeeMethodComboBox { Label {
id: target text: qsTr('Mining fee')
feeslider: finalizer color: Material.accentColor
} }
}
InfoTextArea { FormattedAmount {
Layout.columnSpan: 2 amount: finalizer.fee
Layout.fillWidth: true }
Layout.topMargin: constants.paddingLarge
Layout.bottomMargin: constants.paddingLarge
visible: finalizer.warning != ''
text: finalizer.warning
iconStyle: InfoTextArea.IconStyle.Warn
}
Label { Label {
text: qsTr('Outputs') visible: !finalizer.extraFee.isEmpty
Layout.columnSpan: 2 text: qsTr('Extra fee')
color: Material.accentColor color: Material.accentColor
} }
Repeater { FormattedAmount {
model: finalizer.outputs visible: !finalizer.extraFee.isEmpty
delegate: TxOutput { amount: finalizer.extraFee
}
Label {
text: qsTr('Fee rate')
color: Material.accentColor
}
RowLayout {
Label {
id: feeRate
text: finalizer.feeRate
font.family: FixedFont
}
Label {
text: 'sat/vB'
color: Material.accentColor
}
}
Label {
text: qsTr('Target')
color: Material.accentColor
}
Label {
id: targetdesc
text: finalizer.target
}
RowLayout {
Layout.columnSpan: 2 Layout.columnSpan: 2
Layout.fillWidth: true Layout.fillWidth: true
allowShare: false Slider {
model: modelData id: feeslider
Layout.fillWidth: true
leftPadding: constants.paddingMedium
snapMode: Slider.SnapOnRelease
stepSize: 1
from: 0
to: finalizer.sliderSteps
onValueChanged: {
if (activeFocus)
finalizer.sliderPos = value
}
Component.onCompleted: {
value = finalizer.sliderPos
}
Connections {
target: finalizer
function onSliderPosChanged() {
feeslider.value = finalizer.sliderPos
}
}
}
FeeMethodComboBox {
id: target
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 {
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