diff options
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/SystemTray.qml')
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell/SystemTray.qml | 55 |
1 files changed, 45 insertions, 10 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml index 55b1690e..351e74ee 100644 --- a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml +++ b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml | |||
@@ -1,4 +1,5 @@ | |||
1 | import QtQuick | 1 | import QtQuick |
2 | import QtQuick.Effects | ||
2 | import Quickshell | 3 | import Quickshell |
3 | import Quickshell.Widgets | 4 | import Quickshell.Widgets |
4 | import Quickshell.Services.SystemTray | 5 | import Quickshell.Services.SystemTray |
@@ -28,6 +29,9 @@ Item { | |||
28 | delegate: Item { | 29 | delegate: Item { |
29 | id: trayItemWrapper | 30 | id: trayItemWrapper |
30 | 31 | ||
32 | required property var modelData | ||
33 | required property int index | ||
34 | |||
31 | property var trayItem: modelData | 35 | property var trayItem: modelData |
32 | property string iconSource: { | 36 | property string iconSource: { |
33 | let icon = trayItem && trayItem.icon | 37 | let icon = trayItem && trayItem.icon |
@@ -47,7 +51,7 @@ Item { | |||
47 | return "" | 51 | return "" |
48 | } | 52 | } |
49 | 53 | ||
50 | width: 16 | 54 | width: icon.width + 6 |
51 | height: parent.height | 55 | height: parent.height |
52 | anchors.verticalCenter: parent.verticalCenter | 56 | anchors.verticalCenter: parent.verticalCenter |
53 | 57 | ||
@@ -83,14 +87,41 @@ Item { | |||
83 | } | 87 | } |
84 | } | 88 | } |
85 | 89 | ||
86 | IconImage { | 90 | Rectangle { |
87 | anchors.centerIn: parent | 91 | anchors.fill: parent |
88 | width: parent.width | 92 | color: { |
89 | height: parent.width | 93 | if (trayItemArea.containsMouse) |
90 | source: trayItemWrapper.iconSource | 94 | return "#33808080"; |
91 | asynchronous: true | 95 | return "transparent"; |
92 | smooth: true | 96 | } |
93 | mipmap: true | 97 | |
98 | Item { | ||
99 | anchors.fill: parent | ||
100 | |||
101 | layer.enabled: true | ||
102 | layer.effect: MultiEffect { | ||
103 | colorization: 1 | ||
104 | colorizationColor: "#555" | ||
105 | } | ||
106 | |||
107 | IconImage { | ||
108 | id: icon | ||
109 | |||
110 | anchors.centerIn: parent | ||
111 | implicitSize: 16 | ||
112 | source: trayItemWrapper.iconSource | ||
113 | asynchronous: true | ||
114 | smooth: true | ||
115 | mipmap: true | ||
116 | |||
117 | layer.enabled: true | ||
118 | layer.effect: MultiEffect { | ||
119 | id: effect | ||
120 | |||
121 | brightness: 1 | ||
122 | } | ||
123 | } | ||
124 | } | ||
94 | } | 125 | } |
95 | } | 126 | } |
96 | 127 | ||
@@ -116,7 +147,7 @@ Item { | |||
116 | color: "black" | 147 | color: "black" |
117 | 148 | ||
118 | implicitWidth: Math.max(tooltipTitle.contentWidth, tooltipDescription.contentWidth) + 16 | 149 | implicitWidth: Math.max(tooltipTitle.contentWidth, tooltipDescription.contentWidth) + 16 |
119 | implicitHeight: tooltipTitle.contentHeight + tooltipDescription.contentHeight + 16 | 150 | implicitHeight: (trayItem.tooltipTitle ? tooltipTitle.contentHeight : 0) + (trayItem.tooltipDescription ? tooltipDescription.contentHeight : 0) + 16 |
120 | 151 | ||
121 | WrapperMouseArea { | 152 | WrapperMouseArea { |
122 | id: tooltipMouseArea | 153 | id: tooltipMouseArea |
@@ -130,6 +161,8 @@ Item { | |||
130 | Text { | 161 | Text { |
131 | id: tooltipTitle | 162 | id: tooltipTitle |
132 | 163 | ||
164 | enabled: trayItem.tooltipTitle | ||
165 | |||
133 | font.pointSize: 10 | 166 | font.pointSize: 10 |
134 | font.family: "Fira Sans" | 167 | font.family: "Fira Sans" |
135 | font.bold: true | 168 | font.bold: true |
@@ -141,6 +174,8 @@ Item { | |||
141 | Text { | 174 | Text { |
142 | id: tooltipDescription | 175 | id: tooltipDescription |
143 | 176 | ||
177 | enabled: trayItem.tooltipDescription | ||
178 | |||
144 | font.pointSize: 10 | 179 | font.pointSize: 10 |
145 | font.family: "Fira Sans" | 180 | font.family: "Fira Sans" |
146 | color: "white" | 181 | color: "white" |