mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
Add current time indicator of the current day on the Calendar
This commit is contained in:
parent
ab2200ecc1
commit
e2cd994026
9 changed files with 54 additions and 8 deletions
|
@ -22,6 +22,8 @@ export enum CalendarDateDisplayFormat {
|
|||
export component Calendar inherits Rectangle {
|
||||
in property<[CalendarDay]> days;
|
||||
in property <CalendarDateDisplayFormat> format;
|
||||
in property <Date> current-date;
|
||||
in property <Time> current-time;
|
||||
private property <length> header-height: 64px;
|
||||
private property <length> available-day-space: self.height - header-height;
|
||||
private property <length> day-start-y: header-height;
|
||||
|
@ -83,6 +85,13 @@ export component Calendar inherits Rectangle {
|
|||
y: day-start-y + hour-spacing * hour-index;
|
||||
height: 1px;
|
||||
}
|
||||
if day.date == root.current-date : Rectangle {
|
||||
background: Palette.red;
|
||||
x: 0px;
|
||||
width: parent.width;
|
||||
y: day-start-y + hour-spacing * root.current-time.hour + (root.current-time.minute / 60 * hour-spacing);
|
||||
height: 1px;
|
||||
}
|
||||
for event[event-index] in day.events : Rectangle {
|
||||
background: Palette.card-background;
|
||||
border-radius: 4px;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue