Skip to content

Commit 3505b2c

Browse files
committed
qml: add NavigationBar2
1 parent ee4dc7d commit 3505b2c

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

src/Makefile.qt.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ QML_RES_QML = \
367367
qml/controls/NavButton.qml \
368368
qml/controls/PageIndicator.qml \
369369
qml/controls/NavigationBar.qml \
370+
qml/controls/NavigationBar2.qml \
370371
qml/controls/OptionButton.qml \
371372
qml/controls/OptionSwitch.qml \
372373
qml/controls/OutlineButton.qml \

src/qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<file>controls/NavButton.qml</file>
2929
<file>controls/PageIndicator.qml</file>
3030
<file>controls/NavigationBar.qml</file>
31+
<file>controls/NavigationBar2.qml</file>
3132
<file>controls/OptionButton.qml</file>
3233
<file>controls/OptionSwitch.qml</file>
3334
<file>controls/OutlineButton.qml</file>

src/qml/controls/NavigationBar2.qml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Copyright (c) 2023 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+
9+
Pane {
10+
property alias leftItem: left_section.contentItem
11+
property alias centerItem: center_section.contentItem
12+
property alias rightItem: right_section.contentItem
13+
14+
background: null
15+
padding: 4
16+
contentItem: RowLayout {
17+
Div {
18+
id: left_div
19+
Layout.preferredWidth: Math.floor(Math.max(left_div.implicitWidth, right_div.implicitWidth))
20+
contentItem: RowLayout {
21+
Section {
22+
id: left_section
23+
}
24+
Spacer {
25+
}
26+
}
27+
}
28+
Section {
29+
id: center_section
30+
}
31+
Div {
32+
id: right_div
33+
Layout.preferredWidth: Math.floor(Math.max(left_div.implicitWidth, right_div.implicitWidth))
34+
contentItem: RowLayout {
35+
Spacer {
36+
}
37+
Section {
38+
id: right_section
39+
}
40+
}
41+
}
42+
}
43+
44+
component Div: Pane {
45+
Layout.alignment: Qt.AlignCenter
46+
Layout.fillWidth: true
47+
Layout.minimumWidth: implicitWidth
48+
background: null
49+
padding: 0
50+
}
51+
52+
component Section: Pane {
53+
Layout.alignment: Qt.AlignCenter
54+
Layout.minimumWidth: implicitWidth
55+
background: null
56+
padding: 0
57+
}
58+
59+
component Spacer: Item {
60+
Layout.alignment: Qt.AlignCenter
61+
Layout.fillWidth: true
62+
height: 1
63+
}
64+
}

0 commit comments

Comments
 (0)