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 | | |||
181 | readonly property bool isMinimized: isGroup ? IsMinimized == true : isMinimizedParent | 183 | readonly property bool isMinimized: isGroup ? IsMinimized == true : isMinimizedParent | ||
182 | // TODO: this causes XCB error message when being visible the first time | 184 | // TODO: this causes XCB error message when being visible the first time | ||
183 | property int winId: isWin && windows[flatIndex] !== undefined ? windows[flatIndex] : 0 | 185 | property int winId: isWin && windows[flatIndex] !== undefined ? windows[flatIndex] : 0 | ||
184 | 186 | | |||
185 | PlasmaCore.WindowThumbnail { | 187 | PlasmaCore.WindowThumbnail { | ||
186 | anchors.fill: parent | 188 | anchors.fill: parent | ||
187 | 189 | | |||
188 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | 190 | visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized | ||
189 | winId: thumbnailSourceItem.winId | 191 | winId: thumbnailSourceItem.winId | ||
192 | } | ||||
190 | 193 | | |||
191 | ToolTipWindowMouseArea { | 194 | Image { | ||
195 | id: albumArtBackground | ||||
196 | source: albumArt | ||||
192 | anchors.fill: parent | 197 | anchors.fill: parent | ||
193 | rootTask: parentTask | 198 | fillMode: Image.PreserveAspectCrop | ||
194 | modelIndex: submodelIndex | 199 | visible: albumArtImage.available | ||
195 | winId: thumbnailSourceItem.winId | 200 | layer.enabled: true | ||
201 | opacity: 0.25 | ||||
202 | layer.effect: FastBlur { | ||||
203 | source: albumArtBackground | ||||
204 | anchors.fill: parent | ||||
205 | radius: 30 | ||||
196 | } | 206 | } | ||
197 | } | 207 | } | ||
198 | 208 | | |||
199 | Image { | 209 | Image { | ||
200 | id: albumArtImage | 210 | id: albumArtImage | ||
201 | // also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load | 211 | // 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 | 212 | readonly property bool available: status === Image.Ready || status === Image.Loading | ||
203 | 213 | | |||
204 | anchors.fill: parent | 214 | height: thumbnail.height - playerControlsLoader.realHeight | ||
215 | anchors.horizontalCenter: parent.horizontalCenter | ||||
205 | sourceSize: Qt.size(parent.width, parent.height) | 216 | sourceSize: Qt.size(parent.width, parent.height) | ||
217 | | ||||
206 | asynchronous: true | 218 | asynchronous: true | ||
207 | source: albumArt | 219 | source: albumArt | ||
208 | fillMode: Image.PreserveAspectCrop | 220 | fillMode: Image.PreserveAspectFit | ||
209 | visible: available | 221 | visible: available | ||
210 | | ||||
211 | ToolTipWindowMouseArea { | | |||
212 | anchors.fill: parent | | |||
213 | rootTask: parentTask | | |||
214 | modelIndex: submodelIndex | | |||
215 | winId: thumbnailSourceItem.winId | | |||
216 | } | | |||
217 | } | 222 | } | ||
218 | 223 | | |||
219 | // when minimized, we don't have a preview, so show the icon | 224 | // when minimized, we don't have a preview, so show the icon | ||
220 | PlasmaCore.IconItem { | 225 | PlasmaCore.IconItem { | ||
221 | anchors.fill: parent | 226 | width: parent.width | ||
227 | height: thumbnail.height - playerControlsLoader.realHeight | ||||
228 | anchors.horizontalCenter: parent.horizontalCenter | ||||
222 | source: thumbnailSourceItem.isMinimized && !albumArtImage.visible ? icon : "" | 229 | source: thumbnailSourceItem.isMinimized && !albumArtImage.visible ? icon : "" | ||
223 | animated: false | 230 | animated: false | ||
224 | usesPlasmaTheme: false | 231 | usesPlasmaTheme: false | ||
225 | visible: valid | 232 | visible: valid | ||
233 | } | ||||
226 | 234 | | |||
227 | ToolTipWindowMouseArea { | 235 | ToolTipWindowMouseArea { | ||
228 | anchors.fill: parent | 236 | anchors.fill: parent | ||
229 | rootTask: parentTask | 237 | rootTask: parentTask | ||
230 | modelIndex: submodelIndex | 238 | modelIndex: submodelIndex | ||
231 | winId: thumbnailSourceItem.winId | 239 | winId: thumbnailSourceItem.winId | ||
232 | } | 240 | } | ||
233 | } | 241 | } | ||
234 | } | | |||
235 | 242 | | |||
236 | 243 | | |||
237 | Loader { | 244 | Loader { | ||
245 | id: playerControlsLoader | ||||
246 | | ||||
247 | property real realHeight: item? item.realHeight : 0 | ||||
248 | | ||||
238 | anchors.fill: thumbnail | 249 | anchors.fill: thumbnail | ||
239 | sourceComponent: hasPlayer ? playerControlsComp : undefined | 250 | sourceComponent: hasPlayer ? playerControlsComp : undefined | ||
240 | } | 251 | } | ||
241 | 252 | | |||
242 | Component { | 253 | Component { | ||
243 | id: playerControlsComp | 254 | id: playerControlsComp | ||
244 | 255 | | |||
245 | Item { | 256 | Item { | ||
257 | property real realHeight: playerControlsRow.height | ||||
258 | | ||||
246 | anchors.fill: parent | 259 | anchors.fill: parent | ||
247 | 260 | | |||
248 | // TODO: When could this really be the case? A not-launcher-task always has a window!? | 261 | // 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 | 262 | // if there's no window associated with this task, we might still be able to raise the player | ||
250 | // MouseArea { | 263 | // MouseArea { | ||
251 | // id: raisePlayerArea | 264 | // id: raisePlayerArea | ||
252 | // anchors.fill: parent | 265 | // anchors.fill: parent | ||
253 | 266 | | |||
Show All 39 Lines | 305 | anchors { | |||
293 | horizontalCenter: parent.horizontalCenter | 306 | horizontalCenter: parent.horizontalCenter | ||
294 | bottom: parent.bottom | 307 | bottom: parent.bottom | ||
295 | } | 308 | } | ||
296 | width: parent.width | 309 | width: parent.width | ||
297 | spacing: 0 | 310 | spacing: 0 | ||
298 | enabled: canControl | 311 | enabled: canControl | ||
299 | 312 | | |||
300 | ColumnLayout { | 313 | ColumnLayout { | ||
314 | Layout.leftMargin: 2 | ||||
301 | Layout.fillWidth: true | 315 | Layout.fillWidth: true | ||
302 | spacing: 0 | 316 | spacing: 0 | ||
303 | 317 | | |||
304 | PlasmaExtras.Heading { | 318 | PlasmaExtras.Heading { | ||
305 | Layout.fillWidth: true | 319 | Layout.fillWidth: true | ||
306 | level: 4 | 320 | level: 5 | ||
307 | wrapMode: Text.NoWrap | 321 | lineHeight: 1 | ||
322 | maximumLineCount: artistText.visible? 1 : 2 | ||||
323 | wrapMode: artistText.visible? Text.NoWrap : Text.Wrap | ||||
308 | elide: Text.ElideRight | 324 | elide: Text.ElideRight | ||
309 | text: track || "" | 325 | text: track || "" | ||
326 | font.weight: Font.Bold | ||||
310 | } | 327 | } | ||
311 | 328 | | |||
312 | PlasmaExtras.Heading { | 329 | PlasmaExtras.Heading { | ||
330 | id: artistText | ||||
313 | Layout.fillWidth: true | 331 | Layout.fillWidth: true | ||
314 | level: 5 | 332 | level: 5 | ||
315 | wrapMode: Text.NoWrap | 333 | wrapMode: Text.NoWrap | ||
334 | lineHeight: 1 | ||||
316 | elide: Text.ElideRight | 335 | elide: Text.ElideRight | ||
317 | text: artist || "" | 336 | text: artist || "" | ||
337 | visible: text != "" | ||||
338 | opacity: 0.75 | ||||
ngraham: No need to reduce the opacity here if the song name is bold. | |||||
trmdi: I think that makes it look nicer. | |||||
318 | } | 339 | } | ||
319 | } | 340 | } | ||
320 | 341 | | |||
321 | MouseArea { | 342 | MouseArea { | ||
322 | height: units.iconSizes.smallMedium | 343 | height: units.iconSizes.smallMedium | ||
323 | width: height | 344 | width: height | ||
324 | enabled: canGoBack | 345 | enabled: canGoBack | ||
325 | 346 | | |||
▲ Show 20 Lines • Show All 165 Lines • Show Last 20 Lines |
No need to reduce the opacity here if the song name is bold.