1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 05:55:37 -05:00

fix sizing of dialogs, re-add ipcs

This commit is contained in:
bbedward
2025-07-22 23:00:09 -04:00
parent 7232d66b5d
commit 54a7281fa3
9 changed files with 64 additions and 74 deletions

View File

@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Common import qs.Common
import qs.Widgets import qs.Widgets
@@ -113,7 +114,8 @@ DankModal {
// DankModal configuration // DankModal configuration
visible: isVisible visible: isVisible
size: "large" width: 600
height: 500
keyboardFocus: "ondemand" keyboardFocus: "ondemand"
onVisibleChanged: { onVisibleChanged: {
@@ -312,7 +314,8 @@ DankModal {
DankModal { DankModal {
id: clearConfirmDialog id: clearConfirmDialog
visible: showClearConfirmation visible: showClearConfirmation
size: "small" width: 350
height: 180
keyboardFocus: "ondemand" keyboardFocus: "ondemand"
onBackgroundClicked: { onBackgroundClicked: {
@@ -473,4 +476,23 @@ DankModal {
id: cleanupProcess id: cleanupProcess
running: false 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"
}
} }

View File

@@ -36,7 +36,8 @@ DankModal {
} }
visible: dialogVisible visible: dialogVisible
size: "medium" width: 400
height: 250
keyboardFocus: "exclusive" keyboardFocus: "exclusive"
onVisibleChanged: { onVisibleChanged: {

View File

@@ -37,7 +37,8 @@ DankModal {
// DankModal configuration // DankModal configuration
visible: powerConfirmVisible visible: powerConfirmVisible
size: "small" width: 350
height: 200
keyboardFocus: "ondemand" keyboardFocus: "ondemand"
enableShadow: false enableShadow: false
onBackgroundClicked: { onBackgroundClicked: {

View File

@@ -21,7 +21,8 @@ DankModal {
// DankModal configuration // DankModal configuration
visible: settingsVisible visible: settingsVisible
size: "extra-large" width: 700
height: 600
keyboardFocus: "ondemand" keyboardFocus: "ondemand"
enableShadow: true enableShadow: true

View File

@@ -200,23 +200,8 @@ DankModal {
// DankModal configuration // DankModal configuration
visible: spotlightOpen visible: spotlightOpen
size: "custom" width: 600
customWidth: 600 height: 500
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);
}
keyboardFocus: "exclusive" keyboardFocus: "exclusive"
backgroundColor: Theme.popupBackground() backgroundColor: Theme.popupBackground()
cornerRadius: Theme.cornerRadiusXLarge cornerRadius: Theme.cornerRadiusXLarge

View File

@@ -18,8 +18,8 @@ Rectangle {
SystemLogo { SystemLogo {
visible: Prefs.useOSLogo visible: Prefs.useOSLogo
anchors.centerIn: parent anchors.centerIn: parent
width: Theme.iconSize - 6 width: Theme.iconSize - 3
height: Theme.iconSize - 6 height: Theme.iconSize - 3
color: Theme.surfaceText color: Theme.surfaceText
} }

View File

@@ -12,7 +12,8 @@ DankModal {
property string wifiPasswordInput: "" property string wifiPasswordInput: ""
visible: wifiPasswordDialogVisible visible: wifiPasswordDialogVisible
size: "medium" width: 450
height: 280
keyboardFocus: "exclusive" keyboardFocus: "exclusive"
onVisibleChanged: { onVisibleChanged: {
@@ -27,10 +28,8 @@ DankModal {
} }
content: Component { content: Component {
Column { Item {
anchors.fill: parent anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingL
Component.onCompleted: { Component.onCompleted: {
Qt.callLater(function() { Qt.callLater(function() {
@@ -38,6 +37,11 @@ DankModal {
}); });
} }
Column {
anchors.centerIn: parent
width: parent.width - Theme.spacingL * 2
spacing: Theme.spacingL
// Header // Header
Row { Row {
width: parent.width width: parent.width
@@ -227,6 +231,7 @@ DankModal {
} }
} }
} }
}
// Auto-reopen dialog on invalid password // Auto-reopen dialog on invalid password
Connections { Connections {

View File

@@ -12,9 +12,8 @@ PanelWindow {
property alias content: contentLoader.sourceComponent property alias content: contentLoader.sourceComponent
// Sizing // Sizing
property string size: "medium" // "small", "medium", "large", "extra-large", "auto", "custom" property real width: 400
property real customWidth: 400 property real height: 300
property real customHeight: 300
// Background behavior // Background behavior
property bool showBackground: true property bool showBackground: true
@@ -46,26 +45,6 @@ PanelWindow {
signal dialogClosed() signal dialogClosed()
signal backgroundClicked() 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 // PanelWindow configuration
// visible property is inherited from PanelWindow // visible property is inherited from PanelWindow
@@ -128,8 +107,8 @@ PanelWindow {
Rectangle { Rectangle {
id: contentContainer id: contentContainer
width: root.contentWidth width: root.width
height: root.contentHeight height: root.height
// Positioning // Positioning
anchors.centerIn: positioning === "center" ? parent : undefined anchors.centerIn: positioning === "center" ? parent : undefined

View File

@@ -5,14 +5,11 @@ import Quickshell.Io
import Quickshell.Widgets import Quickshell.Widgets
import qs.Common import qs.Common
Item { IconImage {
id: root id: root
property color color: Theme.surfaceText property color color: Theme.surfaceText
IconImage {
id: iconImage
anchors.fill: parent
smooth: true smooth: true
asynchronous: true asynchronous: true
layer.enabled: true layer.enabled: true
@@ -26,8 +23,7 @@ Item {
command: ["sh", "-c", ". /etc/os-release && echo $LOGO"] command: ["sh", "-c", ". /etc/os-release && echo $LOGO"]
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: () => { onStreamFinished: () => {
iconImage.source = Quickshell.iconPath(this.text.trim()); root.source = Quickshell.iconPath(this.text.trim());
}
} }
} }
} }