windows: size floating windows from the preferred height when only a placeholder screen is left

ref #3545
This commit is contained in:
bbedward
2026-10-19 12:55:40 -04:00
parent 7bcbc34c57
commit 4155804e57
9 changed files with 16 additions and 10 deletions
+1 -1
View File
@@ -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")
},
@@ -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()
}
+1 -1
View File
@@ -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
@@ -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",
+1 -1
View File
@@ -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: {
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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 {
@@ -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)
}
+6
View File
@@ -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 {