mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-31 00:42:50 -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:
13
docs/IPC.md
13
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
|
- `profile` - Opens profile image file browser in Pictures directory
|
||||||
- Both browsers support common image formats (jpg, jpeg, png, bmp, gif, webp)
|
- 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`
|
### Target: `hypr`
|
||||||
Hyprland-specific controls including keybinds cheatsheet and workspace overview (Hyprland only).
|
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 wallpaper
|
||||||
dms ipc call file browse profile
|
dms ipc call file browse profile
|
||||||
|
|
||||||
|
# Open color picker
|
||||||
|
dms ipc call color-picker toggle
|
||||||
|
|
||||||
# Show Hyprland keybinds cheatsheet (Hyprland only)
|
# Show Hyprland keybinds cheatsheet (Hyprland only)
|
||||||
dms ipc call hypr toggleBinds
|
dms ipc call hypr toggleBinds
|
||||||
dms ipc call hypr openBinds
|
dms ipc call hypr openBinds
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
import Quickshell.Io
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Modals.Common
|
import qs.Modals.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
@@ -47,6 +48,22 @@ DankModal {
|
|||||||
instantClose();
|
instantClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
if (shouldBeVisible) {
|
||||||
|
hide();
|
||||||
|
} else {
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleInstant() {
|
||||||
|
if (shouldBeVisible) {
|
||||||
|
hideInstant();
|
||||||
|
} else {
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onColorSelected: color => {
|
onColorSelected: color => {
|
||||||
if (onColorSelectedCallback) {
|
if (onColorSelectedCallback) {
|
||||||
onColorSelectedCallback(color);
|
onColorSelectedCallback(color);
|
||||||
@@ -124,6 +141,35 @@ DankModal {
|
|||||||
|
|
||||||
onBackgroundClicked: hide()
|
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 {
|
content: Component {
|
||||||
FocusScope {
|
FocusScope {
|
||||||
id: colorContent
|
id: colorContent
|
||||||
|
|||||||
Reference in New Issue
Block a user