import { Gtk } from "ags/gtk4"; import { TileNetwork } from "./Network"; import { TileBluetooth } from "./Bluetooth"; import { TileDND } from "./DoNotDisturb"; import { TileRecording } from "./Recording"; // import { TileNightLight } from "./NightLight"; import { Pages } from "../pages"; import { createRoot, getScope } from "ags"; 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 createRoot((dispose) => { getScope().onCleanup(() => TilesPages = undefined); return dispose()}> {tileList.map(t => t())} TilesPages = self} /> as Gtk.Box; }); }