1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-31 08:52:49 -05:00

feat: add ipc handlers for color picker modal (#1554)

* dankcolorpickermodal: add ipc handlers

* add ipc docs for color picker modal
This commit is contained in:
Rin
2026-01-31 14:35:02 +11:00
committed by GitHub
parent a90717b20c
commit 4602442feb
2 changed files with 59 additions and 0 deletions

View File

@@ -533,6 +533,16 @@ File browser controls for selecting wallpapers and profile images.
- `profile` - Opens profile image file browser in Pictures directory
- Both browsers support common image formats (jpg, jpeg, png, bmp, gif, webp)
### Target: `color-picker`
Color picker modal control.
**Functions:**
- `open` - Show color picker modal
- `close` - Hide color picker modal
- `closeInstant` - Hide color picker modal without animation
- `toggle` - Toggle color picker modal visibility
- `toggleInstant` - Toggle color picker modal visibility without animation on hide
### Target: `hypr`
Hyprland-specific controls including keybinds cheatsheet and workspace overview (Hyprland only).
@@ -610,6 +620,9 @@ dms ipc call dankdash wallpaper
dms ipc call file browse wallpaper
dms ipc call file browse profile
# Open color picker
dms ipc call color-picker toggle
# Show Hyprland keybinds cheatsheet (Hyprland only)
dms ipc call hypr toggleBinds
dms ipc call hypr openBinds

View File

@@ -1,6 +1,7 @@
import QtQuick
import Quickshell
import Quickshell.Hyprland
import Quickshell.Io
import qs.Common
import qs.Modals.Common
import qs.Services
@@ -47,6 +48,22 @@ DankModal {
instantClose();
}
function toggle() {
if (shouldBeVisible) {
hide();
} else {
show();
}
}
function toggleInstant() {
if (shouldBeVisible) {
hideInstant();
} else {
show();
}
}
onColorSelected: color => {
if (onColorSelectedCallback) {
onColorSelectedCallback(color);
@@ -124,6 +141,35 @@ DankModal {
onBackgroundClicked: hide()
IpcHandler {
function open(): string {
root.show();
return "COLOR_PICKER_MODAL_OPEN_SUCCESS";
}
function close(): string {
root.hide();
return "COLOR_PICKER_MODAL_CLOSE_SUCCESS";
}
function closeInstant(): string {
root.hideInstant();
return "COLOR_PICKER_MODAL_CLOSE_INSTANT_SUCCESS";
}
function toggle(): string {
root.toggle();
return "COLOR_PICKER_MODAL_TOGGLE_SUCCESS";
}
function toggleInstant(): string {
root.toggleInstant();
return "COLOR_PICKER_MODAL_TOGGLE_INSTANT_SUCCESS";
}
target: "color-picker"
}
content: Component {
FocusScope {
id: colorContent