Skip to content

Commit c33abef

Browse files
committed
qml: Introduce KeyValueRow control
1 parent 6480cfe commit c33abef

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ QML_RES_QML = \
364364
qml/controls/Header.qml \
365365
qml/controls/Icon.qml \
366366
qml/controls/InformationPage.qml \
367+
qml/controls/KeyValueRow.qml \
367368
qml/controls/NavButton.qml \
368369
qml/controls/PageIndicator.qml \
369370
qml/controls/NavigationBar.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<file>controls/Header.qml</file>
2626
<file>controls/Icon.qml</file>
2727
<file>controls/InformationPage.qml</file>
28+
<file>controls/KeyValueRow.qml</file>
2829
<file>controls/NavButton.qml</file>
2930
<file>controls/PageIndicator.qml</file>
3031
<file>controls/NavigationBar.qml</file>

src/qml/controls/KeyValueRow.qml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright (c) 2024 The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
import QtQuick 2.15
6+
import QtQuick.Controls 2.15
7+
import QtQuick.Layouts 1.15
8+
import org.bitcoincore.qt 1.0
9+
10+
RowLayout {
11+
id: root
12+
property alias key: key_field.contentItem
13+
property alias value: value_field.contentItem
14+
width: parent.width
15+
16+
spacing: 10
17+
Pane {
18+
id: key_field
19+
implicitWidth: 125
20+
Layout.alignment: Qt.AlignLeft
21+
background: null
22+
padding: 0
23+
}
24+
Pane {
25+
id: value_field
26+
Layout.fillWidth: true
27+
Layout.alignment: Qt.AlignLeft
28+
implicitHeight: Math.max(value_field.contentHeight, 21)
29+
padding: 0
30+
background: null
31+
}
32+
}

0 commit comments

Comments
 (0)