Files
pallectrum/electrum/gui/qml/components/controls/TxInput.qml
Davide Grilli 701f5ba1b1 Fix(QML): Resolve text overlap in transaction input display
Split transaction input display into two rows to prevent overlap
between short_id and value fields on Android QML interface.

- First row: input index and short_id (with text eliding)
- Second row: value amount and unit (indented)

Fixes readability issues on small screens and long identifiers.
2025-12-10 10:36:36 +01:00

96 lines
2.8 KiB
QML

import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material
import org.electrum 1.0
TextHighlightPane {
id: root
property variant model
property int idx: -1
property string _suffix: model.is_mine || model.is_change
? qsTr('mine')
: model.is_swap
? qsTr('swap')
: model.is_accounting
? qsTr('accounting')
: ""
ColumnLayout {
width: parent.width
RowLayout {
Layout.fillWidth: true
Label {
Layout.rightMargin: constants.paddingMedium
text: '#' + idx
font.family: FixedFont
font.bold: true
}
Label {
Layout.fillWidth: true
text: model.short_id
font.family: FixedFont
wrapMode: Text.NoWrap
elide: Text.ElideRight
}
}
RowLayout {
Layout.fillWidth: true
Layout.leftMargin: constants.paddingLarge
Label {
id: txin_value
text: model.value != undefined
? Config.formatSats(model.value)
: '<' + qsTr('unknown amount') + '>'
font.pixelSize: constants.fontSizeMedium
font.family: FixedFont
}
Label {
text: Config.baseUnit
visible: model.value != undefined
font.pixelSize: constants.fontSizeMedium
color: Material.accentColor
}
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1
antialiasing: true
color: constants.mutedForeground
}
RowLayout {
Layout.fillWidth: true
Label {
Layout.fillWidth: true
text: model.address
? model.address + (_suffix
? ' <span style="font-size:' + constants.fontSizeXSmall + 'px">(' + _suffix + ')</span>'
: "")
: '&lt;' + qsTr('address unknown') + '&gt;'
font.family: FixedFont
font.pixelSize: constants.fontSizeMedium
textFormat: Text.RichText
color: model.is_mine
? model.is_change
? constants.colorAddressInternal
: constants.colorAddressExternal
: model.is_swap
? constants.colorAddressSwap
: model.is_accounting
? constants.colorAddressAccounting
: Material.foreground
wrapMode: Text.WrapAnywhere
}
}
}
}