waffles: context menus for app buttons

This commit is contained in:
end-4
2025-12-07 00:04:24 +01:00
parent 13968db31c
commit 6c460b209c
13 changed files with 155 additions and 20 deletions
@@ -200,6 +200,16 @@ RowLayout {
resultPreview.entry.execute();
}
}),
...(isAppEntry ? [
searchResultComp.createObject(null, {
name: startPinned ? Translation.tr("Unpin from Start") : Translation.tr("Pin to Start"),
iconName: startPinned ? "keep_off" : "keep",
iconType: LauncherSearchResult.IconType.Material,
execute: () => {
LauncherApps.togglePin(appId);
}
})
] : []),
...(isAppEntry ? [
searchResultComp.createObject(null, {
name: pinned ? Translation.tr("Unpin from taskbar") : Translation.tr("Pin to taskbar"),
@@ -210,20 +220,6 @@ RowLayout {
}
})
] : []),
...(isAppEntry ? [
searchResultComp.createObject(null, {
name: startPinned ? Translation.tr("Unpin from start") : Translation.tr("Pin to start"),
iconName: startPinned ? "keep_off" : "keep",
iconType: LauncherSearchResult.IconType.Material,
execute: () => {
if (Config.options.launcher.pinnedApps.indexOf(appId) !== -1) {
Config.options.launcher.pinnedApps = Config.options.launcher.pinnedApps.filter(id => id !== appId)
} else {
Config.options.launcher.pinnedApps = Config.options.launcher.pinnedApps.concat([appId])
}
}
})
] : [])
];
result = result.concat(resultPreview.entry.actions);
return result;