1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-08 12:13:31 -04:00

feat(Clipboard): Implement clipboard/settings search functionality in DMS Launcher

This commit is contained in:
purian23
2026-05-16 17:43:52 -04:00
parent 9f2ae6241e
commit c923c43322
11 changed files with 426 additions and 17 deletions
@@ -32,6 +32,8 @@ Popup {
var actions = instance.getContextMenuActions(spotlightItem.data);
return Array.isArray(actions) && actions.length > 0;
}
if (spotlightItem.actions && spotlightItem.actions.length > 0)
return true;
return false;
}
@@ -80,6 +82,13 @@ Popup {
hide();
}
function executeLauncherAction(actionData) {
if (!controller || !item || !actionData)
return;
controller.executeAction(item, actionData);
hide();
}
readonly property var menuItems: {
var items = [];
@@ -97,6 +106,19 @@ Popup {
return items;
}
if (item?.type !== "app" && item?.actions && item.actions.length > 0) {
for (var i = 0; i < item.actions.length; i++) {
var genericAct = item.actions[i];
items.push({
type: "item",
icon: genericAct.icon || "play_arrow",
text: genericAct.name || "",
launcherActionData: genericAct
});
}
return items;
}
if (item?.type === "app") {
items.push({
type: "item",
@@ -293,6 +315,8 @@ Popup {
menuItem.action();
else if (menuItem.pluginAction)
executePluginAction(menuItem.pluginAction);
else if (menuItem.launcherActionData)
executeLauncherAction(menuItem.launcherActionData);
else if (menuItem.actionData)
executeDesktopAction(menuItem.actionData);
return;
@@ -500,6 +524,8 @@ Popup {
menuItem.action();
else if (menuItem.pluginAction)
root.executePluginAction(menuItem.pluginAction);
else if (menuItem.launcherActionData)
root.executeLauncherAction(menuItem.launcherActionData);
else if (menuItem.actionData)
root.executeDesktopAction(menuItem.actionData);
}