mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 10:13:42 +00:00
Remove PNG images, replace them with SVGs
This commit is contained in:
parent
e28ba796cd
commit
f45aa601c7
23 changed files with 84 additions and 308 deletions
91
ui/components/EventGroup.slint
Normal file
91
ui/components/EventGroup.slint
Normal file
|
@ -0,0 +1,91 @@
|
|||
import { Backend, TaskData, Event } from "../Backend.slint";
|
||||
import { ScrollView } from "std-widgets.slint";
|
||||
import { VCheckBox, VButton, VActionButton, Svg, VTag, VPopupIconMenu, VText, Palette } from "@vynui";
|
||||
import { TaskLine } from "./TaskLine.slint";
|
||||
import { Utils } from "../Utils.slint";
|
||||
|
||||
export component EventGroup {
|
||||
in property<Event> event;
|
||||
|
||||
eventPopup := VPopupIconMenu {
|
||||
VActionButton {
|
||||
icon-svg: Svg.plus;
|
||||
icon-colorize: Colors.greenyellow;
|
||||
icon-size: 1.5rem;
|
||||
border-radius: 0;
|
||||
clicked => { Backend.open-new-task-form({
|
||||
eventSourceId: event.sourceId,
|
||||
eventId: event.id,
|
||||
})}
|
||||
}
|
||||
VActionButton {
|
||||
icon-svg: Svg.pen;
|
||||
icon-colorize: Colors.grey;
|
||||
icon-size: 1.5rem;
|
||||
border-radius: 0;
|
||||
clicked => { Backend.open-edit-event-form(event.sourceId, event.id) }
|
||||
}
|
||||
|
||||
VActionButton {
|
||||
icon-svg: Svg.trash;
|
||||
icon-colorize: Colors.pink;
|
||||
icon-size: 1.5rem;
|
||||
border-radius: 0;
|
||||
clicked => { Backend.delete-event-clicked(event.sourceId, event.id) }
|
||||
}
|
||||
}
|
||||
|
||||
ta := TouchArea {
|
||||
pointer-event(e) => {
|
||||
if (e.button == PointerEventButton.right && e.kind == PointerEventKind.up) {
|
||||
eventPopup.show(ta.mouse-x, ta.mouse-y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
VerticalLayout {
|
||||
spacing: 4px;
|
||||
VText {
|
||||
text: Utils.time-to-string(event.startsAt);
|
||||
color: Palette.accent;
|
||||
}
|
||||
HorizontalLayout {
|
||||
alignment: center;
|
||||
Rectangle {
|
||||
width: 4px;
|
||||
background: Palette.accent;
|
||||
border-radius: 8px;
|
||||
|
||||
}
|
||||
}
|
||||
VText {
|
||||
text: Utils.time-to-string(event.endsAt);
|
||||
color: Palette.accent;
|
||||
font-size: 0.8rem;
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
VerticalLayout {
|
||||
horizontal-stretch: 1;
|
||||
padding: 16px;
|
||||
padding-top: 32px;
|
||||
padding-bottom: 32px;
|
||||
padding-right: 0px;
|
||||
VText {
|
||||
text: event.title;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
for task[taskIndex] in event.tasks: VerticalLayout {
|
||||
padding-top: taskIndex == 0 ? 16px : 0px;
|
||||
padding-bottom: 8px;
|
||||
TaskLine {
|
||||
task: task;
|
||||
source-index: task.sourceId;
|
||||
task-index: task.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue