mirror of
https://codeberg.org/vyn/selenite.git
synced 2025-07-01 09:13:19 +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<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 {
|
||||
|
|
|
@ -20,7 +20,7 @@ export component VCheckBox {
|
|||
border-radius: 32px;
|
||||
}
|
||||
if !checked : Rectangle {
|
||||
border-color: Palette.accent;
|
||||
border-color: Palette.foreground;
|
||||
border-width: 2px;
|
||||
height: 1rem;
|
||||
width: self.height;
|
||||
|
|
|
@ -8,6 +8,8 @@ export component VDatePicker inherits VLabeledComponent {
|
|||
in-out property<Date> date;
|
||||
in-out property<string> dateDisplay;
|
||||
|
||||
callback edited(Date);
|
||||
|
||||
pure function formatZeroPadding(number: int) -> string {
|
||||
if (number < 10) {
|
||||
return "0\{number}";
|
||||
|
@ -26,13 +28,14 @@ export component VDatePicker inherits VLabeledComponent {
|
|||
date.year = 0;
|
||||
date.month = 0;
|
||||
date.day = 0;
|
||||
root.edited(date);
|
||||
}
|
||||
|
||||
HorizontalLayout {
|
||||
VButton {
|
||||
text: getDateDisplay();
|
||||
enabled: root.enabled;
|
||||
clicked => { taskDateInput.show() }
|
||||
clicked => {taskDateInput.show() }
|
||||
}
|
||||
VActionButton {
|
||||
icon-svg: Svg.reset;
|
||||
|
@ -43,6 +46,9 @@ export component VDatePicker inherits VLabeledComponent {
|
|||
}
|
||||
|
||||
taskDateInput := DatePickerPopup {
|
||||
accepted(date) => { root.date = date }
|
||||
accepted(date) => {
|
||||
root.date = date;
|
||||
root.edited(date);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,13 +22,16 @@ export component ToggleButton inherits Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
VerticalLayout {
|
||||
padding: 8px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
text-component := VText {
|
||||
horizontal-alignment: center;
|
||||
HorizontalLayout {
|
||||
alignment: space-between;
|
||||
VerticalLayout {
|
||||
padding: 8px;
|
||||
padding-top: 4px;
|
||||
padding-bottom: 4px;
|
||||
text-component := VText {
|
||||
horizontal-alignment: center;
|
||||
}
|
||||
}
|
||||
@children
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue