Files
amnezia-client/client/ui/qml/Components/BenefitRow.qml
T

65 lines
1.6 KiB
QML
Raw Normal View History

2026-04-08 11:21:12 +07:00
import QtQuick
import QtQuick.Layouts
import Style 1.0
import "../Controls2/TextTypes"
RowLayout {
id: root
property string iconSource: ""
property string titleText: ""
property string bodyText: ""
2026-04-10 21:24:00 +07:00
property bool link: false
readonly property string bodyLineText: root.link && root.bodyText.length > 0 ? "@" + root.bodyText : root.bodyText
readonly property bool bodyClickable: root.link && root.bodyText.length > 0
2026-04-08 11:21:12 +07:00
spacing: 12
Image {
Layout.alignment: Qt.AlignTop
Layout.preferredWidth: 22
Layout.preferredHeight: 22
source: root.iconSource
fillMode: Image.PreserveAspectFit
}
ColumnLayout {
Layout.fillWidth: true
spacing: 4
LabelTextType {
Layout.fillWidth: true
text: root.titleText
color: AmneziaStyle.color.paleGray
font.pixelSize: 16
font.weight: Font.DemiBold
wrapMode: Text.Wrap
}
Item {
Layout.fillWidth: true
implicitHeight: bodyLabel.implicitHeight
LabelTextType {
id: bodyLabel
width: parent.width
2026-04-10 21:24:00 +07:00
text: root.bodyLineText
color: root.link ? AmneziaStyle.color.goldenApricot : AmneziaStyle.color.mutedGray
2026-04-08 11:21:12 +07:00
font.pixelSize: 14
wrapMode: Text.Wrap
}
MouseArea {
anchors.fill: bodyLabel
2026-04-10 21:24:00 +07:00
visible: root.bodyClickable
2026-04-08 11:21:12 +07:00
cursorShape: Qt.PointingHandCursor
2026-04-10 21:24:00 +07:00
onClicked: Qt.openUrlExternally("https://t.me/" + root.bodyText)
2026-04-08 11:21:12 +07:00
}
}
}
}