diff --git a/components/Button.slint b/components/Button.slint index 1610c8d..3e3f372 100644 --- a/components/Button.slint +++ b/components/Button.slint @@ -10,20 +10,24 @@ export component VButton inherits Rectangle { in property icon-colorize: Palette.foreground; in property icon-size: 1rem; in property icon-svg; + in property background-color: Palette.control-background; in property enabled <=> ta.enabled; callback clicked; + callback double-clicked; private property 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 { diff --git a/components/CheckBox.slint b/components/CheckBox.slint index a1f98c1..dcccb18 100644 --- a/components/CheckBox.slint +++ b/components/CheckBox.slint @@ -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; diff --git a/components/DatePicker.slint b/components/DatePicker.slint index 0a6a10a..8bffba4 100644 --- a/components/DatePicker.slint +++ b/components/DatePicker.slint @@ -8,6 +8,8 @@ export component VDatePicker inherits VLabeledComponent { in-out property date; in-out property 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); + } } } diff --git a/components/ToggleButton.slint b/components/ToggleButton.slint index 57da3a8..5669ac8 100644 --- a/components/ToggleButton.slint +++ b/components/ToggleButton.slint @@ -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 } - }