[WIP] full views rework

This commit is contained in:
Vyn 2025-06-29 20:07:11 +02:00
parent 9de3972630
commit 15bd0f58a7
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
30 changed files with 812 additions and 1175 deletions

View file

@ -1,10 +1,10 @@
import { ScrollView, Date, Time } from "std-widgets.slint";
import { VCheckBox, VButton, VActionButton, Svg, VTag, VPopupIconMenu, VText, Palette } from "@selenite";
import { Utils } from "../shared/Utils.slint";
import { AppModels, CalendarDay, CalendarDateDisplayFormat } from "../shared/Models.slint";
import { AppModels, CalendarViewDate, CalendarDateDisplayFormat } from "../shared/Models.slint";
export component Calendar inherits Rectangle {
in property<[CalendarDay]> days;
in property<[CalendarViewDate]> days;
in property <CalendarDateDisplayFormat> format;
in property <Date> current-date;
in property <Time> current-time;
@ -17,8 +17,6 @@ export component Calendar inherits Rectangle {
callback delete-event-request(source-id: int, event-id: int);
HorizontalLayout {
Rectangle {
//background: red;
@ -94,20 +92,20 @@ export component Calendar inherits Rectangle {
Rectangle {
width: 100%;
height: 100%;
background: AppModels.get-source-color-from-id-as-color(event.sourceId);
background: AppModels.get-source-color-from-id-as-color(event.source-id);
opacity: 0.05;
}
background: Palette.card-background;
border-radius: 4px;
x: 8px;
width: parent.width - 16px;
y: day-start-y + hour-spacing * event.startsAt.hour;
height: hour-spacing * (event.endsAt.hour - event.startsAt.hour) - 2px;
y: day-start-y + hour-spacing * event.starts_at.hour;
height: hour-spacing * (event.ends_at.hour - event.starts_at.hour) - 2px;
clip: true;
HorizontalLayout {
Rectangle {
width: 4px;
background: AppModels.get-source-color-from-id-as-color(event.sourceId);
background: AppModels.get-source-color-from-id-as-color(event.source-id);
}
VerticalLayout {
padding: 16px;
@ -138,7 +136,7 @@ export component Calendar inherits Rectangle {
icon-size: 1.5rem;
border-radius: 0;
clicked => {
delete-event-request(event.sourceId, event.id);
delete-event-request(event.source-id, event.id);
}
}
}