diff --git a/docs/IPC.md b/docs/IPC.md index 72de8282..b46f3a01 100644 --- a/docs/IPC.md +++ b/docs/IPC.md @@ -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 diff --git a/quickshell/Modals/DankColorPickerModal.qml b/quickshell/Modals/DankColorPickerModal.qml index 2b15bb16..53993b1d 100644 --- a/quickshell/Modals/DankColorPickerModal.qml +++ b/quickshell/Modals/DankColorPickerModal.qml @@ -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