1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-06 21:45:38 -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.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"
}
}

View File

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

View File

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

View File

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

View File

@@ -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

View File

@@ -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
}

View File

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

View File

@@ -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

View File

@@ -5,14 +5,11 @@ 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
@@ -26,8 +23,7 @@ Item {
command: ["sh", "-c", ". /etc/os-release && echo $LOGO"]
stdout: StdioCollector {
onStreamFinished: () => {
iconImage.source = Quickshell.iconPath(this.text.trim());
}
root.source = Quickshell.iconPath(this.text.trim());
}
}
}