mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 09:55:52 +00:00
Add new 'Add task/event' bar directly in the main view
This commit is contained in:
parent
534da46a26
commit
2aa039e5fc
18 changed files with 399 additions and 51 deletions
50
external/slint-vynui/LabeledComponent.slint
vendored
50
external/slint-vynui/LabeledComponent.slint
vendored
|
@ -2,21 +2,59 @@ import { Palette } from "Palette.slint";
|
|||
import { VText } from "Text.slint";
|
||||
|
||||
export component VLabeledComponent {
|
||||
in property<string> label <=> labelComponent.text;
|
||||
in property<string> label;
|
||||
in property<length> label-size: 1rem;
|
||||
in property <TextHorizontalAlignment> label-alignment: TextHorizontalAlignment.left;
|
||||
in property<bool> enabled: true;
|
||||
in property<bool> no-background: false;
|
||||
|
||||
function calc-background() -> brush {
|
||||
if (no-background == true) {
|
||||
return Palette.control-background.transparentize(1);
|
||||
}
|
||||
if (enabled == false) {
|
||||
return Palette.control-background.darker(0.2);
|
||||
}
|
||||
return Palette.control-background;
|
||||
}
|
||||
|
||||
VerticalLayout {
|
||||
labelComponent := VText {
|
||||
|
||||
}
|
||||
if root.label != "" : VerticalLayout {
|
||||
padding-left: 4px;
|
||||
padding-right: 4px;
|
||||
VText {
|
||||
text: root.label;
|
||||
font-size: label-size;
|
||||
horizontal-alignment: root.label-alignment;
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
background: enabled ? Palette.control-background : Palette.control-background.darker(0.2);
|
||||
background: calc-background();
|
||||
border-radius: 4px;
|
||||
VerticalLayout {
|
||||
padding: 4px;
|
||||
@children
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export component CommonComponentBackground {
|
||||
in property<bool> enabled: true;
|
||||
in property<bool> no-background: false;
|
||||
|
||||
function calc-background() -> brush {
|
||||
if (no-background == true) {
|
||||
return Palette.control-background.transparentize(1);
|
||||
}
|
||||
if (enabled == false) {
|
||||
return Palette.control-background.darker(0.2);
|
||||
}
|
||||
return Palette.control-background;
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
background: calc-background();
|
||||
@children
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue