Various minor improvements

This commit is contained in:
Vyn 2024-11-01 13:41:11 +01:00
parent a2aeeea421
commit 00857b287f
4 changed files with 25 additions and 12 deletions

View file

@ -10,20 +10,24 @@ export component VButton inherits Rectangle {
in property<brush> icon-colorize: Palette.foreground;
in property<length> icon-size: 1rem;
in property <string> icon-svg;
in property <brush> background-color: Palette.control-background;
in property enabled <=> ta.enabled;
callback clicked;
callback double-clicked;
private property<bool> active: false;
background: enabled ? Palette.control-background : Palette.control-background.darker(0.2);
background: enabled ? root.background-color : Palette.control-background.darker(0.2);
border-radius: 4px;
ta := TouchArea {
mouse-cursor: pointer;
clicked => {
active = !active;
root.clicked();
}
double-clicked => {
root.double-clicked();
}
}
HorizontalLayout {