mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
Move Calendar to its own view
This commit is contained in:
parent
a03e71890c
commit
d26f2f5a9f
19 changed files with 407 additions and 137 deletions
|
@ -6,21 +6,46 @@ import { SettingsWindow } from "../SettingsWindow/SettingsWindow.slint";
|
|||
import { AddSourceWindow } from "../AddSourceWindow//AddSourceWindow.slint";
|
||||
import { EditSourceWindow } from "../EditSourceWindow/EditSourceWindow.slint";
|
||||
import { Palette } from "@selenite";
|
||||
import { CalendarView } from "views/CalendarView.slint";
|
||||
import { VButton } from "../../../external/selenite/components/Button.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)
|
||||
default-font-size: 16px;
|
||||
background: Palette.pane;
|
||||
|
||||
private property<bool> show-tasks: false;
|
||||
|
||||
HorizontalLayout {
|
||||
SideBar {}
|
||||
MainView {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
VerticalLayout {
|
||||
HorizontalLayout {
|
||||
padding: 16px;
|
||||
alignment: LayoutAlignment.stretch;
|
||||
spacing: 8px;
|
||||
VButton {
|
||||
text: "Calendar";
|
||||
clicked => { show-tasks = false }
|
||||
}
|
||||
|
||||
VButton {
|
||||
text: "Tasks";
|
||||
clicked => { show-tasks = true }
|
||||
}
|
||||
}
|
||||
SideBar {}
|
||||
}
|
||||
VerticalLayout {
|
||||
|
||||
if show-tasks : MainView {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
if !show-tasks : CalendarView {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export { AppWindowModels, Palette, SettingsWindow, AddSourceWindow, EditSourceWindow } // Export to make it visible to the C++ backend
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue