9import QtQuick.Templates as T
10import org.kde.kirigami as Kirigami
12import "templates" as KT
30 closePolicy: modal ? T.Popup.CloseOnEscape | T.Popup.CloseOnReleaseOutside : T.Popup.NoAutoClose
31 handleVisible: interactive && (modal || !drawerOpen) && (typeof(applicationWindow)===typeof(Function) && applicationWindow() ? applicationWindow().controlsVisible :
true)
38 if (!modal && !root.peeking && !root.animating) {
43 background: Rectangle {
44 color: Kirigami.Theme.backgroundColor
50 Kirigami.ShadowedRectangle {
52 anchors.centerIn: parent
54 Kirigami.Theme.colorSet: parent.parent.handleAnchor && parent.parent.handleAnchor.visible ? parent.parent.handleAnchor.Kirigami.Theme.colorSet : Kirigami.Theme.Button
56 Kirigami.Theme.backgroundColor: parent.parent.handleAnchor && parent.parent.handleAnchor.visible ? parent.parent.handleAnchor.Kirigami.Theme.backgroundColor : undefined
58 Kirigami.Theme.textColor: parent.parent.handleAnchor && parent.parent.handleAnchor.visible ? parent.parent.handleAnchor.Kirigami.Theme.textColor : undefined
60 Kirigami.Theme.inherit:
false
61 color: root.handle.pressed ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
63 visible: !parent.parent.handleAnchor || !parent.parent.handleAnchor.visible || root.handle.pressed || (root.modal && root.position > 0)
65 shadow.color:
Qt.rgba(0, 0, 0, root.handle.pressed ? 0.6 : 0.4)
67 shadow.size: Kirigami.Units.gridUnit / 2
69 width: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2
71 radius: Kirigami.Units.cornerRadius
74 duration: Kirigami.Units.longDuration
75 easing.type: Easing.InOutQuad
80 anchors.centerIn: handleGraphics
82 height: Kirigami.Units.iconSizes.smallMedium
84 Kirigami.Theme.colorSet: handleGraphics.Kirigami.Theme.colorSet
85 Kirigami.Theme.backgroundColor: handleGraphics.Kirigami.Theme.backgroundColor
86 Kirigami.Theme.textColor: handleGraphics.Kirigami.Theme.textColor
92 if (
Qt.application.layoutDirection ===
Qt.RightToLeft) {
93 if (edge ===
Qt.LeftEdge) {
100 if ((root.handleClosedIcon.source || root.handleClosedIcon.name)
101 && (root.handleOpenIcon.source || root.handleOpenIcon.name)) {
102 return Qt.resolvedUrl(
"templates/private/GenericDrawerIcon.qml");
103 }
else if (edge ===
Qt.LeftEdge) {
104 return Qt.resolvedUrl(
"templates/private/MenuIcon.qml");
105 }
else if (edge ===
Qt.RightEdge && root instanceof Kirigami.ContextDrawer) {
106 return Qt.resolvedUrl(
"templates/private/ContextIcon.qml");
114 item.color =
Qt.binding(() => root.handle.pressed
115 ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor);
124 LayoutMirroring.enabled:
false
127 top: root.edge ===
Qt.TopEdge ? parent.bottom : (root.edge ===
Qt.BottomEdge ? undefined : parent.top)
128 left: root.edge ===
Qt.LeftEdge ? parent.right : (root.edge ===
Qt.RightEdge ? undefined : parent.left)
129 right: root.edge ===
Qt.RightEdge ? parent.left : (root.edge ===
Qt.LeftEdge ? undefined : parent.right)
130 bottom: root.edge ===
Qt.BottomEdge ? parent.top : (root.edge ===
Qt.TopEdge ? undefined : parent.bottom)
131 topMargin: segmentedSeparator.height
136 Kirigami.Theme.inherit:
false
137 Kirigami.Theme.colorSet: Kirigami.Theme.Header
141 id: segmentedSeparator
144 readonly
property bool shouldUseSegmentedStyle: {
145 if (root.edge !==
Qt.LeftEdge && root.edge !==
Qt.RightEdge) {
148 if (root.collapsed) {
152 const header = root.header ?? null;
153 if (header instanceof T.ToolBar || header instanceof KT.AbstractApplicationHeader) {
157 if (root.contentItem instanceof ColumnLayout && root.contentItem.children[0] instanceof T.ToolBar) {
166 right: separator.right
170 if (root.edge !==
Qt.LeftEdge && root.edge !==
Qt.RightEdge) {
173 if (typeof applicationWindow ===
"undefined") {
176 const window = applicationWindow();
177 const globalToolBar = window.pageStack?.globalToolBar;
178 if (!globalToolBar) {
182 return globalToolBar.preferredHeight;
185 visible: separator.visible
188 LayoutMirroring.enabled:
false
192 topMargin: segmentedSeparator.shouldUseSegmentedStyle ? Kirigami.Units.largeSpacing : 0
193 bottomMargin: segmentedSeparator.shouldUseSegmentedStyle ? Kirigami.Units.largeSpacing : 0
196 Behavior on anchors.topMargin {
198 duration: Kirigami.Units.longDuration
199 easing.type: Easing.InOutQuad
203 Behavior on anchors.bottomMargin {
205 duration: Kirigami.Units.longDuration
206 easing.type: Easing.InOutQuad
210 Kirigami.Theme.inherit:
false
211 Kirigami.Theme.colorSet: Kirigami.Theme.Header
220 right: root.edge ===
Qt.RightEdge ? parent.left : (root.edge ===
Qt.LeftEdge ? undefined : parent.right)
221 left: root.edge ===
Qt.LeftEdge ? parent.right : (root.edge ===
Qt.RightEdge ? undefined : parent.left)
222 top: root.edge ===
Qt.TopEdge ? parent.bottom : (root.edge ===
Qt.BottomEdge ? undefined : parent.top)
223 bottom: root.edge ===
Qt.BottomEdge ? parent.top : (root.edge ===
Qt.TopEdge ? undefined : parent.bottom)
226 opacity: root.position === 0 ? 0 : 1
228 Behavior on opacity {
230 duration: Kirigami.Units.longDuration
231 easing.type: Easing.InOutQuad