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
73 QQC2.ApplicationWindow {
83 property Item pageStack
92 property bool controlsVisible:
true
112 property bool wideScreen: width >= Kirigami.Units.gridUnit * 60
178 property bool reachableMode:
false
183 property bool reachableModeEnabled:
true
198 readonly
property Action quitAction: _quitAction
213 function showPassiveNotification(
message, timeout, actionText, callBack) {
214 notificationsObject.showNotification(
message, timeout, actionText, callBack);
221 function hidePassiveNotification(index = 0) {
222 notificationsObject.hideNotification(index);
230 function applicationWindow() {
235 LayoutMirroring.enabled:
Qt.application.layoutDirection ===
Qt.RightToLeft
236 LayoutMirroring.childrenInherit:
true
238 color: Kirigami.Theme.backgroundColor
240 TP.PassiveNotificationsManager {
241 id: notificationsObject
242 anchors.bottom: parent.bottom
243 anchors.horizontalCenter: parent.horizontalCenter
248 parent: contentItem.parent
251 onClicked: mouse => {
252 root.reachableMode =
false;
254 visible: root.reachableMode && root.reachableModeEnabled
257 color:
Qt.rgba(0, 0, 0, 0.3)
260 anchors.horizontalCenter: parent.horizontalCenter
262 width: Kirigami.Units.iconSizes.large
270 contentItem.anchors.left: contentItem.parent.left
271 contentItem.anchors.right: contentItem.parent.right
272 contentItem.anchors.topMargin: root.wideScreen && header && controlsVisible ? header.height : 0
273 contentItem.anchors.leftMargin: root.globalDrawer && root.globalDrawer.modal ===
false && (!root.pageStack || root.pageStack.leftSidebar !== root.globalDrawer) ? root.globalDrawer.width * root.globalDrawer.position : 0
274 contentItem.anchors.rightMargin: root.contextDrawer && root.contextDrawer.modal ===
false ? root.contextDrawer.width * root.contextDrawer.position : 0
277 when: menuBar !== undefined
280 value: -contentItem.x
281 restoreMode: Binding.RestoreBinding
284 when: header !== undefined
287 value: -contentItem.x
288 restoreMode: Binding.RestoreBinding
291 when: footer !== undefined
294 value: -contentItem.x
295 restoreMode: Binding.RestoreBinding
298 contentItem.transform: Translate {
301 duration: Kirigami.Units.longDuration
302 easing.type: Easing.InOutQuad
305 y: root.reachableMode && root.reachableModeEnabled && !root.wideScreen ? root.height/2 : 0
306 x: root.globalDrawer && root.globalDrawer.modal ===
true && root.globalDrawer.toString().indexOf(
"SplitDrawer") === 0 ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0
310 if (width > height) {
311 root.reachableMode =
false;
315 when: globalDrawer !== undefined && root.visible
319 restoreMode: Binding.RestoreBinding
322 when: contextDrawer !== undefined && root.visible
323 target: contextDrawer
326 restoreMode: Binding.RestoreBinding
328 onPageStackChanged: pageStack.parent = contentItem;
330 width: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 30 : Kirigami.Units.gridUnit * 55
331 height: Kirigami.Settings.isMobile ? Kirigami.Units.gridUnit * 45 : Kirigami.Units.gridUnit * 40
340 root.width = root.width;
341 root.height = root.height;
347 icon.name: "application-exit";
348 shortcut: StandardKey.Quit
349 onTriggered: source => root.close()
352 sequence: _quitAction.shortcut
353 context:
Qt.ApplicationShortcut
354 onActivated: root.close()