From 181ce590a924e82cdc7302b876e17c588f595597 Mon Sep 17 00:00:00 2001 From: Akseli Lahtinen Date: Fri, 1 Mar 2024 12:05:14 +0000 Subject: [PATCH] plugins/overview: Adds a border around hovered and selected desktop in desktopGrid Currently desktop grid view is missing the selection rectangle when hovered over a desktop. This adds the selection rectangle on hover, since it used to be there before three-state design. Currently selected desktop has thinner and different colored border. ![image](/uploads/ad1f2f7acbe602fb7b9479ce859026b7/image.png) ![image](/uploads/9fa50bac4b81958da0b8926f8d2518ba/image.png) ![image](/uploads/3e46c1f5a740c40bbf18a5d887f31d39/image.png) BUG:481812 --- src/plugins/overview/qml/main.qml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/overview/qml/main.qml b/src/plugins/overview/qml/main.qml index 441edeb8af..a798827fa1 100644 --- a/src/plugins/overview/qml/main.qml +++ b/src/plugins/overview/qml/main.qml @@ -524,7 +524,7 @@ FocusScope { Kirigami.ShadowedTexture { anchors.fill: parent - color: Kirigami.Theme.highlightColor + color: "transparent" source: desktopElement radius: Kirigami.Units.largeSpacing * 2 * (overviewVal + gridVal * 2) @@ -534,6 +534,11 @@ FocusScope { color: Qt.rgba(0, 0, 0, 0.3) yOffset: 3 } + + property var borderWidth: desktopHover.hovered ? Kirigami.Units.largeSpacing : (mainBackground.current ? Kirigami.Units.smallSpacing : 0); + property var borderColor: desktopHover.hovered ? Kirigami.Theme.focusColor : (mainBackground.current ? Kirigami.Theme.highlightColor : "transparent") + border.width: gridVal == 1 ? borderWidth : 0 + border.color: gridVal == 1 ? borderColor : "transparent" } DropArea { @@ -593,6 +598,10 @@ FocusScope { } } } + + HoverHandler { + id: desktopHover + } } WindowHeap {