2025-06-24 12:04:54 +02:00
|
|
|
import { AppModels } from "../../shared/Models.slint";
|
2024-11-04 14:45:27 +01:00
|
|
|
import { Button, VerticalBox, CheckBox } from "std-widgets.slint";
|
|
|
|
import { MainView } from "views/TasksView.slint";
|
|
|
|
import { Palette } from "@selenite";
|
2025-06-17 17:03:07 +02:00
|
|
|
import { CalendarView } from "views/CalendarView.slint";
|
|
|
|
import { VButton } from "../../../external/selenite/components/Button.slint";
|
2025-06-21 10:41:47 +02:00
|
|
|
import { ToggleButton } from "../../../external/selenite/components/index.slint";
|
2025-06-24 08:35:38 +02:00
|
|
|
import { VTextInput } from "../../../external/selenite/components/TextInput.slint";
|
2025-06-24 12:04:54 +02:00
|
|
|
import { AppActions } from "../../shared/Actions.slint";
|
2025-06-24 09:31:34 +02:00
|
|
|
import { SideBar } from "views/SideBar.slint";
|
|
|
|
|
2024-11-04 14:45:27 +01:00
|
|
|
export component AppWindow inherits Window {
|
|
|
|
|
|
|
|
title: "Mirai";
|
2025-06-18 13:54:33 +02:00
|
|
|
//min-height: 100px;
|
|
|
|
//max-height: 4000px; // needed, otherwise the window wants to fit the content (on Swaywm)
|
2025-06-21 10:41:47 +02:00
|
|
|
background: Palette.background;
|
2025-06-17 17:03:07 +02:00
|
|
|
|
|
|
|
private property<bool> show-tasks: false;
|
2024-11-04 14:45:27 +01:00
|
|
|
|
|
|
|
HorizontalLayout {
|
2025-06-21 10:41:47 +02:00
|
|
|
// padding: 16px;
|
|
|
|
//spacing: 16px;
|
2025-06-17 17:03:07 +02:00
|
|
|
VerticalLayout {
|
2025-06-21 10:41:47 +02:00
|
|
|
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 }
|
|
|
|
}
|
2025-06-17 17:03:07 +02:00
|
|
|
|
2025-06-21 10:41:47 +02:00
|
|
|
ToggleButton {
|
|
|
|
text: "Tasks";
|
|
|
|
active: show-tasks;
|
|
|
|
clicked => { show-tasks = true }
|
|
|
|
}
|
2025-06-24 09:31:34 +02:00
|
|
|
}
|
2025-06-21 10:41:47 +02:00
|
|
|
SideBar {
|
|
|
|
min-width: 256px;
|
|
|
|
}
|
|
|
|
}
|
2025-06-18 18:31:05 +02:00
|
|
|
}
|
2025-06-17 17:03:07 +02:00
|
|
|
}
|
2025-06-21 10:41:47 +02:00
|
|
|
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;
|
|
|
|
}
|
2025-06-17 17:03:07 +02:00
|
|
|
}
|
2025-06-21 10:41:47 +02:00
|
|
|
}
|
2024-11-04 14:45:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-06-24 12:04:54 +02:00
|
|
|
export { AppModels, Palette } // Export to make it visible to the C++ backend
|