21 import QtQuick.Controls 1.3 as Controls
22 import QtQuick.Layouts 1.2
23 import QtQuick.Controls.Private 1.0
25 import org.kde.kirigami 1.0
35 maximumHeight: preferredHeight
39 iconName:
"go-previous"
44 property string _internal:
""
48 readonly
property Page page: applicationWindow().pageStack.get(modelData)
49 property ListView view: ListView.view
50 readonly
property bool current: __appWindow.pageStack.currentIndex == index
55 if (__appWindow.wideScreen) {
56 if (modelData == 0 && view.x > 0) {
57 return page.width - Math.max(0, view.x - __appWindow.contentItem.x);
67 Component.onCompleted: {
68 layout = toolbarComponent.createObject(delegateItem)
74 x: __appWindow.wideScreen ? (Math.min(delegateItem.width - width, Math.max(0, delegateItem.view.contentX - delegateItem.x))) : 0
77 anchors.verticalCenter: parent.verticalCenter
78 color:
Theme.textColor
81 height: parent.height * 0.6
84 anchors.verticalCenter: parent.verticalCenter
85 iconName: page && page.actions && page.actions.main ? page.actions.main.iconName :
""
86 text: page && page.actions && page.actions.main ? page.actions.main.text :
""
87 tooltip: page && page.actions && page.actions.main ? page.actions.main.text :
""
88 checkable: page && page.actions && page.actions.main && page.actions.main.checkable
89 checked: page && page.actions && page.actions.main && page.actions.main.checked
90 enabled: page && page.actions && page.actions.main && page.actions.main.enabled
91 opacity: enabled ? 1 : 0.4
92 visible: page && page.actions && page.actions.main && page.actions.main.visible
93 onClicked: page.actions.main.trigger();
96 anchors.verticalCenter: parent.verticalCenter
97 iconName: page && page.actions && page.actions.left ? page.actions.left.iconName :
""
98 text: page && page.actions && page.actions.left ? page.actions.left.text :
""
99 tooltip: page && page.actions && page.actions.left ? page.actions.left.text :
""
100 checkable: page && page.actions && page.actions.left && page.actions.left.checkable
101 checked: page && page.actions && page.actions.left && page.actions.left.checked
102 enabled: page && page.actions && page.actions.left && page.actions.left.enabled
103 opacity: enabled ? 1 : 0.4
104 visible: page && page.actions && page.actions.left && page.actions.left && page.actions.left.visible
105 onClicked: page.actions.left.trigger();
107 Controls.ToolButton {
108 anchors.verticalCenter: parent.verticalCenter
109 iconName: page && page.actions && page.actions.right ? page.actions.right.iconName :
""
110 text: page && page.actions && page.actions.right ? page.actions.right.text :
""
111 tooltip: page && page.actions && page.actions.right ? page.actions.right.text :
""
112 checkable: page && page.actions && page.actions.right && page.actions.right.checkable
113 checked: page && page.actions && page.actions.right && page.actions.right.checked
114 enabled: page && page.actions && page.actions.right && page.actions.right.enabled
115 opacity: enabled ? 1 : 0.4
116 visible: page && page.actions && page.actions.right && page.actions.right && page.actions.right.visible
117 onClicked: page.actions.right.trigger();
120 anchors.verticalCenter: parent.verticalCenter
121 color:
Theme.textColor
124 height: parent.height * 0.6
128 model: page && page.actions.contextualActions ? page.actions.contextualActions : null
129 delegate: Controls.ToolButton {
130 anchors.verticalCenter: parent.verticalCenter
131 iconName: modelData.iconName
133 tooltip: modelData.text
134 checkable: modelData.checkable
135 checked: modelData.checked
136 enabled: modelData.enabled
137 opacity: enabled ? 1 : 0.4
138 visible: modelData.visible && x+layout.x+width*2 < delegateItem.width
139 onClicked: modelData.trigger();
145 x: __appWindow.wideScreen ? (Math.min(delegateItem.width - width, Math.max(0, delegateItem.view.contentX - delegateItem.x))) : 0
146 anchors.verticalCenter: parent.verticalCenter
147 visible: layout.width <= 0
148 opacity: delegateItem.current ? 1 : 0.4
149 color:
Theme.textColor
150 elide: Text.ElideRight
151 text: page ? page.title :
""
152 font.pixelSize: parent.height / 1.6
154 Controls.ToolButton {
158 verticalCenter: parent.verticalCenter
162 iconName:
"application-menu"
163 visible: menu.visibleChildren > 0
164 onClicked: page.actions.main
166 menu: Controls.Menu {
169 property int visibleChildren: 0
171 model: page && page.actions.contextualActions ? page.actions.contextualActions : null
172 delegate: Controls.MenuItem {
173 text: modelData ? modelData.text :
""
174 iconName: modelData.iconName
175 shortcut: modelData.shortcut
176 onTriggered: modelData.trigger();
178 visible: !layout.children[index+5].visible && modelData.visible
179 enabled: modelData.enabled
182 menu.visibleChildren++;
184 menu.visibleChildren = Math.max(0, menu.visibleChildren-1);
189 menu.insertItem(index,
object);
190 if (
object.visible) {
191 menu.visibleChildren++;
195 menu.removeItem(
object);
196 if (
object.visible) {
197 menu.visibleChildren = Math.max(0, menu.visibleChildren-1);
A heading label used for subsections of texts.
int smallSpacing
units.smallSpacing is the amount of spacing that should be used around smaller UI elements...
real devicePixelRatio
The ratio between physical and device-independent pixels.
Page is a container for all the app pages: everything pushed to the ApplicationWindow stackView shoul...