Fixing Slider sizing when fully SizeToFit

Fixes #197
This commit is contained in:
Jonathan Johnson 2024-10-23 10:48:09 -07:00
parent 62dded16ef
commit 0e0c26fa3b
No known key found for this signature in database
GPG key ID: A66D6A34D6620579
2 changed files with 3 additions and 1 deletions

View file

@ -126,6 +126,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
contents. This means that the scroll bars are now clickable even in areas contents. This means that the scroll bars are now clickable even in areas
where interactive widgets are beneath them. where interactive widgets are beneath them.
- `GraphicsContext::fill` now properly fills the entire region of the widget. - `GraphicsContext::fill` now properly fills the entire region of the widget.
- `Slider` now correctly calculates its width when in a fully `SizeToFit`
layout.
### Added ### Added

View file

@ -548,7 +548,7 @@ where
// user of the slider, a horizontal slider is expected. So, we // user of the slider, a horizontal slider is expected. So, we
// set the minimum measurement based on a horizontal // set the minimum measurement based on a horizontal
// orientation. // orientation.
Size::new(width.min(minimum_size), static_side) Size::new(width.max(minimum_size), static_side)
} }
} }
} }