diff --git a/applets/pager/package/contents/ui/main.qml b/applets/pager/package/contents/ui/main.qml --- a/applets/pager/package/contents/ui/main.qml +++ b/applets/pager/package/contents/ui/main.qml @@ -19,6 +19,8 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 +import QtGraphicalEffects 1.12 + import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents @@ -175,6 +177,7 @@ id: desktopLabelComponent PlasmaComponents.Label { + anchors { fill: parent topMargin: desktopFrame.margins.top @@ -189,6 +192,16 @@ text: plasmoid.configuration.displayedText ? model.display : index + 1 + layer.enabled: true + layer.effect: DropShadow { + // hardcoded because black is the only color that looks good for shadows + color: "black" + verticalOffset: 1 + radius: 4 + samples: 9 + spread: 0.4 + } + wrapMode: Text.NoWrap elide: Text.ElideRight @@ -199,7 +212,12 @@ // unset pointSize set by PlasmaComponents.Label to avoid "Both point size and pixel size set." warning font.pointSize: -1 - z: 0 // Below windows and FrameSvg + // hardcoded because the shadow color is hardcoded, and it doesn't + // make sense to allow the label color to change because then it + // could be dark and almost invisible with the always-black shadow + color: "white" + + z: 9999 // The label goes above everything } } @@ -378,7 +396,7 @@ id: desktopFrame anchors.fill: parent - z: 2 // Above optional label item and windows + z: 2 // Above window outlines, but below label imagePath: "widgets/pager" prefix: (desktopMouseArea.enabled && desktopMouseArea.containsMouse) || (root.dragging && root.dragId == desktopId) ? "hover" : (desktop.active ? "active" : "normal") @@ -418,7 +436,7 @@ width: desktop.width - 2 * x height: desktop.height - 2 * y - z: 1 // Between optional label item and FrameSvg + z: 1 // Below FrameSvg Repeater { id: windowRectRepeater