mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-01 08:53:20 +00:00
72 lines
1.9 KiB
Text
72 lines
1.9 KiB
Text
import { AppModels } from "../../shared/Models.slint";
|
|
import { Button, VerticalBox, CheckBox } from "std-widgets.slint";
|
|
import { MainView } from "views/TasksView.slint";
|
|
import { Palette } from "@selenite";
|
|
import { CalendarView } from "views/CalendarView.slint";
|
|
import { VButton } from "../../../external/selenite/components/Button.slint";
|
|
import { ToggleButton } from "../../../external/selenite/components/index.slint";
|
|
import { VTextInput } from "../../../external/selenite/components/TextInput.slint";
|
|
import { AppActions } from "../../shared/Actions.slint";
|
|
import { SideBar } from "views/SideBar.slint";
|
|
|
|
export component AppWindow inherits Window {
|
|
|
|
title: "Mirai";
|
|
//min-height: 100px;
|
|
//max-height: 4000px; // needed, otherwise the window wants to fit the content (on Swaywm)
|
|
background: Palette.background;
|
|
|
|
private property<bool> show-tasks: false;
|
|
|
|
HorizontalLayout {
|
|
// padding: 16px;
|
|
//spacing: 16px;
|
|
VerticalLayout {
|
|
Rectangle {
|
|
background: Palette.pane;
|
|
// border-radius: 8px;
|
|
//clip: true;
|
|
VerticalLayout {
|
|
VerticalLayout {
|
|
padding: 16px;
|
|
alignment: LayoutAlignment.stretch;
|
|
spacing: 8px;
|
|
ToggleButton {
|
|
text: "Calendar";
|
|
active: !show-tasks;
|
|
clicked => { show-tasks = false }
|
|
}
|
|
|
|
ToggleButton {
|
|
text: "Tasks";
|
|
active: show-tasks;
|
|
clicked => { show-tasks = true }
|
|
}
|
|
}
|
|
SideBar {
|
|
min-width: 256px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
Rectangle {
|
|
width: 1px;
|
|
background: Palette.card-background;
|
|
}
|
|
Rectangle {
|
|
background: Palette.background;
|
|
//border-radius: 8px;
|
|
//clip: true;
|
|
VerticalLayout {
|
|
if show-tasks : MainView {
|
|
horizontal-stretch: 1;
|
|
}
|
|
if !show-tasks : CalendarView {
|
|
horizontal-stretch: 1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
export { AppModels, Palette } // Export to make it visible to the C++ backend
|