From 4155804e5727f73323877fd72e0542f53ea7deb2 Mon Sep 17 00:00:00 2001 From: bbedward Date: Mon, 19 Oct 2026 12:55:29 -0400 Subject: [PATCH] windows: size floating windows from the preferred height when only a placeholder screen is left ref #3545 --- quickshell/Common/SettingsTabs.qml | 2 +- quickshell/Modals/Changelog/ChangelogModal.qml | 6 +++--- quickshell/Modals/Greeter/GreeterModal.qml | 2 +- quickshell/Modals/Greeter/GreeterWelcomePage.qml | 2 +- quickshell/Modals/KeybindsModalWindow.qml | 2 +- quickshell/Modals/Settings/SettingsModal.qml | 2 +- quickshell/Modals/SystemUpdateModal.qml | 2 +- quickshell/Modules/Settings/SoftwareUpdatesTab.qml | 2 +- quickshell/Widgets/DFloatingWindow.qml | 6 ++++++ 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/quickshell/Common/SettingsTabs.qml b/quickshell/Common/SettingsTabs.qml index d5ee10dff..4dd0ff516 100644 --- a/quickshell/Common/SettingsTabs.qml +++ b/quickshell/Common/SettingsTabs.qml @@ -571,7 +571,7 @@ Singleton { "id": "updater_changelog", "hidden": true, "text": I18n.tr("Release notes", "settings page and card title, notes for a DMS release"), - "icon": "auto_awesome", + "icon": "article", "tabIndex": 66, "hint": I18n.tr("Summary, highlights, links", "settings sidebar hint for the release notes page") }, diff --git a/quickshell/Modals/Changelog/ChangelogModal.qml b/quickshell/Modals/Changelog/ChangelogModal.qml index de028c137..892a51efd 100644 --- a/quickshell/Modals/Changelog/ChangelogModal.qml +++ b/quickshell/Modals/Changelog/ChangelogModal.qml @@ -8,7 +8,7 @@ DFloatingWindow { id: root readonly property int modalWidth: 720 - readonly property int modalHeight: screen ? Math.min(800, screen.height - 80) : 800 + readonly property int modalHeight: heightWithin(800, 80) signal changelogDismissed @@ -88,7 +88,7 @@ DFloatingWindow { id: notesButton anchors.verticalCenter: parent.verticalCenter text: I18n.tr("Release notes", "settings page and card title, notes for a DMS release") - iconName: "auto_awesome" + iconName: "article" buttonHeight: Theme.buttonHeightM backgroundColor: Theme.secondaryContainer textColor: Theme.onSecondaryContainer @@ -109,7 +109,7 @@ DFloatingWindow { DFab { anchors.verticalCenter: parent.verticalCenter text: "Let's go" - iconName: "rocket_launch" + iconName: "check" colorRole: "primary" onClicked: root.dismiss() } diff --git a/quickshell/Modals/Greeter/GreeterModal.qml b/quickshell/Modals/Greeter/GreeterModal.qml index 63aba4398..5cf3ee4af 100644 --- a/quickshell/Modals/Greeter/GreeterModal.qml +++ b/quickshell/Modals/Greeter/GreeterModal.qml @@ -17,7 +17,7 @@ DFloatingWindow { property bool cheatsheetLoaded: false readonly property int modalWidth: 720 - readonly property int modalHeight: screen ? Math.min(760, screen.height - 80) : 760 + readonly property int modalHeight: heightWithin(760, 80) signal greeterCompleted diff --git a/quickshell/Modals/Greeter/GreeterWelcomePage.qml b/quickshell/Modals/Greeter/GreeterWelcomePage.qml index e46d45e07..3110f9f1d 100644 --- a/quickshell/Modals/Greeter/GreeterWelcomePage.qml +++ b/quickshell/Modals/Greeter/GreeterWelcomePage.qml @@ -14,7 +14,7 @@ Item { readonly property real cardWidth: (content.width - Theme.spacingS * (columns - 1)) / columns readonly property var features: [ { - "icon": "auto_awesome", + "icon": "palette", "shape": "softBurst", "hoverShape": "flower", "accent": "purple", diff --git a/quickshell/Modals/KeybindsModalWindow.qml b/quickshell/Modals/KeybindsModalWindow.qml index 45112bc7a..401604b85 100644 --- a/quickshell/Modals/KeybindsModalWindow.qml +++ b/quickshell/Modals/KeybindsModalWindow.qml @@ -28,7 +28,7 @@ DFloatingWindow { title: I18n.tr("Keybinds") minimumSize: Qt.size(Math.min(560, Screen.width), Math.min(400, Screen.height)) implicitWidth: 1000 - implicitHeight: screen ? Math.min(820, screen.height - 100) : 820 + implicitHeight: heightWithin(820, 100) visible: false onVisibleChanged: { diff --git a/quickshell/Modals/Settings/SettingsModal.qml b/quickshell/Modals/Settings/SettingsModal.qml index 12ca6f96c..557d76d97 100644 --- a/quickshell/Modals/Settings/SettingsModal.qml +++ b/quickshell/Modals/Settings/SettingsModal.qml @@ -173,7 +173,7 @@ DFloatingWindow { title: I18n.tr("Settings", "settings window title") minimumSize: Qt.size(SettingsMetrics.windowMinWidth, SettingsMetrics.windowMinHeight) implicitWidth: SettingsMetrics.windowWidth - implicitHeight: screen ? Math.min(SettingsMetrics.windowHeight, screen.height - SettingsMetrics.pagePaddingH * 2 - Theme.spacingL) : SettingsMetrics.windowHeight + implicitHeight: heightWithin(SettingsMetrics.windowHeight, SettingsMetrics.pagePaddingH * 2 + Theme.spacingL) visible: false onClosed: hide() diff --git a/quickshell/Modals/SystemUpdateModal.qml b/quickshell/Modals/SystemUpdateModal.qml index a0a736a17..9eb97b4a4 100644 --- a/quickshell/Modals/SystemUpdateModal.qml +++ b/quickshell/Modals/SystemUpdateModal.qml @@ -22,7 +22,7 @@ DFloatingWindow { minimumSize: Qt.size(SettingsMetrics.windowMinWidth, SettingsMetrics.windowMinHeight) implicitWidth: SettingsMetrics.formDialogWidth + SettingsMetrics.pagePaddingH * 2 readonly property real defaultHeight: SettingsMetrics.windowHeight - SettingsMetrics.pagePaddingV * 4 - implicitHeight: screen ? Math.min(defaultHeight, screen.height - SettingsMetrics.pagePaddingH * 2 - Theme.spacingL) : defaultHeight + implicitHeight: heightWithin(defaultHeight, SettingsMetrics.pagePaddingH * 2 + Theme.spacingL) visible: false Ref { diff --git a/quickshell/Modules/Settings/SoftwareUpdatesTab.qml b/quickshell/Modules/Settings/SoftwareUpdatesTab.qml index d276e5b28..ff52f1feb 100644 --- a/quickshell/Modules/Settings/SoftwareUpdatesTab.qml +++ b/quickshell/Modules/Settings/SoftwareUpdatesTab.qml @@ -386,7 +386,7 @@ Item { SettingsNavRow { visible: root.notesRelease !== null title: I18n.tr("Release notes", "settings page and card title, notes for a DMS release") - iconName: "auto_awesome" + iconName: "article" hint: root.notesRelease?.codename ? "v" + root.notesRelease.version + " ยท " + root.notesRelease.codename : "v" + (root.notesRelease?.version ?? "") onClicked: keyboard => root.parentModal?.navigateTo("updater_changelog", keyboard) } diff --git a/quickshell/Widgets/DFloatingWindow.qml b/quickshell/Widgets/DFloatingWindow.qml index b0307258f..1988ed6c8 100644 --- a/quickshell/Widgets/DFloatingWindow.qml +++ b/quickshell/Widgets/DFloatingWindow.qml @@ -14,6 +14,12 @@ FloatingWindow { property color surfaceColor: Theme.floatingWindowSurface property bool contentVisible: true + // A placeholder screen (no outputs left) is 0x0; a size derived from it is a zero geometry and the compositor drops the connection. + function heightWithin(preferred, inset) { + const available = (root.screen?.height ?? 0) - inset; + return available > 0 ? Math.min(preferred, available) : preferred; + } + color: "transparent" Rectangle {