-
Notifications
You must be signed in to change notification settings - Fork 543
/
page.slint
40 lines (32 loc) · 1.1 KB
/
page.slint
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
32
33
34
35
36
37
38
39
40
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { Switch, GridBox, ListView, ScrollView, HorizontalBox, VerticalBox, Palette } from "std-widgets.slint";
import { GallerySettings } from "../gallery_settings.slint";
export component Page inherits VerticalBox {
in property<string> title: "title";
in property<string> description: "description";
in property<bool> show-enable-switch: true;
HorizontalBox {
Text {
font-size: 20px;
text <=> root.title;
}
// Spacer
Rectangle {}
if show-enable-switch: Switch {
horizontal-stretch: 0;
text: @tr("Widgets enabled");
checked <=> GallerySettings.widgets-enabled;
enabled: true;
}
Switch {
horizontal-stretch: 0;
text: @tr("Dark Mode");
checked: Palette.color-scheme == ColorScheme.dark;
toggled => {
Palette.color-scheme = self.checked ? ColorScheme.dark : ColorScheme.light;
}
}
}
@children
}