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
249 value: -contentItem.x
255 onGlobalDrawerChanged: {
257 globalDrawer.parent =
Qt.binding(() => T.Overlay.overlay);
260 onContextDrawerChanged: {
262 contextDrawer.parent =
Qt.binding(() => T.Overlay.overlay);
265 onPageStackChanged: {
268 pageStack.parent = contentItem;
272 width: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 30 : Kirigami.Units.gridUnit * 55
273 height: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 45 : Kirigami.Units.gridUnit * 40
276 Component.onCompleted: {
282 root.width = root.width;
283 root.height = root.height;
289 sequence: root.quitAction.shortcut
290 enabled: root.quitAction.enabled
291 context:
Qt.ApplicationShortcut
292 onActivated: root.close();