Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ui::add_sized does not work as expected with Slider #462

Open
koalefant opened this issue Jun 4, 2021 · 2 comments
Open

Ui::add_sized does not work as expected with Slider #462

koalefant opened this issue Jun 4, 2021 · 2 comments

Comments

@koalefant
Copy link

Ui::add_sized does not work as one would expect when Slider is passed in. Instead Spacing::slider_width is used for its width.

The expectation here is that slider can be resized by supplying size in add_sized.

@wucke13
Copy link
Contributor

wucke13 commented Dec 21, 2021

I guess this is tricky, because the slider can also have a drag value at the side, which changes width depending on the value from the slider. I guess the correct thing would be:

  1. Get the maximum possible width of the dragvalue of the slider (with trying both the minimal and maximal value + suffix/prefix)
  2. Make the dragvalue it's maximum width
  3. Use the remaining width for the slider

@emilk
Copy link
Owner

emilk commented Dec 28, 2021

The problem is that Slider is not an "atomic" widget, but a collection of smaller widgets. It also makes it impossible to center in a layout.

In this case it could perhaps be fixed by looking for and respecting the "justified" flag in the parent layout (which is set by the add_sized function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants