forked from Blendman974/faceclaw
Add a consolidated single export to each app
This commit is contained in:
1 parent
9b3832d7a7
commit
f38366df6e
23 files changed
+597
-337
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { shell } from "../../ui/shell/shell";
|
||||
import { type AppDefinition } from "../app-definition";
|
||||
import { createLauncherWindow, LAUNCHER_SURFACE_ID, LAUNCHER_WINDOW_ID } from "./launcher-app";
|
||||
|
||||
const launcherApp: AppDefinition = {
|
||||
appId: "launcher",
|
||||
title: "Apps",
|
||||
icon: "layout-grid",
|
||||
// The launcher is the app grid itself, not an entry in it.
|
||||
showInLauncher: false,
|
||||
// Pinned first in the sidebar and the boot foreground; registered at
|
||||
// startup rather than launched.
|
||||
boot: (ctx) => {
|
||||
shell.registerWindow(
|
||||
createLauncherWindow({
|
||||
actions: {
|
||||
...ctx.actions,
|
||||
requestRender: () => shell.foregroundWindow()?.requestRender(),
|
||||
},
|
||||
apps: ctx.apps
|
||||
.filter((app) => app.showInLauncher !== false)
|
||||
.map((app) => ({ appId: app.appId, label: app.title, icon: app.icon })),
|
||||
launchApp: (appId) => ctx.launchApp(appId),
|
||||
submitFrame: (image, paintMs, frameId) => ctx.submitWindowFrame(LAUNCHER_SURFACE_ID, image, paintMs, frameId),
|
||||
setSurfaceVisible: (visible) => ctx.setWindowSurfaceVisible(LAUNCHER_SURFACE_ID, visible),
|
||||
}),
|
||||
);
|
||||
},
|
||||
// The launcher window is pinned and always open; launching means focusing.
|
||||
launch: async (ctx) => {
|
||||
shell.focusWindow(LAUNCHER_WINDOW_ID);
|
||||
ctx.requestShellRender();
|
||||
},
|
||||
};
|
||||
|
||||
export default launcherApp;
|
||||
Reference in new issue
Block a user