|
|
|
@ -20,8 +20,8 @@ where
|
|
|
|
|
area: Rect,
|
|
|
|
|
callback: F,
|
|
|
|
|
input: Child<NumberInputSlider>,
|
|
|
|
|
cancel_button: Child<Button<&'static str>>,
|
|
|
|
|
confirm_button: Child<Button<&'static str>>,
|
|
|
|
|
cancel_button: Child<Button>,
|
|
|
|
|
confirm_button: Child<Button>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<F> NumberInputSliderDialog<F>
|
|
|
|
@ -33,10 +33,10 @@ where
|
|
|
|
|
area: Rect::zero(),
|
|
|
|
|
callback,
|
|
|
|
|
input: NumberInputSlider::new(min, max, init_value).into_child(),
|
|
|
|
|
cancel_button: Button::with_text("CANCEL")
|
|
|
|
|
cancel_button: Button::with_text("CANCEL".into())
|
|
|
|
|
.styled(theme::button_cancel())
|
|
|
|
|
.into_child(),
|
|
|
|
|
confirm_button: Button::with_text("CONFIRM")
|
|
|
|
|
confirm_button: Button::with_text("CONFIRM".into())
|
|
|
|
|
.styled(theme::button_confirm())
|
|
|
|
|
.into_child(),
|
|
|
|
|
}
|
|
|
|
@ -184,7 +184,7 @@ impl Component for NumberInputSlider {
|
|
|
|
|
let val_pct = (100 * (self.value - self.min)) / (self.max - self.min);
|
|
|
|
|
let fill_to = (val_pct as i16 * self.area.width()) / 100;
|
|
|
|
|
|
|
|
|
|
display::bar_with_text_and_fill::<&str>(
|
|
|
|
|
display::bar_with_text_and_fill(
|
|
|
|
|
self.area,
|
|
|
|
|
None,
|
|
|
|
|
theme::FG,
|
|
|
|
|