aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.config/ags/widget/quicksettings/widgets/DarkMode.ts
blob: 9ec94df1f6f89ae3c2b664ccbbaf7a2a5210e2d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import { SimpleToggleButton } from "../ToggleButton"
import icons from "lib/icons"
import options from "options"

const { scheme } = options.theme

export const DarkModeToggle = () => SimpleToggleButton({
    icon: scheme.bind().as(s => icons.color[s]),
    label: scheme.bind().as(s => s === "dark" ? "Dark" : "Light"),
    toggle: () => scheme.value = scheme.value === "dark" ? "light" : "dark",
    connection: [scheme, () => scheme.value === "dark"],
})