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:
@@ -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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,8 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
visible: dialogVisible
|
visible: dialogVisible
|
||||||
size: "medium"
|
width: 400
|
||||||
|
height: 250
|
||||||
keyboardFocus: "exclusive"
|
keyboardFocus: "exclusive"
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -225,6 +229,7 @@ DankModal {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -5,29 +5,25 @@ 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 {
|
smooth: true
|
||||||
id: iconImage
|
asynchronous: true
|
||||||
anchors.fill: parent
|
layer.enabled: true
|
||||||
smooth: true
|
layer.effect: MultiEffect {
|
||||||
asynchronous: true
|
colorization: 1
|
||||||
layer.enabled: true
|
colorizationColor: root.color
|
||||||
layer.effect: MultiEffect {
|
brightness: 0.5
|
||||||
colorization: 1
|
}
|
||||||
colorizationColor: root.color
|
Process {
|
||||||
brightness: 0.5
|
running: true
|
||||||
}
|
command: ["sh", "-c", ". /etc/os-release && echo $LOGO"]
|
||||||
Process {
|
stdout: StdioCollector {
|
||||||
running: true
|
onStreamFinished: () => {
|
||||||
command: ["sh", "-c", ". /etc/os-release && echo $LOGO"]
|
root.source = Quickshell.iconPath(this.text.trim());
|
||||||
stdout: StdioCollector {
|
|
||||||
onStreamFinished: () => {
|
|
||||||
iconImage.source = Quickshell.iconPath(this.text.trim());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user