Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/HiddenItemsView.qml
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2016 Marco Martin <mart@kde.org> | 2 | * Copyright 2016 Marco Martin <mart@kde.org> | ||
3 | * Copyright 2019 ivan tkachenko <ratijastk@kde.org> | ||||
3 | * | 4 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU Library General Public License as | 6 | * it under the terms of the GNU Library General Public License as | ||
6 | * published by the Free Software Foundation; either version 2, or | 7 | * published by the Free Software Foundation; either version 2, or | ||
7 | * (at your option) any later version. | 8 | * (at your option) any later version. | ||
8 | * | 9 | * | ||
9 | * This program is distributed in the hope that it will be useful, | 10 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 11 Lines | |||||
22 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 25 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
25 | 26 | | |||
26 | 27 | | |||
27 | PlasmaExtras.ScrollArea { | 28 | PlasmaExtras.ScrollArea { | ||
28 | id: hiddenTasksView | 29 | id: hiddenTasksView | ||
29 | 30 | | |||
30 | visible: !activeApplet || activeApplet.parent.parent == hiddenTasksColumn | 31 | visible: !root.activeApplet || root.activeAppletContainer === hiddenTasksColumn | ||
31 | width: activeApplet ? iconColumnWidth : parent.width | 32 | width: root.activeApplet ? iconColumnWidth : parent.width | ||
32 | property alias layout: hiddenTasksColumn | 33 | property alias layout: hiddenTasksColumn | ||
33 | //Useful to align stuff to the column of icons, both in expanded and shrink modes | 34 | //Useful to align stuff to the column of icons, both in expanded and shrink modes | ||
34 | property int iconColumnWidth: root.hiddenItemSize + highlight.marginHints.left + highlight.marginHints.right | 35 | property int iconColumnWidth: root.hiddenItemSize + highlight.marginHints.left + highlight.marginHints.right | ||
35 | horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff | 36 | horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff | ||
36 | verticalScrollBarPolicy: activeApplet ? Qt.ScrollBarAlwaysOff : Qt.ScrollBarAsNeeded | 37 | verticalScrollBarPolicy: root.activeApplet ? Qt.ScrollBarAlwaysOff : Qt.ScrollBarAsNeeded | ||
37 | 38 | | |||
38 | Flickable { | 39 | Flickable { | ||
40 | anchors.fill: parent | ||||
39 | contentWidth: width | 41 | contentWidth: width | ||
40 | contentHeight: hiddenTasksColumn.height | 42 | contentHeight: hiddenTasksColumn.height | ||
41 | 43 | | |||
42 | MouseArea { | 44 | MouseArea { | ||
43 | width: parent.width | 45 | width: hiddenTasksView.width | ||
44 | height: hiddenTasksColumn.height | 46 | height: hiddenTasksColumn.height | ||
45 | drag.filterChildren: true | 47 | drag.filterChildren: true | ||
46 | hoverEnabled: true | 48 | hoverEnabled: true | ||
47 | onExited: hiddenTasksColumn.hoveredItem = null; | 49 | onExited: hiddenTasksColumn.hoveredItem = null; | ||
48 | 50 | | |||
49 | CurrentItemHighLight { | 51 | CurrentItemHighLight { | ||
50 | target: root.activeApplet && root.activeApplet.parent.parent == hiddenTasksColumn ? root.activeApplet.parent : null | 52 | target: root.activeAppletContainer === hiddenTasksColumn ? root.activeAppletItem : null | ||
51 | location: PlasmaCore.Types.LeftEdge | 53 | location: PlasmaCore.Types.LeftEdge | ||
52 | } | 54 | } | ||
53 | PlasmaComponents.Highlight { | 55 | PlasmaComponents.Highlight { | ||
54 | id: highlight | 56 | id: highlight | ||
55 | visible: hiddenTasksColumn.hoveredItem != null && !root.activeApplet | 57 | visible: hiddenTasksColumn.hoveredItem != null && !root.activeApplet | ||
56 | y: hiddenTasksColumn.hoveredItem ? hiddenTasksColumn.hoveredItem.y : 0 | 58 | y: hiddenTasksColumn.hoveredItem ? hiddenTasksColumn.hoveredItem.y : 0 | ||
57 | width: hiddenTasksColumn.hoveredItem ? hiddenTasksColumn.hoveredItem.width : 0 | 59 | width: hiddenTasksColumn.hoveredItem ? hiddenTasksColumn.hoveredItem.width : 0 | ||
58 | height: hiddenTasksColumn.hoveredItem ? hiddenTasksColumn.hoveredItem.height : 0 | 60 | height: hiddenTasksColumn.hoveredItem ? hiddenTasksColumn.hoveredItem.height : 0 | ||
59 | } | 61 | } | ||
60 | 62 | | |||
61 | Column { | 63 | ColumnLayout { | ||
62 | id: hiddenTasksColumn | 64 | id: hiddenTasksColumn | ||
63 | 65 | | |||
64 | spacing: units.smallSpacing | 66 | spacing: units.smallSpacing | ||
65 | width: parent.width | 67 | width: hiddenTasksView.width | ||
66 | property Item hoveredItem | 68 | property Item hoveredItem | ||
67 | property alias marginHints: highlight.marginHints | 69 | property alias marginHints: highlight.marginHints | ||
68 | 70 | | |||
69 | objectName: "hiddenTasksColumn" | 71 | objectName: "hiddenTasksColumn" | ||
70 | } | 72 | } | ||
71 | } | 73 | } | ||
72 | } | 74 | } | ||
73 | } | 75 | } |