mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Slider, by default clamp to range (#789)
* Slider, by default clamp to range * Update change log.
This commit is contained in:
@@ -26,6 +26,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
|
|||||||
* By default, `DragValue`:s no longer show a tooltip when hovered. Change with `Style::explanation_tooltips`.
|
* By default, `DragValue`:s no longer show a tooltip when hovered. Change with `Style::explanation_tooltips`.
|
||||||
* Smaller and nicer color picker.
|
* Smaller and nicer color picker.
|
||||||
* `ScrollArea` will auto-shrink to content size unless told otherwise using `ScollArea::auto_shrink`.
|
* `ScrollArea` will auto-shrink to content size unless told otherwise using `ScollArea::auto_shrink`.
|
||||||
|
* By default, `Slider`'s `clamp_to_range` is set to true.
|
||||||
|
|
||||||
### Fixed 🐛
|
### Fixed 🐛
|
||||||
* Fix wrongly sized multiline `TextEdit` in justified layouts.
|
* Fix wrongly sized multiline `TextEdit` in justified layouts.
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ impl<'a> Slider<'a> {
|
|||||||
smallest_positive: 1e-6,
|
smallest_positive: 1e-6,
|
||||||
largest_finite: f64::INFINITY,
|
largest_finite: f64::INFINITY,
|
||||||
},
|
},
|
||||||
clamp_to_range: false,
|
clamp_to_range: true,
|
||||||
smart_aim: true,
|
smart_aim: true,
|
||||||
show_value: true,
|
show_value: true,
|
||||||
prefix: Default::default(),
|
prefix: Default::default(),
|
||||||
@@ -163,7 +163,7 @@ impl<'a> Slider<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// If set to `true`, all incoming and outgoing values will be clamped to the slider range.
|
/// If set to `true`, all incoming and outgoing values will be clamped to the slider range.
|
||||||
/// Default: `false`.
|
/// Default: `true`.
|
||||||
pub fn clamp_to_range(mut self, clamp_to_range: bool) -> Self {
|
pub fn clamp_to_range(mut self, clamp_to_range: bool) -> Self {
|
||||||
self.clamp_to_range = clamp_to_range;
|
self.clamp_to_range = clamp_to_range;
|
||||||
self
|
self
|
||||||
|
|||||||
Reference in New Issue
Block a user