9import QtQuick.Templates as T
10import QtQuick.Controls as QQC2
11import org.kde.kirigami as Kirigami
26 padding: Kirigami.Units.gridUnit
39 property Flickable flickable
58 property list<T.Action> actions
71 readonly
property bool isCurrentPage: Kirigami.ColumnView.view
72 ? (Kirigami.ColumnView.index === Kirigami.ColumnView.view.currentIndex && Kirigami.ColumnView.view.parent.parent.currentItem === Kirigami.ColumnView.view.parent)
73 : (parent && parent instanceof QQC2.StackView
74 ? parent.currentItem === root
86 readonly property alias overlay: overlayItem
92 property P.ActionIconGroup icon: P.ActionIconGroup {}
103 property var progress: undefined
112 property Component titleDelegate: Component {
113 id: defaultTitleDelegate
114 P.DefaultPageTitleDelegate {
126 readonly property Item globalToolBarItem: globalToolBar.item
137 property int globalToolBarStyle: {
138 if (globalToolBar.row && !globalToolBar.stack) {
139 return globalToolBar.row.globalToolBar.actualStyle;
140 }
else if (globalToolBar.stack) {
141 return Kirigami.ApplicationHeaderStyle.ToolBar;
143 return Kirigami.ApplicationHeaderStyle.None;
158 signal backRequested(var event);
160 background: Rectangle {
161 color: Kirigami.Theme.backgroundColor
165 clip: root.header !== null;
167 Component.onCompleted: {
169 parentChanged(root.parent);
170 globalToolBar.syncSource();
171 bottomToolBar.pageComplete =
true
178 globalToolBar.stack = null;
179 globalToolBar.row = null;
181 if (root.Kirigami.ColumnView.view) {
182 globalToolBar.row = root.Kirigami.ColumnView.view.__pageRow;
184 if (root.T.StackView.view) {
185 globalToolBar.stack = root.T.StackView.view;
186 globalToolBar.row = root.T.StackView.view.parent instanceof Kirigami.PageRow ? root.T.StackView.view.parent : null;
188 if (globalToolBar.row) {
189 root.globalToolBarStyleChanged.connect(globalToolBar.syncSource);
190 globalToolBar.syncSource();
203 topMargin: globalToolBar.height
208 Kirigami.ColumnView.globalHeader: Loader {
211 height: item ? item.implicitHeight : 0
214 property Kirigami.PageRow row
215 property T.StackView stack
222 active: (root.titleDelegate !== defaultTitleDelegate || root.globalToolBarStyle === Kirigami.ApplicationHeaderStyle.ToolBar || root.globalToolBarStyle === Kirigami.ApplicationHeaderStyle.Titles)
229 function syncSource() {
230 if (root.globalToolBarStyle !== Kirigami.ApplicationHeaderStyle.ToolBar &&
231 root.globalToolBarStyle !== Kirigami.ApplicationHeaderStyle.Titles &&
232 root.titleDelegate !== defaultTitleDelegate) {
233 sourceComponent = root.titleDelegate;
235 const url = root.globalToolBarStyle === Kirigami.ApplicationHeaderStyle.ToolBar
236 ?
"private/globaltoolbar/ToolBarPageHeader.qml"
237 :
"private/globaltoolbar/TitlesPageHeader.qml";
239 setSource(
Qt.resolvedUrl(url), {
240 pageRow: Qt.binding(() => row),
242 current: Qt.binding(() => {
243 if (!row && !stack) {
248 return row.currentIndex === root.Kirigami.ColumnView.level;
256 Kirigami.ColumnView.globalFooter: Loader {
259 property T.Page page: root
260 property bool pageComplete:
false
272 if ((globalToolBar.row && globalToolBar.row.globalToolBar.actualStyle === Kirigami.ApplicationHeaderStyle.ToolBar)
273 || root.globalToolBarStyle === Kirigami.ApplicationHeaderStyle.ToolBar
274 || root.globalToolBarStyle === Kirigami.ApplicationHeaderStyle.None) {
278 if (root.actions.length === 0) {
283 if (typeof applicationWindow ===
"undefined") {
287 const drawer = applicationWindow() ? applicationWindow()[
'contextDrawer'] : undefined;
288 if (
Boolean(drawer) && drawer.enabled && drawer.handleVisible) {
295 source:
Qt.resolvedUrl(
"./private/globaltoolbar/ToolBarPageFooter.qml")
298 Layout.fillWidth:
true