From 0ff4f84aceef4262d4da3602d3cbe34c630ea2de Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 14 Dec 2023 12:38:13 +0100 Subject: [PATCH] plugins/overview: Replace OpacityMask with ShadowedTexture The OpacityMask is used purely for rounding the corners. We can get rid of it by using ShadowedTexture which does the same thing while also drawing the shadow, meaning we can also eliminate the ShadowedRectangle. --- src/plugins/overview/qml/main.qml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/plugins/overview/qml/main.qml b/src/plugins/overview/qml/main.qml index fc99dc483a..94241712dd 100644 --- a/src/plugins/overview/qml/main.qml +++ b/src/plugins/overview/qml/main.qml @@ -409,9 +409,9 @@ FocusScope { property Item currentHeap property Item currentBackgroundItem - Kirigami.ShadowedRectangle { + Item { id: mainBackground - color: Kirigami.Theme.highlightColor + visible: gridVal > 0 || nearCurrent anchors.fill: parent property bool shouldBeVisibleInOverview: !(effect.searchText.length > 0 && current) || (heap.count !== 0 && effect.filterWindows) @@ -431,13 +431,6 @@ FocusScope { z: dragActive ? 1 : 0 readonly property bool dragActive: heap.dragActive || dragHandler.active - shadow { - size: Kirigami.Units.gridUnit * 2 - color: Qt.rgba(0, 0, 0, 0.3) - yOffset: 3 - } - radius: Kirigami.Units.largeSpacing * 2 * (overviewVal + gridVal * 2) - property int gridSize: Math.max(rows, columns) property real row: (index - column) / columns property real column: index % columns @@ -524,14 +517,19 @@ FocusScope { outputName: targetScreen.name visible: false } - OpacityMask { + + Kirigami.ShadowedTexture { anchors.fill: parent + + color: Kirigami.Theme.highlightColor source: desktopElement - maskSource: Rectangle { - anchors.centerIn: parent - width: desktopElement.width - height: desktopElement.height - radius: mainBackground.radius + + radius: Kirigami.Units.largeSpacing * 2 * (overviewVal + gridVal * 2) + + shadow { + size: Kirigami.Units.gridUnit * 2 + color: Qt.rgba(0, 0, 0, 0.3) + yOffset: 3 } }