Changeset View
Changeset View
Standalone View
Standalone View
applets/taskmanager/package/contents/ui/ToolTipInstance.qml
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 96 | PlasmaExtras.Heading { | |||
---|---|---|---|---|---|
101 | elide: Text.ElideRight | 101 | elide: Text.ElideRight | ||
102 | text: appName | 102 | text: appName | ||
103 | opacity: flatIndex == 0 | 103 | opacity: flatIndex == 0 | ||
104 | textFormat: Text.PlainText | 104 | textFormat: Text.PlainText | ||
105 | visible: text !== "" | 105 | visible: text !== "" | ||
106 | } | 106 | } | ||
107 | // window title | 107 | // window title | ||
108 | PlasmaExtras.Heading { | 108 | PlasmaExtras.Heading { | ||
109 | id: winTitle | ||||
109 | level: 5 | 110 | level: 5 | ||
110 | width: isWin ? textWidth : undefined | 111 | width: isWin ? textWidth : undefined | ||
111 | height: undefined | 112 | height: undefined | ||
112 | maximumLineCount: 1 | 113 | maximumLineCount: 1 | ||
113 | elide: Text.ElideRight | 114 | elide: Text.ElideRight | ||
114 | text: generateTitle() | 115 | text: generateTitle() | ||
115 | textFormat: Text.PlainText | 116 | textFormat: Text.PlainText | ||
116 | opacity: 0.75 | 117 | opacity: 0.75 | ||
118 | visible: !hasPlayer | ||||
117 | } | 119 | } | ||
118 | // subtext | 120 | // subtext | ||
119 | PlasmaExtras.Heading { | 121 | PlasmaExtras.Heading { | ||
120 | level: 6 | 122 | level: 6 | ||
121 | width: isWin ? textWidth : undefined | 123 | width: isWin ? textWidth : undefined | ||
122 | height: undefined | 124 | height: undefined | ||
123 | maximumLineCount: 1 | 125 | maximumLineCount: 1 | ||
124 | elide: Text.ElideRight | 126 | elide: Text.ElideRight | ||
Show All 39 Lines | |||||
164 | } | 166 | } | ||
165 | 167 | | |||
166 | // thumbnail container | 168 | // thumbnail container | ||
167 | Item { | 169 | Item { | ||
168 | id: thumbnail | 170 | id: thumbnail | ||
169 | width: header.width | 171 | width: header.width | ||
170 | // similar to 0.5625 = 1 / (16:9) as most screens are | 172 | // similar to 0.5625 = 1 / (16:9) as most screens are | ||
171 | // round necessary, otherwise shadow mask for players has gap! | 173 | // round necessary, otherwise shadow mask for players has gap! | ||
172 | height: Math.round(0.5 * width) | 174 | height: Math.round(0.5 * width) + (!winTitle.visible? winTitle.height : 0) | ||
173 | anchors.horizontalCenter: parent.horizontalCenter | 175 | anchors.horizontalCenter: parent.horizontalCenter | ||
174 | 176 | | |||
175 | visible: isWin | 177 | visible: isWin | ||
176 | 178 | | |||
177 | Item { | 179 | Item { | ||
178 | id: thumbnailSourceItem | 180 | id: thumbnailSourceItem | ||
179 | anchors.fill: parent | 181 | anchors.fill: parent | ||
180 | 182 | | |||
Show All 11 Lines | 193 | ToolTipWindowMouseArea { | |||
192 | anchors.fill: parent | 194 | anchors.fill: parent | ||
193 | rootTask: parentTask | 195 | rootTask: parentTask | ||
194 | modelIndex: submodelIndex | 196 | modelIndex: submodelIndex | ||
195 | winId: thumbnailSourceItem.winId | 197 | winId: thumbnailSourceItem.winId | ||
196 | } | 198 | } | ||
197 | } | 199 | } | ||
198 | 200 | | |||
199 | Image { | 201 | Image { | ||
202 | id: albumArtBackground | ||||
203 | source: albumArt | ||||
204 | anchors.fill: parent | ||||
205 | fillMode: Image.PreserveAspectCrop | ||||
206 | visible: albumArtImage.available | ||||
207 | layer.enabled: true | ||||
208 | opacity: 0.25 | ||||
209 | layer.effect: FastBlur { | ||||
210 | source: albumArtBackground | ||||
211 | anchors.fill: parent | ||||
212 | radius: 30 | ||||
213 | } | ||||
214 | } | ||||
215 | | ||||
216 | Image { | ||||
200 | id: albumArtImage | 217 | id: albumArtImage | ||
201 | // 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 | ||
202 | readonly property bool available: status === Image.Ready || status === Image.Loading | 219 | readonly property bool available: status === Image.Ready || status === Image.Loading | ||
203 | 220 | | |||
204 | anchors.fill: parent | 221 | height: thumbnail.height - playerControlsLoader.realHeight | ||
222 | anchors.horizontalCenter: parent.horizontalCenter | ||||
205 | sourceSize: Qt.size(parent.width, parent.height) | 223 | sourceSize: Qt.size(parent.width, parent.height) | ||
224 | | ||||
206 | asynchronous: true | 225 | asynchronous: true | ||
207 | source: albumArt | 226 | source: albumArt | ||
208 | fillMode: Image.PreserveAspectCrop | 227 | fillMode: Image.PreserveAspectFit | ||
209 | visible: available | 228 | visible: available | ||
210 | 229 | | |||
211 | ToolTipWindowMouseArea { | 230 | ToolTipWindowMouseArea { | ||
212 | anchors.fill: parent | 231 | anchors.fill: parent | ||
213 | rootTask: parentTask | 232 | rootTask: parentTask | ||
214 | modelIndex: submodelIndex | 233 | modelIndex: submodelIndex | ||
215 | winId: thumbnailSourceItem.winId | 234 | winId: thumbnailSourceItem.winId | ||
216 | } | 235 | } | ||
217 | } | 236 | } | ||
218 | 237 | | |||
219 | // when minimized, we don't have a preview, so show the icon | 238 | // when minimized, we don't have a preview, so show the icon | ||
220 | PlasmaCore.IconItem { | 239 | PlasmaCore.IconItem { | ||
221 | anchors.fill: parent | 240 | width: parent.width | ||
241 | height: thumbnail.height - playerControlsLoader.realHeight | ||||
242 | anchors.horizontalCenter: parent.horizontalCenter | ||||
222 | source: thumbnailSourceItem.isMinimized && !albumArtImage.visible ? icon : "" | 243 | source: thumbnailSourceItem.isMinimized && !albumArtImage.visible ? icon : "" | ||
223 | animated: false | 244 | animated: false | ||
224 | usesPlasmaTheme: false | 245 | usesPlasmaTheme: false | ||
225 | visible: valid | 246 | visible: valid | ||
226 | 247 | | |||
227 | ToolTipWindowMouseArea { | 248 | ToolTipWindowMouseArea { | ||
228 | anchors.fill: parent | 249 | anchors.fill: parent | ||
229 | rootTask: parentTask | 250 | rootTask: parentTask | ||
230 | modelIndex: submodelIndex | 251 | modelIndex: submodelIndex | ||
231 | winId: thumbnailSourceItem.winId | 252 | winId: thumbnailSourceItem.winId | ||
232 | } | 253 | } | ||
233 | } | 254 | } | ||
234 | } | 255 | } | ||
235 | 256 | | |||
236 | 257 | | |||
237 | Loader { | 258 | Loader { | ||
259 | id: playerControlsLoader | ||||
260 | | ||||
261 | property real realHeight: item? item.realHeight : 0 | ||||
262 | | ||||
238 | anchors.fill: thumbnail | 263 | anchors.fill: thumbnail | ||
239 | sourceComponent: hasPlayer ? playerControlsComp : undefined | 264 | sourceComponent: hasPlayer ? playerControlsComp : undefined | ||
240 | } | 265 | } | ||
241 | 266 | | |||
242 | Component { | 267 | Component { | ||
243 | id: playerControlsComp | 268 | id: playerControlsComp | ||
244 | 269 | | |||
245 | Item { | 270 | Item { | ||
271 | property real realHeight: playerControlsRow.height | ||||
272 | | ||||
246 | anchors.fill: parent | 273 | anchors.fill: parent | ||
247 | 274 | | |||
248 | // TODO: When could this really be the case? A not-launcher-task always has a window!? | 275 | // TODO: When could this really be the case? A not-launcher-task always has a window!? | ||
249 | // if there's no window associated with this task, we might still be able to raise the player | 276 | // if there's no window associated with this task, we might still be able to raise the player | ||
250 | // MouseArea { | 277 | // MouseArea { | ||
251 | // id: raisePlayerArea | 278 | // id: raisePlayerArea | ||
252 | // anchors.fill: parent | 279 | // anchors.fill: parent | ||
253 | 280 | | |||
Show All 39 Lines | 319 | anchors { | |||
293 | horizontalCenter: parent.horizontalCenter | 320 | horizontalCenter: parent.horizontalCenter | ||
294 | bottom: parent.bottom | 321 | bottom: parent.bottom | ||
295 | } | 322 | } | ||
296 | width: parent.width | 323 | width: parent.width | ||
297 | spacing: 0 | 324 | spacing: 0 | ||
298 | enabled: canControl | 325 | enabled: canControl | ||
299 | 326 | | |||
300 | ColumnLayout { | 327 | ColumnLayout { | ||
328 | Layout.leftMargin: 2 | ||||
301 | Layout.fillWidth: true | 329 | Layout.fillWidth: true | ||
302 | spacing: 0 | 330 | spacing: 0 | ||
303 | 331 | | |||
304 | PlasmaExtras.Heading { | 332 | PlasmaExtras.Heading { | ||
305 | Layout.fillWidth: true | 333 | Layout.fillWidth: true | ||
306 | level: 4 | 334 | level: 5 | ||
307 | wrapMode: Text.NoWrap | 335 | lineHeight: 1 | ||
336 | maximumLineCount: artistText.visible? 1 : 2 | ||||
337 | wrapMode: artistText.visible? Text.NoWrap : Text.Wrap | ||||
308 | elide: Text.ElideRight | 338 | elide: Text.ElideRight | ||
309 | text: track || "" | 339 | text: track || "" | ||
310 | } | 340 | } | ||
311 | 341 | | |||
312 | PlasmaExtras.Heading { | 342 | PlasmaExtras.Heading { | ||
343 | id: artistText | ||||
313 | Layout.fillWidth: true | 344 | Layout.fillWidth: true | ||
314 | level: 5 | 345 | level: 5 | ||
315 | wrapMode: Text.NoWrap | 346 | wrapMode: Text.NoWrap | ||
347 | lineHeight: 1 | ||||
316 | elide: Text.ElideRight | 348 | elide: Text.ElideRight | ||
317 | text: artist || "" | 349 | text: artist || "" | ||
350 | visible: text != "" | ||||
318 | } | 351 | } | ||
ngraham: No need to reduce the opacity here if the song name is bold. | |||||
trmdi: I think that makes it look nicer. | |||||
319 | } | 352 | } | ||
320 | 353 | | |||
321 | MouseArea { | 354 | MouseArea { | ||
322 | height: units.iconSizes.smallMedium | 355 | height: units.iconSizes.smallMedium | ||
323 | width: height | 356 | width: height | ||
324 | enabled: canGoBack | 357 | enabled: canGoBack | ||
325 | 358 | | |||
326 | acceptedButtons: Qt.LeftButton | 359 | acceptedButtons: Qt.LeftButton | ||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |
No need to reduce the opacity here if the song name is bold.