1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: MIT
3
4import { CheckBox, StandardListView } from "std-widgets.slint";
5import { AboutPage, ControlsPage, EasingsPage, ListViewPage, TableViewPage, TableViewPageAdapter, TextEditPage } from "ui/pages/pages.slint";
6import { GallerySettings } from "ui/gallery_settings.slint";
7import { SideBar } from "ui/side_bar.slint";
8
9export { TableViewPageAdapter }
10
11export component App inherits Window {
12 preferred-width: 700px;
13 preferred-height: 500px;
14 title: @tr("Slint Widgets Gallery");
15 icon: @image-url("../../logo/slint-logo-small-light.png");
16
17 MenuBar {
18 Menu {
19 title: @tr("MenuBar" => "File");
20 MenuItem { title: @tr("MenuBar" => "Open"); }
21 Menu {
22 title: @tr("MenuBar" => "Open Recent");
23 for x in 10: MenuItem { title: @tr("MenuBar" => "Recent {}", x+1); }
24 }
25 MenuSeparator {}
26 MenuItem { title: @tr("MenuBar" => "Save"); }
27 Menu {
28 title: @tr("MenuBar" => "Save As");
29 for x in 10: MenuItem { title: @tr("MenuBar" => "Name {}", x+1); }
30 }
31 }
32 Menu {
33 title: @tr("MenuBar" => "Edit");
34 MenuItem { title: @tr("MenuBar" => "Copy"); }
35 MenuItem { title: @tr("MenuBar" => "Paste"); }
36 }
37 }
38
39 HorizontalLayout {
40 side-bar := SideBar {
41 title: @tr("Slint Widgets Gallery");
42 model: [@tr("Menu" => "Controls"), @tr("Menu" => "ListView"), @tr("Menu" => "TableView"), @tr("Menu" => "TextEdit"), @tr("Menu" => "Easings"), @tr("Menu" => "About")];
43 }
44
45 if(side-bar.current-item == 0) : ControlsPage {}
46 if(side-bar.current-item == 1) : ListViewPage {}
47 if(side-bar.current-item == 2) : TableViewPage {}
48 if(side-bar.current-item == 3) : TextEditPage {}
49 if(side-bar.current-item == 4) : EasingsPage {}
50 if(side-bar.current-item == 5) : AboutPage {}
51 }
52}
53