pub struct DoubleSlider<'a, T: Numeric> { /* private fields */ }
Expand description
Control two numbers with a double slider.
The slider range defines the values you get when pulling the slider to the far edges.
The range can include any numbers, and go from low-to-high or from high-to-low.
use egui_double_slider::DoubleSlider;
egui::__run_test_ui(|ui| {
let mut my_val: f32 = 0.0;
let mut my_other_val: f32 = 0.0;
ui.add(DoubleSlider::new(&mut my_val,&mut my_other_val, 0.0..=100.0));
});
Implementations§
Source§impl<'a, T: Numeric> DoubleSlider<'a, T>
impl<'a, T: Numeric> DoubleSlider<'a, T>
pub fn new( lower_value: &'a mut T, upper_value: &'a mut T, range: RangeInclusive<T>, ) -> Self
Sourcepub fn zoom_factor(self, zoom_factor: f32) -> Self
pub fn zoom_factor(self, zoom_factor: f32) -> Self
Set the zoom factor (multiplied with cursor zoom). This depends on the responsiveness that you would like to have for zooming Default is 10.0
Sourcepub fn scroll_factor(self, scroll_factor: f32) -> Self
pub fn scroll_factor(self, scroll_factor: f32) -> Self
Set the scroll factor (multiplied with cursor scroll). This depends on the responsiveness that you would like to have for scrolling Default is 0.01
Sourcepub fn horizontal_scroll(self, enable: bool) -> Self
pub fn horizontal_scroll(self, enable: bool) -> Self
Enable the horizontal scroll axis. Default is true
Sourcepub fn vertical_scroll(self, enable: bool) -> Self
pub fn vertical_scroll(self, enable: bool) -> Self
Enable the vertical scroll axis. Default is true
Sourcepub fn invert_highlighting(self, inverted_highlighting: bool) -> Self
pub fn invert_highlighting(self, inverted_highlighting: bool) -> Self
Invert the highlighted part. Default is false.
Sourcepub fn separation_distance(self, separation_distance: T) -> Self
pub fn separation_distance(self, separation_distance: T) -> Self
Set the separation distance for the two sliders. Default is 1.
Sourcepub fn color(self, color: Color32) -> Self
pub fn color(self, color: Color32) -> Self
Set the primary color for the slider
Default color is taken from inactive.bg_fill
in egui::style::Widgets
, the same as egui::Slider
.
Sourcepub fn stroke(self, stroke: Stroke) -> Self
pub fn stroke(self, stroke: Stroke) -> Self
Set the stroke for the main line.
Default width is 7.0 and default color is taken from selection.bg_fill
in egui::Visuals
, the same as egui::Slider
Sourcepub fn cursor_fill(self, cursor_fill: Color32) -> Self
pub fn cursor_fill(self, cursor_fill: Color32) -> Self
Set the color fill for the slider cursor.
Default fill is taken from visuals.bg_fill
in egui::style::WidgetVisuals
, the same as egui::Slider
Sourcepub fn control_point_radius(self, control_point_radius: f32) -> Self
pub fn control_point_radius(self, control_point_radius: f32) -> Self
Set the control point radius Default is 7.0
Sourcepub fn logarithmic(self, logarithmic: bool) -> Self
pub fn logarithmic(self, logarithmic: bool) -> Self
Use a logarithmic scale. Default is false.
Sourcepub fn push_by_dragging(self, push_by_dragging: bool) -> Self
pub fn push_by_dragging(self, push_by_dragging: bool) -> Self
Allow to drag the lower value to the right of the upper value, and vice versa. Default is true.