Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/CompactRepresentation.qml
Show All 17 Lines | |||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.8 | 21 | import QtQuick 2.8 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | 23 | | |||
24 | import org.kde.plasma.core 2.0 as PlasmaCore | 24 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
25 | import org.kde.plasma.components 2.0 as PlasmaComponents | 25 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
26 | import org.kde.plasma.workspace.components 2.0 | ||||
26 | 27 | | |||
27 | import org.kde.quickcharts 1.0 as Charts | 28 | import org.kde.quickcharts 1.0 as Charts | ||
28 | 29 | | |||
29 | MouseArea { | 30 | MouseArea { | ||
30 | id: compactRoot | 31 | id: compactRoot | ||
31 | 32 | | |||
33 | hoverEnabled: true | ||||
34 | | ||||
32 | readonly property bool inPanel: (plasmoid.location === PlasmaCore.Types.TopEdge | 35 | readonly property bool inPanel: (plasmoid.location === PlasmaCore.Types.TopEdge | ||
33 | || plasmoid.location === PlasmaCore.Types.RightEdge | 36 | || plasmoid.location === PlasmaCore.Types.RightEdge | ||
34 | || plasmoid.location === PlasmaCore.Types.BottomEdge | 37 | || plasmoid.location === PlasmaCore.Types.BottomEdge | ||
35 | || plasmoid.location === PlasmaCore.Types.LeftEdge) | 38 | || plasmoid.location === PlasmaCore.Types.LeftEdge) | ||
36 | 39 | | |||
37 | Layout.minimumWidth: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? height : units.iconSizes.small | 40 | Layout.minimumWidth: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? height : units.iconSizes.small | ||
38 | Layout.minimumHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical ? width : (units.iconSizes.small + 2 * theme.mSize(theme.defaultFont).height) | 41 | Layout.minimumHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical ? width : (units.iconSizes.small + 2 * theme.mSize(theme.defaultFont).height) | ||
39 | 42 | | |||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 64 | PlasmaCore.SvgItem { | |||
102 | PlasmaComponents.BusyIndicator { | 105 | PlasmaComponents.BusyIndicator { | ||
103 | id: busyIndicator | 106 | id: busyIndicator | ||
104 | anchors.fill: parent | 107 | anchors.fill: parent | ||
105 | visible: false | 108 | visible: false | ||
106 | running: visible | 109 | running: visible | ||
107 | } | 110 | } | ||
108 | } | 111 | } | ||
109 | 112 | | |||
113 | IconEffects { | ||||
114 | source: notificationIcon | ||||
115 | iconActive: visible && compactRoot.containsMouse | ||||
116 | } | ||||
117 | | ||||
110 | PlasmaCore.IconItem { | 118 | PlasmaCore.IconItem { | ||
111 | id: dndIcon | 119 | id: dndIcon | ||
112 | anchors.fill: parent | 120 | anchors.fill: parent | ||
113 | source: "notifications-disabled" | 121 | source: "notifications-disabled" | ||
114 | opacity: 0 | 122 | opacity: 0 | ||
115 | scale: 2 | 123 | scale: 2 | ||
116 | visible: opacity > 0 | 124 | visible: opacity > 0 | ||
117 | } | 125 | } | ||
118 | 126 | | |||
127 | IconEffects { | ||||
128 | source: dndIcon | ||||
129 | iconActive: visible && compactRoot.containsMouse | ||||
130 | } | ||||
131 | | ||||
119 | states: [ | 132 | states: [ | ||
120 | State { // active process | 133 | State { // active process | ||
121 | when: compactRoot.jobsCount > 0 | 134 | when: compactRoot.jobsCount > 0 | ||
122 | PropertyChanges { | 135 | PropertyChanges { | ||
123 | target: notificationIcon | 136 | target: notificationIcon | ||
124 | elementId: "notification-progress-inactive" | 137 | elementId: "notification-progress-inactive" | ||
125 | } | 138 | } | ||
126 | PropertyChanges { | 139 | PropertyChanges { | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |