mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-02 01:23:23 +00:00
Various minor improvements
This commit is contained in:
parent
a2aeeea421
commit
00857b287f
4 changed files with 25 additions and 12 deletions
|
@ -10,20 +10,24 @@ export component VButton inherits Rectangle {
|
||||||
in property<brush> icon-colorize: Palette.foreground;
|
in property<brush> icon-colorize: Palette.foreground;
|
||||||
in property<length> icon-size: 1rem;
|
in property<length> icon-size: 1rem;
|
||||||
in property <string> icon-svg;
|
in property <string> icon-svg;
|
||||||
|
in property <brush> background-color: Palette.control-background;
|
||||||
in property enabled <=> ta.enabled;
|
in property enabled <=> ta.enabled;
|
||||||
callback clicked;
|
callback clicked;
|
||||||
|
callback double-clicked;
|
||||||
|
|
||||||
private property<bool> active: false;
|
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;
|
border-radius: 4px;
|
||||||
|
|
||||||
ta := TouchArea {
|
ta := TouchArea {
|
||||||
mouse-cursor: pointer;
|
mouse-cursor: pointer;
|
||||||
clicked => {
|
clicked => {
|
||||||
active = !active;
|
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
|
double-clicked => {
|
||||||
|
root.double-clicked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
|
|
|
@ -20,7 +20,7 @@ export component VCheckBox {
|
||||||
border-radius: 32px;
|
border-radius: 32px;
|
||||||
}
|
}
|
||||||
if !checked : Rectangle {
|
if !checked : Rectangle {
|
||||||
border-color: Palette.accent;
|
border-color: Palette.foreground;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
height: 1rem;
|
height: 1rem;
|
||||||
width: self.height;
|
width: self.height;
|
||||||
|
|
|
@ -8,6 +8,8 @@ export component VDatePicker inherits VLabeledComponent {
|
||||||
in-out property<Date> date;
|
in-out property<Date> date;
|
||||||
in-out property<string> dateDisplay;
|
in-out property<string> dateDisplay;
|
||||||
|
|
||||||
|
callback edited(Date);
|
||||||
|
|
||||||
pure function formatZeroPadding(number: int) -> string {
|
pure function formatZeroPadding(number: int) -> string {
|
||||||
if (number < 10) {
|
if (number < 10) {
|
||||||
return "0\{number}";
|
return "0\{number}";
|
||||||
|
@ -26,6 +28,7 @@ export component VDatePicker inherits VLabeledComponent {
|
||||||
date.year = 0;
|
date.year = 0;
|
||||||
date.month = 0;
|
date.month = 0;
|
||||||
date.day = 0;
|
date.day = 0;
|
||||||
|
root.edited(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
|
@ -43,6 +46,9 @@ export component VDatePicker inherits VLabeledComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
taskDateInput := DatePickerPopup {
|
taskDateInput := DatePickerPopup {
|
||||||
accepted(date) => { root.date = date }
|
accepted(date) => {
|
||||||
|
root.date = date;
|
||||||
|
root.edited(date);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ export component ToggleButton inherits Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HorizontalLayout {
|
||||||
|
alignment: space-between;
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
padding-top: 4px;
|
padding-top: 4px;
|
||||||
|
@ -30,5 +32,6 @@ export component ToggleButton inherits Rectangle {
|
||||||
horizontal-alignment: center;
|
horizontal-alignment: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@children
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue