Warning, /plasma/qqc2-breeze-style/style/qtquickcontrols/Drawer.qml is written in an unsupported language. File is not indexed.

0001 /* SPDX-FileCopyrightText: 2017 The Qt Company Ltd.
0002  * SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0003  * SPDX-FileCopyrightText: 2021 Noah Davis <noahadvs@gmail.com>
0004  * SPDX-License-Identifier: LicenseRef-KDE-Accepted-LGPL
0005  */
0006 
0007 
0008 import QtQuick
0009 import QtQuick.Controls
0010 import QtQuick.Templates as T
0011 import org.kde.kirigami as Kirigami
0012 import org.kde.breeze.impl as Impl
0013 
0014 T.Drawer {
0015     id: control
0016 
0017     parent: T.Overlay.overlay
0018 
0019     implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
0020                             contentWidth + leftPadding + rightPadding)
0021     implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
0022                              contentHeight + topPadding + bottomPadding)
0023 
0024     topPadding: control.edge === Qt.BottomEdge ? 1 : 0
0025     leftPadding: control.edge === Qt.RightEdge ? 1 : 0
0026     rightPadding: control.edge === Qt.LeftEdge ? 1 : 0
0027     bottomPadding: control.edge === Qt.TopEdge ? 1 : 0
0028 
0029     background: Kirigami.ShadowedRectangle {
0030         color: Kirigami.Theme.backgroundColor
0031         shadow {
0032             color: Qt.rgba(0,0,0,0.2)
0033             size: 15
0034         }
0035         Kirigami.Separator {
0036             readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge
0037             width: horizontal ? Impl.Units.smallBorder : parent.width
0038             height: horizontal ? parent.height : Impl.Units.smallBorder
0039             x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0
0040             y: control.edge === Qt.TopEdge ? parent.height - 1 : 0
0041             visible: !control.dim
0042         }
0043     }
0044 
0045     enter: Transition {
0046         SmoothedAnimation {
0047             velocity: 5
0048         }
0049     }
0050     exit: Transition {
0051         SmoothedAnimation {
0052             velocity: 5
0053         }
0054     }
0055 
0056     T.Overlay.modal: Impl.OverlayModalBackground {}
0057     T.Overlay.modeless: Impl.OverlayDimBackground {}
0058 }