slint/demos/usecases/ui/views/main_view.slint
2025-05-21 10:33:02 +02:00

56 lines
1.5 KiB
Text

// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: MIT
import { TabWidget, HorizontalBox, StyleMetrics, Palette } from "std-widgets.slint";
import { MailView } from "mail_view.slint";
import { HeaderView } from "header_view.slint";
import { DashboardView } from "dashboard_view.slint";
import { UsecasesPalette } from "../widgets.slint";
export global MainViewAdapter {
callback select-language(index: int);
}
export component MainView {
in property <bool> break-layout;
preferred-height: 100%;
preferred-width: 100%;
forward-focus: focus-scope;
focus-scope := FocusScope { }
Rectangle {
background: Palette.background;
VerticalLayout {
HeaderView {
select-language(index) => {
MainViewAdapter.select-language(index)
}
}
HorizontalLayout {
TabWidget {
Tab {
title: @tr("Mail");
HorizontalBox {
MailView {
break-layout: root.break-layout;
}
}
}
Tab {
title: @tr("Dashboard");
HorizontalBox {
DashboardView { }
}
}
}
}
}
}
}