diff --git a/applets/taskmanager/package/contents/ui/ToolTipInstance.qml b/applets/taskmanager/package/contents/ui/ToolTipInstance.qml --- a/applets/taskmanager/package/contents/ui/ToolTipInstance.qml +++ b/applets/taskmanager/package/contents/ui/ToolTipInstance.qml @@ -106,14 +106,16 @@ } // window title PlasmaExtras.Heading { + id: winTitle level: 5 width: isWin ? textWidth : undefined height: undefined maximumLineCount: 1 elide: Text.ElideRight text: generateTitle() textFormat: Text.PlainText opacity: 0.75 + visible: !hasPlayer } // subtext PlasmaExtras.Heading { @@ -169,7 +171,7 @@ width: header.width // similar to 0.5625 = 1 / (16:9) as most screens are // round necessary, otherwise shadow mask for players has gap! - height: Math.round(0.5 * width) + height: Math.round(0.5 * width) + (!winTitle.visible? winTitle.height : 0) anchors.horizontalCenter: parent.horizontalCenter visible: isWin @@ -196,16 +198,33 @@ } } + Image { + id: albumArtBackground + source: albumArt + anchors.fill: parent + fillMode: Image.PreserveAspectCrop + visible: albumArtImage.available + layer.enabled: true + opacity: 0.25 + layer.effect: FastBlur { + source: albumArtBackground + anchors.fill: parent + radius: 30 + } + } + Image { id: albumArtImage // also Image.Loading to prevent loading thumbnails just because the album art takes a split second to load readonly property bool available: status === Image.Ready || status === Image.Loading - anchors.fill: parent + height: thumbnail.height - playerControlsLoader.realHeight + anchors.horizontalCenter: parent.horizontalCenter sourceSize: Qt.size(parent.width, parent.height) + asynchronous: true source: albumArt - fillMode: Image.PreserveAspectCrop + fillMode: Image.PreserveAspectFit visible: available ToolTipWindowMouseArea { @@ -235,14 +254,20 @@ Loader { + id: playerControlsLoader + + property real realHeight: item? item.realHeight : 0 + anchors.fill: thumbnail sourceComponent: hasPlayer ? playerControlsComp : undefined } Component { id: playerControlsComp Item { + property real realHeight: playerControlsRow.height + anchors.fill: parent // TODO: When could this really be the case? A not-launcher-task always has a window!? @@ -303,18 +328,23 @@ PlasmaExtras.Heading { Layout.fillWidth: true - level: 4 - wrapMode: Text.NoWrap + level: 5 + lineHeight: 1 + maximumLineCount: artistText.visible? 1 : 2 + wrapMode: artistText.visible? Text.NoWrap : Text.Wrap elide: Text.ElideRight text: track || "" } PlasmaExtras.Heading { + id: artistText Layout.fillWidth: true level: 5 wrapMode: Text.NoWrap + lineHeight: 1 elide: Text.ElideRight text: artist || "" + visible: text != "" } }