forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgallery.slint
More file actions
56 lines (50 loc) · 2.33 KB
/
gallery.slint
File metadata and controls
56 lines (50 loc) · 2.33 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { CheckBox, StandardListView } from "std-widgets.slint";
import { AboutPage, ControlsPage, EasingsPage, ListViewPage, StyledTextPage, TableViewPage, TableViewPageAdapter, TextEditPage } from "ui/pages/pages.slint";
import { GallerySettings } from "ui/gallery_settings.slint";
import { SideBar } from "ui/side_bar.slint";
export { TableViewPageAdapter }
export component App inherits Window {
preferred-width: 700px;
preferred-height: 500px;
title: @tr("Slint Widgets Gallery");
icon: @image-url("../../logo/slint-logo-small-light.png");
MenuBar {
Menu {
title: @tr("MenuBar" => "File");
MenuItem { title: @tr("MenuBar" => "Open"); }
Menu {
title: @tr("MenuBar" => "Open Recent");
for x in 10: MenuItem { title: @tr("MenuBar" => "Recent {}", x+1); }
}
MenuSeparator {}
MenuItem { title: @tr("MenuBar" => "Save"); }
Menu {
title: @tr("MenuBar" => "Save As");
for x in 10: MenuItem { title: @tr("MenuBar" => "Name {}", x+1); }
}
MenuSeparator {}
MenuItem { title: @tr("MenuBar" => "MenuItem with Icon"); icon: @image-url("thumbsup.png"); }
MenuItem { title: @tr("MenuBar" => "MenuItem with Checkmark"); checkable: true; checked: true; }
}
Menu {
title: @tr("MenuBar" => "Edit");
MenuItem { title: @tr("MenuBar" => "Copy"); }
MenuItem { title: @tr("MenuBar" => "Paste"); }
}
}
HorizontalLayout {
side-bar := SideBar {
title: @tr("Slint Widgets Gallery");
model: [@tr("Menu" => "Controls"), @tr("Menu" => "ListView"), @tr("Menu" => "TableView"), @tr("Menu" => "TextEdit"), @tr("Menu" => "Easings"), @tr("Menu" => "StyledText"), @tr("Menu" => "About")];
}
if(side-bar.current-item == 0) : ControlsPage {}
if(side-bar.current-item == 1) : ListViewPage {}
if(side-bar.current-item == 2) : TableViewPage {}
if(side-bar.current-item == 3) : TextEditPage {}
if(side-bar.current-item == 4) : EasingsPage {}
if(side-bar.current-item == 5) : StyledTextPage {}
if(side-bar.current-item == 6) : AboutPage {}
}
}