Add a released callback to Slider (#4821)

The released callback is invoked when the user finished changing the value, for example
when the arrow key is released.

As a bonus, for the Qt implementation this fixes a few bugs in the keyboard handling:
  - Handle orientation
  - Implement click-to-focus
  - Emit released also on key release

Co-authored-by: Luke D. Jones <luke@ljones.dev>
This commit is contained in:
Simon Hausmann 2024-03-26 14:15:52 +01:00 committed by GitHub
parent 4451d6019a
commit f27c185daf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 154 additions and 31 deletions

View file

@ -423,12 +423,15 @@ export component NativeSpinBox {
export component NativeSlider {
in property <bool> enabled: true;
out property <bool> has-focus;
in-out property <float> value;
in property <float> minimum;
in property <float> maximum: 100;
in property <Orientation> orientation: Orientation.horizontal;
callback changed(float);
callback released(float);
//-is_internal
//-accepts_focus
}
export component NativeProgressIndicator {