Changeset View
Changeset View
Standalone View
Standalone View
org.kde.desktop/Drawer.qml
Show All 17 Lines | |||||
18 | * ensure the GNU General Public License version 2.0 requirements will be | 18 | * ensure the GNU General Public License version 2.0 requirements will be | ||
19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | 19 | * met: http://www.gnu.org/licenses/gpl-2.0.html. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | 22 | | |||
23 | import QtQuick 2.6 | 23 | import QtQuick 2.6 | ||
24 | import QtQuick.Controls 2.0 | 24 | import QtQuick.Controls 2.0 | ||
25 | import QtQuick.Templates 2.0 as T | 25 | import QtQuick.Templates 2.0 as T | ||
26 | import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate | 26 | import org.kde.kirigami 2.2 as Kirigami | ||
27 | 27 | | |||
28 | T.Drawer { | 28 | T.Drawer { | ||
29 | id: control | 29 | id: control | ||
30 | 30 | | |||
31 | parent: T.ApplicationWindow.overlay | 31 | parent: T.ApplicationWindow.overlay | ||
32 | 32 | | |||
33 | implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) | 33 | implicitWidth: Math.max(background ? background.implicitWidth : 0, contentWidth + leftPadding + rightPadding) | ||
34 | implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) | 34 | implicitHeight: Math.max(background ? background.implicitHeight : 0, contentHeight + topPadding + bottomPadding) | ||
35 | 35 | | |||
36 | contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) | 36 | contentWidth: contentItem.implicitWidth || (contentChildren.length === 1 ? contentChildren[0].implicitWidth : 0) | ||
37 | contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) | 37 | contentHeight: contentItem.implicitHeight || (contentChildren.length === 1 ? contentChildren[0].implicitHeight : 0) | ||
38 | 38 | | |||
39 | topPadding: control.edge === Qt.BottomEdge ? 1 : 0 | 39 | topPadding: control.edge === Qt.BottomEdge ? 1 : 0 | ||
40 | leftPadding: control.edge === Qt.RightEdge ? 1 : 0 | 40 | leftPadding: control.edge === Qt.RightEdge ? 1 : 0 | ||
41 | rightPadding: control.edge === Qt.LeftEdge ? 1 : 0 | 41 | rightPadding: control.edge === Qt.LeftEdge ? 1 : 0 | ||
42 | bottomPadding: control.edge === Qt.TopEdge ? 1 : 0 | 42 | bottomPadding: control.edge === Qt.TopEdge ? 1 : 0 | ||
43 | 43 | | |||
44 | background: Rectangle { | 44 | background: Rectangle { | ||
45 | color: StylePrivate.SystemPaletteSingleton.window(control.enabled) | 45 | color: Kirigami.Theme.backgroundColor | ||
46 | Rectangle { | 46 | Rectangle { | ||
47 | readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge | 47 | readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge | ||
48 | anchors { | 48 | anchors { | ||
49 | left: control.edge !== Qt.LeftEdge ? parent.left : undefined | 49 | left: control.edge !== Qt.LeftEdge ? parent.left : undefined | ||
50 | right: control.edge !== Qt.RightEdge ? parent.right : undefined | 50 | right: control.edge !== Qt.RightEdge ? parent.right : undefined | ||
51 | top: control.edge !== Qt.TopEdge ? parent.top : undefined | 51 | top: control.edge !== Qt.TopEdge ? parent.top : undefined | ||
52 | bottom: control.edge !== Qt.BottomEdge ? parent.bottom : undefined | 52 | bottom: control.edge !== Qt.BottomEdge ? parent.bottom : undefined | ||
53 | } | 53 | } | ||
54 | color: StylePrivate.SystemPaletteSingleton.text(control.enabled) | 54 | color: Kirigami.Theme.textColor | ||
55 | opacity: 0.3 | 55 | opacity: 0.3 | ||
56 | width: 1 | 56 | width: 1 | ||
57 | height: 1 | 57 | height: 1 | ||
58 | } | 58 | } | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | enter: Transition { | 61 | enter: Transition { | ||
62 | SmoothedAnimation { | 62 | SmoothedAnimation { | ||
Show All 9 Lines |