Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/items/AbstractItem.qml
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 24 | PlasmaCore.ToolTipArea { | |||
---|---|---|---|---|---|
42 | signal clicked(var mouse) | 42 | signal clicked(var mouse) | ||
43 | signal wheel(var wheel) | 43 | signal wheel(var wheel) | ||
44 | signal contextMenu(var mouse) | 44 | signal contextMenu(var mouse) | ||
45 | 45 | | |||
46 | property bool forcedHidden: plasmoid.configuration.hiddenItems.indexOf(itemId) !== -1 | 46 | property bool forcedHidden: plasmoid.configuration.hiddenItems.indexOf(itemId) !== -1 | ||
47 | property bool forcedShown: plasmoid.configuration.showAllItems || plasmoid.configuration.shownItems.indexOf(itemId) !== -1 | 47 | property bool forcedShown: plasmoid.configuration.showAllItems || plasmoid.configuration.shownItems.indexOf(itemId) !== -1 | ||
48 | property bool categoryShown: shownCategories.indexOf(category) != -1; | 48 | property bool categoryShown: shownCategories.indexOf(category) != -1; | ||
49 | 49 | | |||
50 | readonly property int effectiveStatus: { | ||||
51 | if (!categoryShown) { | ||||
52 | return PlasmaCore.Types.HiddenStatus | ||||
53 | } else if (forcedShown || (!forcedHidden && status !== PlasmaCore.Types.PassiveStatus)) { | ||||
54 | return PlasmaCore.Types.ActiveStatus | ||||
55 | } else { | ||||
56 | return PlasmaCore.Types.PassiveStatus | ||||
57 | } | ||||
58 | } | ||||
50 | 59 | | |||
51 | /* subclasses need to assign to this tiiltip properties | 60 | /* subclasses need to assign to this tiiltip properties | ||
52 | mainText: | 61 | mainText: | ||
53 | subText: | 62 | subText: | ||
54 | icon: | 63 | icon: | ||
55 | */ | 64 | */ | ||
56 | 65 | | |||
57 | location: { | 66 | location: { | ||
58 | if (abstractItem.parent && abstractItem.parent.objectName === "hiddenTasksColumn") { | 67 | if (abstractItem.parent && abstractItem.parent.objectName === "hiddenTasksColumn") { | ||
59 | if (LayoutMirroring.enabled && plasmoid.location !== PlasmaCore.Types.RightEdge) { | 68 | if (LayoutMirroring.enabled && plasmoid.location !== PlasmaCore.Types.RightEdge) { | ||
60 | return PlasmaCore.Types.LeftEdge; | 69 | return PlasmaCore.Types.LeftEdge; | ||
61 | } else if (plasmoid.location !== PlasmaCore.Types.LeftEdge) { | 70 | } else if (plasmoid.location !== PlasmaCore.Types.LeftEdge) { | ||
62 | return PlasmaCore.Types.RightEdge; | 71 | return PlasmaCore.Types.RightEdge; | ||
63 | } | 72 | } | ||
64 | } | 73 | } | ||
65 | 74 | | |||
66 | return plasmoid.location; | 75 | return plasmoid.location; | ||
67 | } | 76 | } | ||
68 | 77 | | |||
69 | //BEGIN CONNECTIONS | 78 | //BEGIN CONNECTIONS | ||
70 | 79 | | |||
71 | onStatusChanged: updateItemVisibility(abstractItem); | 80 | onEffectiveStatusChanged: updateItemVisibility(abstractItem); | ||
72 | 81 | | |||
73 | onContainsMouseChanged: { | 82 | onContainsMouseChanged: { | ||
74 | if (hidden && containsMouse) { | 83 | if (hidden && containsMouse) { | ||
75 | root.hiddenLayout.hoveredItem = abstractItem | 84 | root.hiddenLayout.hoveredItem = abstractItem | ||
76 | } | 85 | } | ||
77 | } | 86 | } | ||
78 | 87 | | |||
79 | Component.onCompleted: updateItemVisibility(abstractItem); | 88 | Component.onCompleted: updateItemVisibility(abstractItem); | ||
80 | onForcedHiddenChanged: updateItemVisibility(abstractItem); | | |||
81 | onForcedShownChanged: updateItemVisibility(abstractItem); | | |||
82 | onCategoryShownChanged: updateItemVisibility(abstractItem); | | |||
83 | 89 | | |||
84 | //dangerous but needed due how repeater reparents | 90 | //dangerous but needed due how repeater reparents | ||
85 | onParentChanged: updateItemVisibility(abstractItem); | 91 | onParentChanged: updateItemVisibility(abstractItem); | ||
86 | 92 | | |||
87 | //END CONNECTIONS | 93 | //END CONNECTIONS | ||
88 | 94 | | |||
89 | PulseAnimation { | 95 | PulseAnimation { | ||
90 | targetItem: iconItem | 96 | targetItem: iconItem | ||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |