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 | // Don't go under the player controls bar, when it's visible | ||||
184 | anchors.bottomMargin: playerControlsLoader.realHeight | ||||
183 | visible: hoverHandler.containsMouse | 185 | visible: hoverHandler.containsMouse | ||
184 | pressed: hoverHandler.containsPress | 186 | pressed: hoverHandler.containsPress | ||
185 | } | 187 | } | ||
ndavis: I recall seeing a QML dos and don'ts webinar that said not to use large z values. | |||||
186 | 188 | | |||
187 | PlasmaCore.WindowThumbnail { | 189 | PlasmaCore.WindowThumbnail { | ||
188 | anchors.fill: parent | 190 | anchors.fill: parent | ||
189 | anchors.margins: units.smallSpacing | 191 | // Not units.smallSpacing because then you get a frame-within-a-frame effect | ||
192 | // Not 0 because then it can cover up the entire tooltip effect | ||||
193 | anchors.margins: 1 | ||||
194 | // Don't go under the player controls bar, when it's visible | ||||
195 | // The +1 is so that at least one pixel of the highlight is visible on the bottom | ||||
196 | anchors.bottomMargin: playerControlsLoader.realHeight + 1 | ||||
190 | 197 | | |||
191 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | 198 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | ||
192 | winId: thumbnailSourceItem.winId | 199 | winId: thumbnailSourceItem.winId | ||
193 | } | 200 | } | ||
194 | 201 | | |||
195 | Image { | 202 | Image { | ||
196 | id: albumArtBackground | 203 | id: albumArtBackground | ||
197 | source: albumArt | 204 | source: albumArt | ||
198 | anchors.fill: parent | 205 | anchors.fill: parent | ||
199 | fillMode: Image.PreserveAspectCrop | 206 | fillMode: Image.PreserveAspectCrop | ||
207 | // Not units.smallSpacing because then you get a frame-within-a-frame effect | ||||
208 | // Not 0 because then it can cover up the entire tooltip effect | ||||
209 | anchors.margins: 1 | ||||
200 | visible: albumArtImage.available | 210 | visible: albumArtImage.available | ||
201 | layer.enabled: true | 211 | layer.enabled: true | ||
202 | opacity: 0.25 | 212 | opacity: 0.25 | ||
203 | layer.effect: FastBlur { | 213 | layer.effect: FastBlur { | ||
204 | source: albumArtBackground | 214 | source: albumArtBackground | ||
205 | anchors.fill: parent | 215 | anchors.fill: parent | ||
206 | radius: 30 | 216 | radius: 30 | ||
207 | } | 217 | } | ||
208 | } | 218 | } | ||
209 | 219 | | |||
210 | Image { | 220 | Image { | ||
211 | id: albumArtImage | 221 | id: albumArtImage | ||
212 | // also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load | 222 | // 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 | 223 | readonly property bool available: status === Image.Ready || status === Image.Loading | ||
214 | 224 | | |||
215 | height: thumbnail.height - playerControlsLoader.realHeight | 225 | // The -1 is so that at least one pixel of the highlight is visible on the bottom | ||
226 | height: albumArtBackground.height - playerControlsLoader.realHeight - 1 | ||||
227 | anchors.top: albumArtBackground.top | ||||
216 | anchors.horizontalCenter: parent.horizontalCenter | 228 | anchors.horizontalCenter: parent.horizontalCenter | ||
217 | sourceSize: Qt.size(parent.width, parent.height) | 229 | sourceSize: Qt.size(parent.width, parent.height) | ||
218 | 230 | | |||
219 | asynchronous: true | 231 | asynchronous: true | ||
220 | source: albumArt | 232 | source: albumArt | ||
221 | fillMode: Image.PreserveAspectFit | 233 | fillMode: Image.PreserveAspectFit | ||
222 | visible: available | 234 | visible: available | ||
223 | } | 235 | } | ||
▲ 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.