Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/ToolTipInstance.qml
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Line(s) | 173 | Item { | |||
---|---|---|---|---|---|
177 | readonly property bool isMinimized: isGroup ? IsMinimized == true : isMinimizedParent | 177 | readonly property bool isMinimized: isGroup ? IsMinimized == true : isMinimizedParent | ||
178 | // TODO: this causes XCB error message when being visible the first time | 178 | // TODO: this causes XCB error message when being visible the first time | ||
179 | property int winId: isWin && windows[flatIndex] !== undefined ? windows[flatIndex] : 0 | 179 | property int winId: isWin && windows[flatIndex] !== undefined ? windows[flatIndex] : 0 | ||
180 | 180 | | |||
181 | PlasmaComponents.Highlight { | 181 | PlasmaComponents.Highlight { | ||
182 | anchors.fill: parent | 182 | anchors.fill: parent | ||
183 | visible: hoverHandler.containsMouse | 183 | visible: hoverHandler.containsMouse | ||
184 | pressed: hoverHandler.containsPress | 184 | pressed: hoverHandler.containsPress | ||
185 | } | 185 | } | ||
ndavis: I recall seeing a QML dos and don'ts webinar that said not to use large z values. | |||||
186 | 186 | | |||
187 | PlasmaCore.WindowThumbnail { | 187 | PlasmaCore.WindowThumbnail { | ||
188 | anchors.fill: parent | 188 | anchors.fill: parent | ||
189 | anchors.margins: units.smallSpacing | 189 | anchors.margins: units.smallSpacing | ||
190 | 190 | | |||
191 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | 191 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | ||
192 | winId: thumbnailSourceItem.winId | 192 | winId: thumbnailSourceItem.winId | ||
193 | } | 193 | } | ||
194 | 194 | | |||
195 | Image { | 195 | Image { | ||
196 | id: albumArtBackground | 196 | id: albumArtBackground | ||
197 | source: albumArt | 197 | source: albumArt | ||
198 | anchors.fill: parent | 198 | anchors.fill: parent | ||
199 | anchors.margins: 1 // Otherwise it can cover up the entire tooltip effect | ||||
199 | fillMode: Image.PreserveAspectCrop | 200 | fillMode: Image.PreserveAspectCrop | ||
200 | visible: albumArtImage.available | 201 | visible: albumArtImage.available | ||
201 | layer.enabled: true | 202 | layer.enabled: true | ||
202 | opacity: 0.25 | 203 | opacity: 0.25 | ||
203 | layer.effect: FastBlur { | 204 | layer.effect: FastBlur { | ||
204 | source: albumArtBackground | 205 | source: albumArtBackground | ||
205 | anchors.fill: parent | 206 | anchors.fill: parent | ||
206 | radius: 30 | 207 | radius: 30 | ||
207 | } | 208 | } | ||
208 | } | 209 | } | ||
209 | 210 | | |||
210 | Image { | 211 | Image { | ||
211 | id: albumArtImage | 212 | id: albumArtImage | ||
212 | // also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load | 213 | // also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load | ||
213 | readonly property bool available: status === Image.Ready || status === Image.Loading | 214 | readonly property bool available: status === Image.Ready || status === Image.Loading | ||
214 | 215 | | |||
215 | height: thumbnail.height - playerControlsLoader.realHeight | 216 | height: albumArtBackground.height - playerControlsLoader.realHeight | ||
217 | anchors.top: albumArtBackground.top | ||||
216 | anchors.horizontalCenter: parent.horizontalCenter | 218 | anchors.horizontalCenter: parent.horizontalCenter | ||
217 | sourceSize: Qt.size(parent.width, parent.height) | 219 | sourceSize: Qt.size(parent.width, parent.height) | ||
218 | 220 | | |||
219 | asynchronous: true | 221 | asynchronous: true | ||
220 | source: albumArt | 222 | source: albumArt | ||
221 | fillMode: Image.PreserveAspectFit | 223 | fillMode: Image.PreserveAspectFit | ||
222 | visible: available | 224 | visible: available | ||
223 | } | 225 | } | ||
Show All 20 Lines | |||||
244 | 246 | | |||
245 | 247 | | |||
246 | Loader { | 248 | Loader { | ||
247 | id: playerControlsLoader | 249 | id: playerControlsLoader | ||
248 | 250 | | |||
249 | property real realHeight: item? item.realHeight : 0 | 251 | property real realHeight: item? item.realHeight : 0 | ||
250 | 252 | | |||
251 | anchors.fill: thumbnail | 253 | anchors.fill: thumbnail | ||
254 | // Otherwise it can cover up the entire tooltip effect | ||||
255 | anchors.leftMargin: 1 | ||||
256 | anchors.rightMargin: 1 | ||||
257 | anchors.bottomMargin: 1 | ||||
252 | sourceComponent: hasPlayer ? playerControlsComp : undefined | 258 | sourceComponent: hasPlayer ? playerControlsComp : undefined | ||
253 | } | 259 | } | ||
254 | 260 | | |||
255 | Component { | 261 | Component { | ||
256 | id: playerControlsComp | 262 | id: playerControlsComp | ||
257 | 263 | | |||
258 | Item { | 264 | Item { | ||
259 | property real realHeight: playerControlsRow.height | 265 | property real realHeight: playerControlsRow.height | ||
▲ Show 20 Lines • Show All 212 Lines • Show Last 20 Lines |
I recall seeing a QML dos and don'ts webinar that said not to use large z values.