9 import QtQuick.Controls 2.0 as QQC2
10 import QtQuick.Window 2.5
11 import org.kde.kirigami 2.4 as Kirigami
12 import "templates/private" as TP
77 QQC2.ApplicationWindow {
87 property Item pageStack
98 property bool controlsVisible:
true
118 property bool wideScreen: width >= Kirigami.Units.gridUnit * 60
187 property bool reachableMode:
false
192 property bool reachableModeEnabled:
true
200 readonly
property Kirigami.Action quitAction: Kirigami.Action {
202 icon.name:
"application-exit";
203 shortcut: StandardKey.Quit
204 onTriggered: source => root.close();
220 function showPassiveNotification(
message, timeout, actionText, callBack) {
221 notificationsObject.showNotification(
message, timeout, actionText, callBack);
231 function hidePassiveNotification(index = 0) {
232 notificationsObject.hideNotification(index);
250 function applicationWindow() {
255 LayoutMirroring.enabled:
Qt.application.layoutDirection ===
Qt.RightToLeft
256 LayoutMirroring.childrenInherit:
true
258 color: Kirigami.Theme.backgroundColor
260 TP.PassiveNotificationsManager {
261 id: notificationsObject
262 anchors.bottom: parent.bottom
263 anchors.horizontalCenter: parent.horizontalCenter
268 parent: contentItem.parent
271 onClicked: mouse => {
272 root.reachableMode =
false;
274 visible: root.reachableMode && root.reachableModeEnabled
277 color:
Qt.rgba(0, 0, 0, 0.3)
280 anchors.horizontalCenter: parent.horizontalCenter
282 width: Kirigami.Units.iconSizes.large
290 contentItem.anchors.left: contentItem.parent.left
291 contentItem.anchors.right: contentItem.parent.right
292 contentItem.anchors.topMargin: root.wideScreen && header && controlsVisible ? header.height : 0
293 contentItem.anchors.leftMargin: root.globalDrawer && root.globalDrawer.modal ===
false && (!root.pageStack || root.pageStack.leftSidebar !== root.globalDrawer) ? root.globalDrawer.width * root.globalDrawer.position : 0
294 contentItem.anchors.rightMargin: root.contextDrawer && root.contextDrawer.modal ===
false ? root.contextDrawer.width * root.contextDrawer.position : 0
297 when: menuBar !== undefined
300 value: -contentItem.x
301 restoreMode: Binding.RestoreBinding
304 when: header !== undefined
307 value: -contentItem.x
308 restoreMode: Binding.RestoreBinding
311 when: footer !== undefined
314 value: -contentItem.x
315 restoreMode: Binding.RestoreBinding
318 contentItem.transform: Translate {
321 duration: Kirigami.Units.longDuration
322 easing.type: Easing.InOutQuad
325 y: root.reachableMode && root.reachableModeEnabled && !root.wideScreen ? root.height/2 : 0
326 x: root.globalDrawer && root.globalDrawer.modal ===
true && root.globalDrawer.toString().indexOf(
"SplitDrawer") === 0 ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0
330 if (width > height) {
331 root.reachableMode =
false;
335 when: globalDrawer !== undefined && root.visible
339 restoreMode: Binding.RestoreBinding
342 when: contextDrawer !== undefined && root.visible
343 target: contextDrawer
346 restoreMode: Binding.RestoreBinding
348 onPageStackChanged: pageStack.parent = contentItem;
350 width: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 30 : Kirigami.Units.gridUnit * 55
351 height: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 45 : Kirigami.Units.gridUnit * 40
360 root.width = root.width;
361 root.height = root.height;
367 sequence: root.quitAction.shortcut
368 context:
Qt.ApplicationShortcut
369 onActivated: root.close();