8import QtQuick.Controls as QQC2
9import QtQuick.Templates as T
10import org.kde.kirigami as Kirigami
11import "templates/private" as TP
72QQC2.ApplicationWindow {
82 property Item pageStack
91 property bool controlsVisible:
true
102 property OverlayDrawer globalDrawer
111 property bool wideScreen: width >= Kirigami.Units.gridUnit * 60
154 property OverlayDrawer contextDrawer
159 readonly
property Item overlay: T.Overlay.overlay
175 readonly
property Kirigami.Action quitAction: Kirigami.Action {
177 icon.name:
"application-exit";
178 shortcut: StandardKey.Quit
179 onTriggered: source => root.close();
195 function showPassiveNotification(message, timeout, actionText, callBack) {
196 notificationsObject.showNotification(message, timeout, actionText, callBack);
203 function hidePassiveNotification(index = 0) {
204 notificationsObject.hideNotification(index);
212 function applicationWindow() {
217 LayoutMirroring.enabled:
Qt.application.layoutDirection ===
Qt.RightToLeft
218 LayoutMirroring.childrenInherit:
true
220 color: Kirigami.Theme.backgroundColor
222 TP.PassiveNotificationsManager {
223 id: notificationsObject
224 anchors.bottom: parent.bottom
225 anchors.horizontalCenter: parent.horizontalCenter
230 contentItem.anchors.left: contentItem.parent.left
231 contentItem.anchors.right: contentItem.parent.right
232 contentItem.anchors.topMargin: root.wideScreen && header && controlsVisible ? header.height : 0
233 contentItem.anchors.leftMargin: root.globalDrawer && root.globalDrawer.modal ===
false && (!root.pageStack || root.pageStack.leftSidebar !== root.globalDrawer) ? root.globalDrawer.width * root.globalDrawer.position : 0
234 contentItem.anchors.rightMargin: root.contextDrawer && root.contextDrawer.modal === false ? root.contextDrawer.width * root.contextDrawer.position : 0
239 value: -contentItem.x
244 value: -contentItem.x
250 onGlobalDrawerChanged: {
252 globalDrawer.parent =
Qt.binding(() => T.Overlay.overlay);
255 onContextDrawerChanged: {
257 contextDrawer.parent =
Qt.binding(() => T.Overlay.overlay);
260 onPageStackChanged: {
263 pageStack.parent = contentItem;
267 width: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 30 : Kirigami.Units.gridUnit * 55
268 height: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 45 : Kirigami.Units.gridUnit * 40
271 Component.onCompleted: {
277 root.width = root.width;
278 root.height = root.height;
284 sequence: root.quitAction.shortcut
285 enabled: root.quitAction.enabled
286 context:
Qt.ApplicationShortcut
287 onActivated: root.close();