diff --git a/core/src/handle.rs b/core/src/handle.rs index 4d1af1625..dba74adab 100644 --- a/core/src/handle.rs +++ b/core/src/handle.rs @@ -45,7 +45,7 @@ impl<'a, T> Handle<'a, T> { self } - pub fn on_create(self, callback: F) -> Self + pub fn on_build(self, callback: F) -> Self where F: Fn(&mut Context), { @@ -401,6 +401,4 @@ impl<'a, T> Handle<'a, T> { set_style!(border_radius_top_right, Units); set_style!(border_radius_bottom_left, Units); set_style!(border_radius_bottom_right, Units); - - } diff --git a/core/src/views/value_slider.rs b/core/src/views/value_slider.rs index 54b42e521..bf76206f7 100644 --- a/core/src/views/value_slider.rs +++ b/core/src/views/value_slider.rs @@ -54,7 +54,7 @@ where Binding::new(cx, VSDataInternal::edit, move |cx, edit| { if edit.get(cx) { Textbox::new(cx, lens.clone().map(|val| format!("{:.2}", val))) - .on_create(|cx| { + .on_build(|cx| { cx.emit(TextEvent::StartEdit); cx.emit(TextEvent::SelectAll); }) @@ -67,6 +67,7 @@ where .on_edit_end(|cx| { cx.emit(ValueSliderEvent::SetEdit(false)); }) + .background_color(Color::transparent()) .child_space(Stretch(1.0)) .height(Stretch(1.0)) .width(Stretch(1.0)); diff --git a/examples/value_slider.rs b/examples/value_slider.rs index e1b1714bf..32f19a969 100644 --- a/examples/value_slider.rs +++ b/examples/value_slider.rs @@ -20,7 +20,7 @@ impl Model for AppData { } fn main() { - let mut window_description = WindowDescription::new(); + let window_description = WindowDescription::new().with_title("Value Slider"); Application::new(window_description, |cx| { AppData { val: 0.5 }.build(cx);