From 5362105f276d62aff420bbc36615b75f999a21a7 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 11 Apr 2024 14:49:33 +0100 Subject: [PATCH] plugins/desktopchangeosd: Port to simpler PlasmaWindow Plasma::Dialog contains logic that we don't want for a kwin window and is considered deprecated. Dialog uses the width of the main item which results in an unavoidable binding loop. PlasmaWindow allows us to propagate implicit sizes upwards correctly. BUG: 420757 --- .../desktopchangeosd/package/contents/ui/osd.qml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/plugins/desktopchangeosd/package/contents/ui/osd.qml b/src/plugins/desktopchangeosd/package/contents/ui/osd.qml index e8428ccb41..c758189fdf 100644 --- a/src/plugins/desktopchangeosd/package/contents/ui/osd.qml +++ b/src/plugins/desktopchangeosd/package/contents/ui/osd.qml @@ -13,12 +13,13 @@ import org.kde.kirigami 2.20 as Kirigami import org.kde.ksvg 1.0 as KSvg import org.kde.kwin -PlasmaCore.Dialog { +PlasmaCore.Window { id: dialog - location: PlasmaCore.Types.Floating visible: false flags: Qt.X11BypassWindowManagerHint | Qt.FramelessWindowHint - outputOnly: true + + width: mainItem.implicitWidth + leftPadding + rightPadding + height: mainItem.implicitHeight + topPadding + bottomPadding mainItem: Item { function loadConfig() { @@ -38,8 +39,8 @@ PlasmaCore.Dialog { property int animationDuration: 1000 property bool showGrid: true - width: dialogItem.showGrid ? view.itemWidth * view.columns : Math.ceil(textElement.implicitWidth) - height: dialogItem.showGrid ? view.itemHeight * view.rows + textElement.height : textElement.height + implicitWidth: dialogItem.showGrid ? view.itemWidth * view.columns : Math.ceil(textElement.implicitWidth) + implicitHeight: dialogItem.showGrid ? view.itemHeight * view.rows + textElement.implicitHeight : textElement.implicitHeight Kirigami.Heading { id: textElement