diff --git a/examples/widget-gallery/src/main.rs b/examples/widget-gallery/src/main.rs index 04ee5bae..d0de7ea8 100644 --- a/examples/widget-gallery/src/main.rs +++ b/examples/widget-gallery/src/main.rs @@ -18,10 +18,11 @@ use floem::{ unit::UnitExt, view::View, views::{ - container, container_box, h_stack, label, scroll, stack, tab, v_stack, virtual_list, + container, container_box, label, scroll, stack, tab, v_stack, virtual_list, Decorators, VirtualListDirection, VirtualListItemSize, }, widgets::button, + widgets::h_splitter, EventPropagation, }; @@ -116,7 +117,7 @@ fn app_view() -> impl View { }) }, ) - .style(|s| s.flex_col().width(140.0)) + .style(|s| s.flex_col().width_full()) }) .style(|s| { s.flex_col() @@ -140,7 +141,7 @@ fn app_view() -> impl View { }) .style(|s| s); - let left = v_stack((list, inspector)).style(|s| s.height_full().gap(0.0, 5.0)); + let left = v_stack((list, inspector)).style(|s| s.height_full().width_full().gap(0.0, 5.0)); let tab = tab( move || active_tab.get(), @@ -163,7 +164,7 @@ fn app_view() -> impl View { let tab = scroll(tab).style(|s| s.flex_basis(0).min_width(0).flex_grow(1.0)); - let view = h_stack((left, tab)) + let view = h_splitter(150.px(), left, tab) .style(|s| s.padding(5.0).width_full().height_full().gap(5.0, 0.0)) .window_title(|| "Widget Gallery".to_owned()); diff --git a/src/style.rs b/src/style.rs index 5a77fe58..83e6ecd1 100644 --- a/src/style.rs +++ b/src/style.rs @@ -221,8 +221,8 @@ pub trait StyleProp: Default + Copy + 'static { fn prop_ref() -> StylePropRef; fn default_value() -> Self::Type; } - #[derive(Debug)] + pub struct StylePropInfo { pub(crate) name: fn() -> &'static str, pub(crate) inherited: bool, diff --git a/src/views/mod.rs b/src/views/mod.rs index 202cbe50..01d3dd48 100644 --- a/src/views/mod.rs +++ b/src/views/mod.rs @@ -61,4 +61,4 @@ mod drag_resize_window_area; pub use drag_resize_window_area::*; mod img; -pub use img::*; +pub use img::*; \ No newline at end of file diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index 40f7fb8f..83677c07 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -29,6 +29,9 @@ pub use button::*; mod text_input; pub use text_input::*; +mod splitter; +pub use splitter::*; + pub(crate) struct Theme { pub(crate) background: Color, pub(crate) style: Rc