slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.94k stars 568 forks source link

Clicking on Slider (but not on handle) should change the Slider's value #4233

Closed wanglunhui2012 closed 8 months ago

wanglunhui2012 commented 8 months ago

Now, I click slider, the value won't change, and I want to know the event like onRelease when mouse click released, How can I solve this.

Edit: Acceptance criteria is that when clicking within a slider's geometry but not on the handle, the value should change according to platform defaults. Typically a click means a moving the knob to the location of the mouse (as if it was dragged all the way), and adjusting the value accordingly.

tronical commented 8 months ago

Thanks for filing the issue. With "value not changing when clicking", do you mean that when you click say to the right or left of the slider's knob/handle, the value doesn't change? I'd say that's a missing feature.

Could you describe a little more what you'd like to do if there were an onRelease event?

wanglunhui2012 commented 8 months ago

Thanks for filing the issue. With "value not changing when clicking", do you mean that when you click say to the right or left of the slider's knob/handle, the value doesn't change? I'd say that's a missing feature.

Could you describe a little more what you'd like to do if there were an onRelease event?

It's I click any position, the value should be changed. Such as a media player application, I want to listen the value change when I release my mouse to seek to a movie's percentage.

tronical commented 8 months ago

I agree, when clicking into space space, the value should be changed. I'll edit the description of this issue to clarify that as acceptance criteria.

Regarding the change of value when releasing the mouse, I think that could be solved differently. I've filed https://github.com/slint-ui/slint/issues/4260 .