From a7987f5a331a2adee1b825caa0892673e9a486e3 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 6 Dec 2023 13:53:00 +0200 Subject: [PATCH] Change window highlight style in WindowHeapDelegate Currently FrameSvgItem is used to highlight selected or hovered windows. But the problem with it is that it's a bit heavyweight. As a way around it, we could put it in a Loader, but that's going to be bring a set of other challenges. As an alternative solution, this change replaces FrameSvgItem with a simple outline. It still produces decent visuals and it's simpler. --- .../private/qml/WindowHeapDelegate.qml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/plugins/private/qml/WindowHeapDelegate.qml b/src/plugins/private/qml/WindowHeapDelegate.qml index 6a374be27e..1055231255 100644 --- a/src/plugins/private/qml/WindowHeapDelegate.qml +++ b/src/plugins/private/qml/WindowHeapDelegate.qml @@ -127,17 +127,14 @@ Item { thumb.windowHeap.deleteDND(thumb.window.internalId); } - KSvg.FrameSvgItem { - anchors { - fill: parent - topMargin: -Kirigami.Units.smallSpacing * 2 - leftMargin: -Kirigami.Units.smallSpacing * 2 - rightMargin: -Kirigami.Units.smallSpacing * 2 - bottomMargin: -(Math.round(icon.height / 4) + (thumb.windowTitleVisible ? caption.height : 0) + (Kirigami.Units.smallSpacing * 2)) - } - imagePath: "widgets/viewitem" - prefix: "hover" - z: -1 + // Not using FrameSvg hover element intentionally for stylistic reasons + Rectangle { + border.width: Kirigami.Units.largeSpacing + border.color: Kirigami.Theme.highlightColor + anchors.fill: parent + anchors.margins: -border.width + radius: border.width + color: "transparent" visible: !thumb.windowHeap.dragActive && (hoverHandler.hovered || (thumb.selected && Window.window.activeFocusItem)) && windowHeap.effectiveOrganized }