aboutsummaryrefslogtreecommitdiff
path: root/linux/home/.config/ags/widget/settings/Wallpaper.ts
blob: 998f3b7ee8f1093491086af83be6e9df6ed902e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import wallpaper from "service/wallpaper"

export default () => Widget.Box(
    { class_name: "row wallpaper" },
    Widget.Box(
        { vertical: true },
        Widget.Label({
            xalign: 0,
            class_name: "row-title",
            label: "Wallpaper",
            vpack: "start",
        }),
        Widget.Button({
            on_clicked: wallpaper.random,
            label: "Random",
        }),
        Widget.FileChooserButton({
            on_file_set: ({ uri }) => wallpaper.set(uri!.replace("file://", "")),
        }),
    ),
    Widget.Box({ hexpand: true }),
    Widget.Box({
        class_name: "preview",
        css: wallpaper.bind("wallpaper").as(wp => `
            min-height: 120px;
            min-width: 200px;
            background-image: url('${wp}');
            background-size: cover;
        `),
    }),
)