mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +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
|
@ -1,26 +1,18 @@
|
|||
import { Backend, TaskData } from "Backend.slint";
|
||||
import { Button, VerticalBox, CheckBox, ScrollView, ComboBox } from "std-widgets.slint";
|
||||
import { SideBar } from "SideBar.slint";
|
||||
import { TaskLine } from "TaskLine.slint";
|
||||
import { EventGroup } from "EventGroup.slint";
|
||||
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VTag, VText, VTextInput, Palette } from "@vynui";
|
||||
import { TaskLine } from "./components/TaskLine.slint";
|
||||
import { EventGroup } from "./components/EventGroup.slint";
|
||||
import { VPopupIconMenu, VDatePicker, VTimePicker, VCheckBox, VButton, VTag, VText, VTextInput, Svg, Palette } from "@vynui";
|
||||
import { NewTaskData, SaveTaskData } from "Backend.slint";
|
||||
import { CreateTaskOrEvent } from "components/CreateTaskOrEvent.slint";
|
||||
|
||||
export component MainView inherits Rectangle {
|
||||
|
||||
background: Palette.background;
|
||||
private property<image> icon-visible: @image-url("./images/visible.png");
|
||||
private property<image> icon-not-visible: @image-url("./images/not-visible.png");
|
||||
private property<string> icon-visible: Svg.visible;
|
||||
private property<string> icon-not-visible: Svg.not-visible;
|
||||
private property<bool> completed-tasks-visible: false;
|
||||
|
||||
pure function formatZeroPadding(number: int) -> string {
|
||||
if (number < 10) {
|
||||
return "0\{number}";
|
||||
}
|
||||
return number;
|
||||
}
|
||||
|
||||
VerticalLayout {
|
||||
horizontal-stretch: 1;
|
||||
padding: 16px;
|
||||
|
@ -33,10 +25,10 @@ export component MainView inherits Rectangle {
|
|||
VButton {
|
||||
text: "Show/Hide completed tasks";
|
||||
clicked => {
|
||||
Backend.toggle_show_completed_tasks();
|
||||
Backend.toggle-show-completed-tasks();
|
||||
completed-tasks-visible = !completed-tasks-visible;
|
||||
}
|
||||
icon-source: completed-tasks-visible ? icon-visible : icon-not-visible;
|
||||
icon-svg: completed-tasks-visible ? icon-visible : icon-not-visible;
|
||||
icon-colorize: Palette.control-foreground;
|
||||
}
|
||||
}
|
||||
|
@ -55,12 +47,12 @@ export component MainView inherits Rectangle {
|
|||
VerticalLayout {
|
||||
alignment: start;
|
||||
spacing: 16px;
|
||||
if Backend.visible_tasks.length == 0 && Backend.unscheduled-tasks.length == 0 : VText {
|
||||
if Backend.days.length == 0 && Backend.unscheduled-tasks.length == 0 : VText {
|
||||
text: "There is no task to show";
|
||||
horizontal-alignment: center;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
for day[dayIndex] in Backend.visible_tasks: VerticalLayout {
|
||||
for day[dayIndex] in Backend.days: VerticalLayout {
|
||||
Rectangle {
|
||||
background: Palette.card-background;
|
||||
border-radius: 8px;
|
||||
|
@ -69,7 +61,7 @@ export component MainView inherits Rectangle {
|
|||
HorizontalLayout {
|
||||
alignment: start;
|
||||
VText {
|
||||
text: Backend.formatDate(day.date);
|
||||
text: Backend.format-date(day.date);
|
||||
color: day.isLate ? Palette.orange : Palette.foreground;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue