Commit 28b79d4c authored by Nate Graham's avatar Nate Graham
Browse files

[applets/taskmanager] Add drop shadow behind tooltip window thumbnails

This adds a bit of visual bling and also helps to visually distinguish
the window thumbnail from its background, in cases where they might be
similar (which can happen given the diversity of possible combinations
of Plasma themes and window appearances).

BUG: 435694
FIXED-IN: 5.22
parent 1390b551
......@@ -170,9 +170,13 @@ ColumnLayout {
}
PlasmaCore.WindowThumbnail {
id: x11Thumbnail
anchors.fill: hoverHandler
// Indent by one pixel to make sure we never cover up the entire highlight
anchors.margins: 1
// Indent a little bit so that neither the thumbnail nor the drop
// shadow can cover up the highlight
anchors.margins: PlasmaCore.Units.smallSpacing * 2
visible: !albumArtImage.visible && !thumbnailSourceItem.isMinimized && Number.isInteger(thumbnailSourceItem.winId)
winId: Number.isInteger(thumbnailSourceItem.winId) ? thumbnailSourceItem.winId : 0
......@@ -181,7 +185,9 @@ ColumnLayout {
Loader {
id: pipeWireLoader
anchors.fill: hoverHandler
anchors.margins: 1
// Indent a little bit so that neither the thumbnail nor the drop
// shadow can cover up the highlight
anchors.margins: PlasmaCore.Units.smallSpacing * 2
active: !albumArtImage.visible && !Number.isInteger(thumbnailSourceItem.winId)
......@@ -189,6 +195,17 @@ ColumnLayout {
source: "PipeWireThumbnail.qml"
}
DropShadow {
anchors.fill: pipeWireLoader.active ? pipeWireLoader.item : x11Thumbnail
visible: pipeWireLoader.active ? pipeWireLoader.item.visible : x11Thumbnail.visible
horizontalOffset: 0
verticalOffset: Math.round(3 * PlasmaCore.Units.devicePixelRatio)
radius: Math.round(8.0 * PlasmaCore.Units.devicePixelRatio)
samples: Math.round(radius * 1.5)
color: "Black"
source: pipeWireLoader.active ? pipeWireLoader.item : x11Thumbnail
}
Image {
id: albumArtBackground
source: albumArt
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment