-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavBar.qml
More file actions
58 lines (46 loc) · 1.45 KB
/
NavBar.qml
File metadata and controls
58 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (C) 2026 Qt Group.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
import QtQuick
import QtQuick.Controls.iOS
ToolBar {
id: toolbar
width: parent.width
anchors.top: parent.top
property Flickable flickable
property StackView stackView: root.stackView
property Popup popup
property var previousItem: stackView.get(parent.StackView.index - 1)
property alias addNewButton: addNewButton
property alias editingFinishedButton: editingFinishedButton
background.visible: !flickable.atYBeginning
// Back button
ToolButton {
anchors.left: parent.left
display: Qt.ToolButtonTextBesideIcon
icon.source: "qrc:/back-light"
visible: stackView.depth >= 2
text: previousItem ? previousItem.title : ""
onClicked: stackView.pop()
}
// Title
Label {
anchors.centerIn: parent
font.styleName: "Semibold"
text: stackView.currentItem.title
visible: toolbar.background.visible
}
ToolButton {
id: addNewButton
display: Qt.ToolButtonIconOnly
icon.source: "qrc:/images/add-new.png"
anchors.right: parent.right
onClicked: popup.open()
}
ToolButton {
id: editingFinishedButton
display: Qt.ToolButtonTextOnly
text: qsTr("Done")
visible: false
anchors.right: parent.right
}
}