mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-31 17:02:51 -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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user