mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-16 02:32:09 -04:00
feat(Notepad): Add Expand/Collapse IPC handlers
This commit is contained in:
@@ -34,6 +34,9 @@ const DMS_ACTIONS = [
|
||||
{ id: "spawn dms ipc call notepad toggle", label: "Notepad: Toggle" },
|
||||
{ id: "spawn dms ipc call notepad open", label: "Notepad: Open" },
|
||||
{ id: "spawn dms ipc call notepad close", label: "Notepad: Close" },
|
||||
{ id: "spawn dms ipc call notepad expand", label: "Notepad: Expand" },
|
||||
{ id: "spawn dms ipc call notepad collapse", label: "Notepad: Collapse" },
|
||||
{ id: "spawn dms ipc call notepad toggleExpand", label: "Notepad: Toggle Expand" },
|
||||
{ id: "spawn dms ipc call dash toggle \"\"", label: "Dashboard: Toggle" },
|
||||
{ id: "spawn dms ipc call dash open overview", label: "Dashboard: Overview" },
|
||||
{ id: "spawn dms ipc call dash open media", label: "Dashboard: Media" },
|
||||
|
||||
@@ -310,6 +310,37 @@ Item {
|
||||
return "NOTEPAD_TOGGLE_FAILED";
|
||||
}
|
||||
|
||||
function expand(): string {
|
||||
var instance = getActiveNotepadInstance();
|
||||
if (instance) {
|
||||
instance.expandedWidth = true;
|
||||
if (!instance.isVisible)
|
||||
instance.show();
|
||||
return "NOTEPAD_EXPAND_SUCCESS";
|
||||
}
|
||||
return "NOTEPAD_EXPAND_FAILED";
|
||||
}
|
||||
|
||||
function collapse(): string {
|
||||
var instance = getActiveNotepadInstance();
|
||||
if (instance) {
|
||||
instance.expandedWidth = false;
|
||||
if (!instance.isVisible)
|
||||
instance.show();
|
||||
return "NOTEPAD_COLLAPSE_SUCCESS";
|
||||
}
|
||||
return "NOTEPAD_COLLAPSE_FAILED";
|
||||
}
|
||||
|
||||
function toggleExpand(): string {
|
||||
var instance = getActiveNotepadInstance();
|
||||
if (instance) {
|
||||
instance.expandedWidth = !instance.expandedWidth;
|
||||
return "NOTEPAD_TOGGLE_EXPAND_SUCCESS";
|
||||
}
|
||||
return "NOTEPAD_TOGGLE_EXPAND_FAILED";
|
||||
}
|
||||
|
||||
target: "notepad"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user