Skip to main content

iced_resizable_split/
lib.rs

1// TODO: Extract common logic into common functions
2
3#![doc = include_str!("../README.md")]
4
5mod split;
6pub mod state;
7pub mod style;
8
9pub use split::Axis;
10pub use split::Split;
11pub use state::State;
12pub use style::Style;
13
14const DEFAULT_DRAG_AREA_SIZE: f32 = 12.0;
15
16#[allow(unused)]
17pub fn split_horizontal<'a, Message, Theme, Renderer>(
18    top: impl Into<iced_core::Element<'a, Message, Theme, Renderer>>,
19    bottom: impl Into<iced_core::Element<'a, Message, Theme, Renderer>>,
20    state: state::State,
21    message: impl Fn(state::State) -> Message + 'a,
22) -> split::Split<'a, Message, Theme, Renderer>
23where
24    Theme: 'a,
25{
26    split::Split::new(split::Axis::Horizontal, top, bottom, state, message)
27}
28
29#[allow(unused)]
30pub fn split_vertical<'a, Message, Theme, Renderer>(
31    left: impl Into<iced_core::Element<'a, Message, Theme, Renderer>>,
32    right: impl Into<iced_core::Element<'a, Message, Theme, Renderer>>,
33    state: state::State,
34    message: impl Fn(state::State) -> Message + 'a,
35) -> split::Split<'a, Message, Theme, Renderer>
36where
37    Theme: 'a,
38{
39    split::Split::new(split::Axis::Vertical, left, right, state, message)
40}