Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/ToolTipInstance.qml
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Line(s) | 173 | Item { | |||
---|---|---|---|---|---|
175 | anchors.fill: parent | 175 | anchors.fill: parent | ||
176 | 176 | | |||
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 | anchors.bottomMargin: playerControlsLoader.realHeight | ||||
183 | visible: hoverHandler.containsMouse | 184 | visible: hoverHandler.containsMouse | ||
184 | pressed: hoverHandler.containsPress | 185 | pressed: hoverHandler.containsPress | ||
185 | } | 186 | } | ||
ndavis: I recall seeing a QML dos and don'ts webinar that said not to use large z values. | |||||
186 | 187 | | |||
187 | PlasmaCore.WindowThumbnail { | 188 | PlasmaCore.WindowThumbnail { | ||
188 | anchors.fill: parent | 189 | anchors.fill: parent | ||
189 | anchors.margins: units.smallSpacing | 190 | // Not units.smallSpacing because then you get a frame-within-a-frame effect | ||
191 | // Not 0 because then it can cover up the entire tooltip effect | ||||
192 | anchors.margins: 1 | ||||
190 | 193 | | |||
191 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | 194 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | ||
192 | winId: thumbnailSourceItem.winId | 195 | winId: thumbnailSourceItem.winId | ||
193 | } | 196 | } | ||
194 | 197 | | |||
195 | Image { | 198 | Image { | ||
196 | id: albumArtBackground | 199 | id: albumArtBackground | ||
197 | source: albumArt | 200 | source: albumArt | ||
198 | anchors.fill: parent | 201 | anchors.fill: parent | ||
199 | fillMode: Image.PreserveAspectCrop | 202 | fillMode: Image.PreserveAspectCrop | ||
203 | // Not units.smallSpacing because then you get a frame-within-a-frame effect | ||||
204 | // Not 0 because then it can cover up the entire tooltip effect | ||||
205 | anchors.margins: 1 | ||||
200 | visible: albumArtImage.available | 206 | visible: albumArtImage.available | ||
201 | layer.enabled: true | 207 | layer.enabled: true | ||
202 | opacity: 0.25 | 208 | opacity: 0.25 | ||
203 | layer.effect: FastBlur { | 209 | layer.effect: FastBlur { | ||
204 | source: albumArtBackground | 210 | source: albumArtBackground | ||
205 | anchors.fill: parent | 211 | anchors.fill: parent | ||
206 | radius: 30 | 212 | radius: 30 | ||
207 | } | 213 | } | ||
208 | } | 214 | } | ||
209 | 215 | | |||
210 | Image { | 216 | Image { | ||
211 | id: albumArtImage | 217 | id: albumArtImage | ||
212 | // also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load | 218 | // 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 | 219 | readonly property bool available: status === Image.Ready || status === Image.Loading | ||
214 | 220 | | |||
215 | height: thumbnail.height - playerControlsLoader.realHeight | 221 | height: albumArtBackground.height - playerControlsLoader.realHeight | ||
222 | anchors.top: albumArtBackground.top | ||||
216 | anchors.horizontalCenter: parent.horizontalCenter | 223 | anchors.horizontalCenter: parent.horizontalCenter | ||
217 | sourceSize: Qt.size(parent.width, parent.height) | 224 | sourceSize: Qt.size(parent.width, parent.height) | ||
218 | 225 | | |||
219 | asynchronous: true | 226 | asynchronous: true | ||
220 | source: albumArt | 227 | source: albumArt | ||
221 | fillMode: Image.PreserveAspectFit | 228 | fillMode: Image.PreserveAspectFit | ||
222 | visible: available | 229 | visible: available | ||
223 | } | 230 | } | ||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |
I recall seeing a QML dos and don'ts webinar that said not to use large z values.