1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-03 20:32:07 -04: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

@@ -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,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());
}
}
}