feat: add command center launcher

This commit is contained in:
tux
2025-09-25 19:31:12 +05:30
parent 056afad5ac
commit 978f15c305
4 changed files with 25 additions and 7 deletions

View File

@@ -1,15 +1,23 @@
import { Gdk } from "ags/gtk4";
import app from "ags/gtk4/app";
import { WINDOW_NAME } from "../launcher";
import { WINDOW_NAME as APP_LAUNCHER_WINDOW_NAME } from "../launcher";
import { WINDOW_NAME as CONTROL_CENTER_WINDOW_NAME } from "../control-center";
export const Launcher = () => {
type Props = {
icon: string;
windowName:
| typeof APP_LAUNCHER_WINDOW_NAME
| typeof CONTROL_CENTER_WINDOW_NAME;
};
export const Launcher = ({ icon, windowName }: Props) => {
return (
<button
cssClasses={["pill", "launcher"]}
onClicked={() => app.toggle_window(WINDOW_NAME)}
cssClasses={["launcher"]}
onClicked={() => app.toggle_window(windowName)}
cursor={Gdk.Cursor.new_from_name("pointer", null)}
>
<image iconName="nix-symbolic" />
<image iconName={icon} />
</button>
);
};