From 54a7281fa3f4ebb953acef2a7c628e8fa63a90c4 Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 22 Jul 2025 23:00:09 -0400 Subject: [PATCH] fix sizing of dialogs, re-add ipcs --- Modules/ClipboardHistory.qml | 26 +++++++++++++++++++-- Modules/InputDialog.qml | 3 ++- Modules/PowerConfirmDialog.qml | 3 ++- Modules/Settings/SettingsPopup.qml | 3 ++- Modules/SpotlightLauncher.qml | 19 ++-------------- Modules/TopBar/LauncherButton.qml | 4 ++-- Modules/WifiPasswordDialog.qml | 15 ++++++++----- Widgets/DankModal.qml | 29 ++++-------------------- Widgets/SystemLogo.qml | 36 +++++++++++++----------------- 9 files changed, 64 insertions(+), 74 deletions(-) diff --git a/Modules/ClipboardHistory.qml b/Modules/ClipboardHistory.qml index fb723e85..81884eec 100644 --- a/Modules/ClipboardHistory.qml +++ b/Modules/ClipboardHistory.qml @@ -1,5 +1,6 @@ import QtQuick import QtQuick.Controls +import Quickshell import Quickshell.Io import qs.Common import qs.Widgets @@ -113,7 +114,8 @@ DankModal { // DankModal configuration visible: isVisible - size: "large" + width: 600 + height: 500 keyboardFocus: "ondemand" onVisibleChanged: { @@ -312,7 +314,8 @@ DankModal { DankModal { id: clearConfirmDialog visible: showClearConfirmation - size: "small" + width: 350 + height: 180 keyboardFocus: "ondemand" onBackgroundClicked: { @@ -473,4 +476,23 @@ DankModal { id: cleanupProcess running: false } + + IpcHandler { + function open() { + console.log("ClipboardHistory: IPC open() called"); + clipboardHistory.show(); + return "CLIPBOARD_OPEN_SUCCESS"; + } + function close() { + console.log("ClipboardHistory: IPC close() called"); + clipboardHistory.hide(); + return "CLIPBOARD_CLOSE_SUCCESS"; + } + function toggle() { + console.log("ClipboardHistory: IPC toggle() called"); + clipboardHistory.toggle(); + return "CLIPBOARD_TOGGLE_SUCCESS"; + } + target: "clipboard" + } } \ No newline at end of file diff --git a/Modules/InputDialog.qml b/Modules/InputDialog.qml index 5f7bc830..fc733ada 100644 --- a/Modules/InputDialog.qml +++ b/Modules/InputDialog.qml @@ -36,7 +36,8 @@ DankModal { } visible: dialogVisible - size: "medium" + width: 400 + height: 250 keyboardFocus: "exclusive" onVisibleChanged: { diff --git a/Modules/PowerConfirmDialog.qml b/Modules/PowerConfirmDialog.qml index 22cb22e1..0dff356a 100644 --- a/Modules/PowerConfirmDialog.qml +++ b/Modules/PowerConfirmDialog.qml @@ -37,7 +37,8 @@ DankModal { // DankModal configuration visible: powerConfirmVisible - size: "small" + width: 350 + height: 200 keyboardFocus: "ondemand" enableShadow: false onBackgroundClicked: { diff --git a/Modules/Settings/SettingsPopup.qml b/Modules/Settings/SettingsPopup.qml index 79f4e003..df9b8e68 100644 --- a/Modules/Settings/SettingsPopup.qml +++ b/Modules/Settings/SettingsPopup.qml @@ -21,7 +21,8 @@ DankModal { // DankModal configuration visible: settingsVisible - size: "extra-large" + width: 700 + height: 600 keyboardFocus: "ondemand" enableShadow: true diff --git a/Modules/SpotlightLauncher.qml b/Modules/SpotlightLauncher.qml index 565cf60c..8f0d67ed 100644 --- a/Modules/SpotlightLauncher.qml +++ b/Modules/SpotlightLauncher.qml @@ -200,23 +200,8 @@ DankModal { // DankModal configuration visible: spotlightOpen - size: "custom" - customWidth: 600 - customHeight: { - // Fixed height to prevent shrinking - consistent experience - let baseHeight = Theme.spacingXL * 2 + Theme.spacingL * 3; - // Add category section height if visible - if (categories.length > 1 || filteredModel.count > 0) - baseHeight += 36 * 2 + Theme.spacingS + Theme.spacingM; - // Add search field height - baseHeight += 56; - // Add fixed results height for consistent size - let fixedResultsHeight = 400; - // Always same height regardless of content - baseHeight += fixedResultsHeight; - // Ensure reasonable bounds - return Math.min(Math.max(baseHeight, 500), 800); - } + width: 600 + height: 500 keyboardFocus: "exclusive" backgroundColor: Theme.popupBackground() cornerRadius: Theme.cornerRadiusXLarge diff --git a/Modules/TopBar/LauncherButton.qml b/Modules/TopBar/LauncherButton.qml index 1bb020dc..2c1634e5 100644 --- a/Modules/TopBar/LauncherButton.qml +++ b/Modules/TopBar/LauncherButton.qml @@ -18,8 +18,8 @@ Rectangle { SystemLogo { visible: Prefs.useOSLogo anchors.centerIn: parent - width: Theme.iconSize - 6 - height: Theme.iconSize - 6 + width: Theme.iconSize - 3 + height: Theme.iconSize - 3 color: Theme.surfaceText } diff --git a/Modules/WifiPasswordDialog.qml b/Modules/WifiPasswordDialog.qml index 7793fda4..6f005ff7 100644 --- a/Modules/WifiPasswordDialog.qml +++ b/Modules/WifiPasswordDialog.qml @@ -12,7 +12,8 @@ DankModal { property string wifiPasswordInput: "" visible: wifiPasswordDialogVisible - size: "medium" + width: 450 + height: 280 keyboardFocus: "exclusive" onVisibleChanged: { @@ -27,17 +28,20 @@ DankModal { } content: Component { - Column { + Item { anchors.fill: parent - anchors.margins: Theme.spacingL - spacing: Theme.spacingL - + Component.onCompleted: { Qt.callLater(function() { passwordInput.forceActiveFocus(); }); } + Column { + anchors.centerIn: parent + width: parent.width - Theme.spacingL * 2 + spacing: Theme.spacingL + // Header Row { width: parent.width @@ -225,6 +229,7 @@ DankModal { } } } + } } } diff --git a/Widgets/DankModal.qml b/Widgets/DankModal.qml index 2309a71f..06afeece 100644 --- a/Widgets/DankModal.qml +++ b/Widgets/DankModal.qml @@ -12,9 +12,8 @@ PanelWindow { property alias content: contentLoader.sourceComponent // Sizing - property string size: "medium" // "small", "medium", "large", "extra-large", "auto", "custom" - property real customWidth: 400 - property real customHeight: 300 + property real width: 400 + property real height: 300 // Background behavior property bool showBackground: true @@ -46,26 +45,6 @@ PanelWindow { signal dialogClosed() signal backgroundClicked() - // Internal properties - readonly property var sizePresets: ({ - "small": { width: 350, height: 200 }, - "medium": { width: 500, height: 400 }, - "large": { width: 600, height: 500 }, - "extra-large": { width: 700, height: 600 }, - "fit-content": { width: 600, height: 500 } - }) - - readonly property real contentWidth: { - if (size === "custom") return customWidth - if (size === "auto") return Math.min(contentLoader.item ? contentLoader.item.implicitWidth || 400 : 400, parent.width - Theme.spacingL * 2) - return sizePresets[size] ? sizePresets[size].width : sizePresets["medium"].width - } - - readonly property real contentHeight: { - if (size === "custom") return customHeight - if (size === "auto") return Math.min(contentLoader.item ? contentLoader.item.implicitHeight || 300 : 300, parent.height - Theme.spacingL * 2) - return sizePresets[size] ? sizePresets[size].height : sizePresets["medium"].height - } // PanelWindow configuration // visible property is inherited from PanelWindow @@ -128,8 +107,8 @@ PanelWindow { Rectangle { id: contentContainer - width: root.contentWidth - height: root.contentHeight + width: root.width + height: root.height // Positioning anchors.centerIn: positioning === "center" ? parent : undefined diff --git a/Widgets/SystemLogo.qml b/Widgets/SystemLogo.qml index 7beb36ae..0d7e6471 100644 --- a/Widgets/SystemLogo.qml +++ b/Widgets/SystemLogo.qml @@ -5,29 +5,25 @@ import Quickshell.Io import Quickshell.Widgets import qs.Common -Item { +IconImage { id: root - + property color color: Theme.surfaceText - IconImage { - id: iconImage - anchors.fill: parent - smooth: true - asynchronous: true - layer.enabled: true - layer.effect: MultiEffect { - colorization: 1 - colorizationColor: root.color - brightness: 0.5 - } - Process { - running: true - command: ["sh", "-c", ". /etc/os-release && echo $LOGO"] - stdout: StdioCollector { - onStreamFinished: () => { - iconImage.source = Quickshell.iconPath(this.text.trim()); - } + smooth: true + asynchronous: true + layer.enabled: true + layer.effect: MultiEffect { + colorization: 1 + colorizationColor: root.color + brightness: 0.5 + } + Process { + running: true + command: ["sh", "-c", ". /etc/os-release && echo $LOGO"] + stdout: StdioCollector { + onStreamFinished: () => { + root.source = Quickshell.iconPath(this.text.trim()); } } }