Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/main.qml
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 28 | MouseArea { | |||
---|---|---|---|---|---|
48 | property alias visibleLayout: tasksRow | 48 | property alias visibleLayout: tasksRow | ||
49 | property alias hiddenLayout: expandedRepresentation.hiddenLayout | 49 | property alias hiddenLayout: expandedRepresentation.hiddenLayout | ||
50 | 50 | | |||
51 | property alias statusNotifierModel: statusNotifierModel | 51 | property alias statusNotifierModel: statusNotifierModel | ||
52 | 52 | | |||
53 | property Component plasmoidItemComponent | 53 | property Component plasmoidItemComponent | ||
54 | 54 | | |||
55 | function updateItemVisibility(item) { | 55 | function updateItemVisibility(item) { | ||
56 | 56 | switch (item.effectiveStatus) { | |||
57 | //Invisible | 57 | case PlasmaCore.Types.HiddenStatus: | ||
58 | if (!item.categoryShown) { | | |||
59 | if (item.parent == invisibleEntriesContainer) { | 58 | if (item.parent == invisibleEntriesContainer) { | ||
60 | return; | 59 | return; | ||
61 | } | 60 | } | ||
62 | 61 | | |||
63 | item.parent = invisibleEntriesContainer; | 62 | item.parent = invisibleEntriesContainer; | ||
63 | break; | ||||
64 | 64 | | |||
65 | //visible | 65 | case PlasmaCore.Types.ActiveStatus: | ||
66 | } else if (item.forcedShown || !(item.forcedHidden || item.status == PlasmaCore.Types.PassiveStatus)) { | | |||
67 | | ||||
68 | if (visibleLayout.children.length == 0) { | 66 | if (visibleLayout.children.length == 0) { | ||
69 | item.parent = visibleLayout; | 67 | item.parent = visibleLayout; | ||
70 | //notifications is always the first | 68 | //notifications is always the first | ||
71 | } else if (visibleLayout.children[0].itemId == "org.kde.plasma.notifications" && | 69 | } else if (visibleLayout.children[0].itemId == "org.kde.plasma.notifications" && | ||
72 | item.itemId != "org.kde.plasma.notifications") { | 70 | item.itemId != "org.kde.plasma.notifications") { | ||
73 | plasmoid.nativeInterface.reorderItemAfter(item, visibleLayout.children[0]); | 71 | plasmoid.nativeInterface.reorderItemAfter(item, visibleLayout.children[0]); | ||
74 | } else if (visibleLayout.children[0] != item) { | 72 | } else if (visibleLayout.children[0] != item) { | ||
75 | plasmoid.nativeInterface.reorderItemBefore(item, visibleLayout.children[0]); | 73 | plasmoid.nativeInterface.reorderItemBefore(item, visibleLayout.children[0]); | ||
76 | } | 74 | } | ||
75 | break; | ||||
77 | 76 | | |||
78 | //hidden | 77 | case PlasmaCore.Types.PassiveStatus: | ||
79 | } else { | | |||
80 | 78 | | |||
81 | if (hiddenLayout.children.length == 0) { | 79 | if (hiddenLayout.children.length == 0) { | ||
82 | item.parent = hiddenLayout; | 80 | item.parent = hiddenLayout; | ||
83 | //notifications is always the first | 81 | //notifications is always the first | ||
84 | } else if (hiddenLayout.children[0].itemId == "org.kde.plasma.notifications" && | 82 | } else if (hiddenLayout.children[0].itemId == "org.kde.plasma.notifications" && | ||
85 | item.itemId != "org.kde.plasma.notifications") { | 83 | item.itemId != "org.kde.plasma.notifications") { | ||
86 | plasmoid.nativeInterface.reorderItemAfter(item, hiddenLayout.children[0]); | 84 | plasmoid.nativeInterface.reorderItemAfter(item, hiddenLayout.children[0]); | ||
87 | } else if (hiddenLayout.children[0] != item) { | 85 | } else if (hiddenLayout.children[0] != item) { | ||
88 | plasmoid.nativeInterface.reorderItemBefore(item, hiddenLayout.children[0]); | 86 | plasmoid.nativeInterface.reorderItemBefore(item, hiddenLayout.children[0]); | ||
89 | } | 87 | } | ||
90 | item.x = 0; | 88 | item.x = 0; | ||
89 | break; | ||||
91 | } | 90 | } | ||
92 | } | 91 | } | ||
93 | 92 | | |||
94 | onWheel: { | 93 | onWheel: { | ||
95 | // Don't propagate unhandled wheel events | 94 | // Don't propagate unhandled wheel events | ||
96 | wheel.accepted = true; | 95 | wheel.accepted = true; | ||
97 | } | 96 | } | ||
98 | 97 | | |||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |