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: root.modal && (!parent.parent.handleAnchor || !parent.parent.handleAnchor.visible || root.handle.pressed || root.position > 0)
64 opacity: (parent.parent.handleAnchor && parent.parent.handleAnchor.visible) ? root.position : 1
67 shadow.color:
Qt.rgba(0, 0, 0, root.handle.pressed ? 0.6 : 0.4)
69 shadow.size: Kirigami.Units.gridUnit / 2
71 width: Kirigami.Units.iconSizes.smallMedium + Kirigami.Units.smallSpacing * 2
73 radius: Kirigami.Units.cornerRadius
76 duration: Kirigami.Units.longDuration
77 easing.type: Easing.InOutQuad
82 anchors.centerIn: handleGraphics
84 height: Kirigami.Units.iconSizes.smallMedium
86 Kirigami.Theme.colorSet: handleGraphics.Kirigami.Theme.colorSet
87 Kirigami.Theme.backgroundColor: handleGraphics.Kirigami.Theme.backgroundColor
88 Kirigami.Theme.textColor: handleGraphics.Kirigami.Theme.textColor
94 if (
Qt.application.layoutDirection ===
Qt.RightToLeft) {
95 if (edge ===
Qt.LeftEdge) {
102 if ((root.handleClosedIcon.source || root.handleClosedIcon.name)
103 && (root.handleOpenIcon.source || root.handleOpenIcon.name)) {
104 return Qt.resolvedUrl(
"templates/private/GenericDrawerIcon.qml");
105 }
else if (edge ===
Qt.LeftEdge) {
106 return Qt.resolvedUrl(
"templates/private/MenuIcon.qml");
107 }
else if (edge ===
Qt.RightEdge && root instanceof Kirigami.ContextDrawer) {
108 return Qt.resolvedUrl(
"templates/private/ContextIcon.qml");
116 item.color =
Qt.binding(() => root.handle.pressed
117 ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor);
126 LayoutMirroring.enabled:
false
129 top: root.edge ===
Qt.TopEdge ? parent.bottom : (root.edge ===
Qt.BottomEdge ? undefined : parent.top)
130 left: root.edge ===
Qt.LeftEdge ? parent.right : (root.edge ===
Qt.RightEdge ? undefined : parent.left)
131 right: root.edge ===
Qt.RightEdge ? parent.left : (root.edge ===
Qt.LeftEdge ? undefined : parent.right)
132 bottom: root.edge ===
Qt.BottomEdge ? parent.top : (root.edge ===
Qt.TopEdge ? undefined : parent.bottom)
133 topMargin: segmentedSeparator.height
138 Kirigami.Theme.inherit:
false
139 Kirigami.Theme.colorSet: Kirigami.Theme.Header
143 id: segmentedSeparator
146 readonly
property bool shouldUseSegmentedStyle: {
147 if (root.edge !==
Qt.LeftEdge && root.edge !==
Qt.RightEdge) {
150 if (root.collapsed) {
154 const header = root.header ?? null;
155 if (header instanceof T.ToolBar || header instanceof KT.AbstractApplicationHeader) {
159 if (root.contentItem instanceof ColumnLayout && root.contentItem.children[0] instanceof T.ToolBar) {
168 right: separator.right
172 if (root.edge !==
Qt.LeftEdge && root.edge !==
Qt.RightEdge) {
175 if (typeof applicationWindow ===
"undefined") {
178 const window = applicationWindow();
179 const globalToolBar = window.pageStack?.globalToolBar;
180 if (!globalToolBar) {
184 return globalToolBar.preferredHeight;
187 visible: separator.visible
190 LayoutMirroring.enabled:
false
194 topMargin: segmentedSeparator.shouldUseSegmentedStyle ? Kirigami.Units.largeSpacing : 0
195 bottomMargin: segmentedSeparator.shouldUseSegmentedStyle ? Kirigami.Units.largeSpacing : 0
198 Behavior on anchors.topMargin {
200 duration: Kirigami.Units.longDuration
201 easing.type: Easing.InOutQuad
205 Behavior on anchors.bottomMargin {
207 duration: Kirigami.Units.longDuration
208 easing.type: Easing.InOutQuad
212 Kirigami.Theme.inherit:
false
213 Kirigami.Theme.colorSet: Kirigami.Theme.Header
222 right: root.edge ===
Qt.RightEdge ? parent.left : (root.edge ===
Qt.LeftEdge ? undefined : parent.right)
223 left: root.edge ===
Qt.LeftEdge ? parent.right : (root.edge ===
Qt.RightEdge ? undefined : parent.left)
224 top: root.edge ===
Qt.TopEdge ? parent.bottom : (root.edge ===
Qt.BottomEdge ? undefined : parent.top)
225 bottom: root.edge ===
Qt.BottomEdge ? parent.top : (root.edge ===
Qt.TopEdge ? undefined : parent.bottom)
228 opacity: root.position === 0 ? 0 : 1
230 Behavior on opacity {
232 duration: Kirigami.Units.longDuration
233 easing.type: Easing.InOutQuad