Files
colorshell/ags/widget/control-center/Tiles.tsx
T
retrozinndev 22a17e14db 💥 fix(control-center/page, control-center/pages): scope errors
i basically restructured the page widget lol
2025-07-30 17:56:01 -03:00

33 lines
1.0 KiB
TypeScript

import { Gtk } from "ags/gtk4";
import { TileNetwork } from "./tiles/Network";
import { TileBluetooth } from "./tiles/Bluetooth";
import { TileDND } from "./tiles/DoNotDisturb";
import { TileRecording } from "./tiles/Recording";
import { TileNightLight } from "./tiles/NightLight";
import { Pages } from "./Pages";
export let TilesPages: Pages|undefined;
export const tileList: Array<() => JSX.Element|Gtk.Widget> = [
TileNetwork,
TileBluetooth,
TileRecording,
TileDND,
TileNightLight
] as Array<() => Gtk.Widget>;
export function Tiles(): Gtk.Widget {
return <Gtk.Box class={"tiles-container"} orientation={Gtk.Orientation.VERTICAL}
onUnmap={() => TilesPages = undefined}>
<Gtk.FlowBox orientation={Gtk.Orientation.HORIZONTAL} rowSpacing={6}
columnSpacing={6} minChildrenPerLine={2} activateOnSingleClick
maxChildrenPerLine={2} hexpand homogeneous>
{tileList.map(t => t())}
</Gtk.FlowBox>
<Pages class={"tile-pages"} $={(self) => TilesPages = self} />
</Gtk.Box> as Gtk.Box;
}