pub struct Split<T> { /* private fields */ }
Expand description
A container containing two other widgets, splitting the area either horizontally or vertically.
Implementations§
Source§impl<T> Split<T>
impl<T> Split<T>
Sourcepub fn columns(
left_child: impl Widget<T> + 'static,
right_child: impl Widget<T> + 'static,
) -> Self
pub fn columns( left_child: impl Widget<T> + 'static, right_child: impl Widget<T> + 'static, ) -> Self
Create a new split panel, with the horizontal axis split in two by a vertical bar.
Examples found in repository?
More examples
115fn build_root_widget() -> impl Widget<AppState> {
116 let label = Scroll::new(
117 RawLabel::new()
118 .with_text_color(Color::BLACK)
119 .with_line_break_mode(LineBreaking::WordWrap)
120 .lens(AppState::rendered)
121 .expand_width()
122 .padding((SPACER_SIZE * 4.0, SPACER_SIZE)),
123 )
124 .vertical()
125 .background(Color::grey8(222))
126 .expand();
127
128 let textbox = TextBox::multiline()
129 .lens(AppState::raw)
130 .controller(RichTextRebuilder)
131 .expand()
132 .padding(5.0);
133
134 Split::columns(label, textbox)
135}
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
41fn make_ui() -> impl Widget<AppState> {
42 let mut switcher_column = Flex::column();
43 switcher_column.add_child(
44 Label::new(|data: &u32, _env: &Env| format!("Current view: {data}"))
45 .lens(AppState::current_view),
46 );
47 for i in 0..6 {
48 switcher_column.add_spacer(80.);
49 switcher_column.add_child(
50 Button::new(format!("View {i}"))
51 .on_click(move |_event, data: &mut u32, _env| {
52 *data = i;
53 })
54 .lens(AppState::current_view),
55 );
56 }
57
58 let view_switcher = ViewSwitcher::new(
59 |data: &AppState, _env| data.current_view,
60 |selector, _data, _env| match selector {
61 0 => Box::new(Label::new("Simple Label").center()),
62 1 => Box::new(
63 Button::new("Simple Button").on_click(|_event, _data, _env| {
64 println!("Simple button clicked!");
65 }),
66 ),
67 2 => Box::new(
68 Button::new("Another Simple Button").on_click(|_event, _data, _env| {
69 println!("Another simple button clicked!");
70 }),
71 ),
72 3 => Box::new(
73 Flex::column()
74 .with_flex_child(Label::new("Here is a label").center(), 1.0)
75 .with_flex_child(
76 Button::new("Button").on_click(|_event, _data, _env| {
77 println!("Complex button clicked!");
78 }),
79 1.0,
80 )
81 .with_flex_child(TextBox::new().lens(AppState::current_text), 1.0)
82 .with_flex_child(
83 Label::new(|data: &String, _env: &Env| format!("Value entered: {data}"))
84 .lens(AppState::current_text),
85 1.0,
86 ),
87 ),
88 4 => Box::new(
89 Split::columns(
90 Label::new("Left split").center(),
91 Label::new("Right split").center(),
92 )
93 .draggable(true),
94 ),
95 _ => Box::new(Label::new("Unknown").center()),
96 },
97 );
98
99 Flex::row()
100 .with_child(switcher_column)
101 .with_flex_child(view_switcher, 1.0)
102}
Sourcepub fn rows(
upper_child: impl Widget<T> + 'static,
lower_child: impl Widget<T> + 'static,
) -> Self
pub fn rows( upper_child: impl Widget<T> + 'static, lower_child: impl Widget<T> + 'static, ) -> Self
Create a new split panel, with the vertical axis split in two by a horizontal bar.
Examples found in repository?
208fn build_tab_widget(tab_config: &TabConfig) -> impl Widget<AppState> {
209 let dyn_tabs = Tabs::for_policy(NumberedTabs)
210 .with_axis(tab_config.axis)
211 .with_edge(tab_config.edge)
212 .with_transition(tab_config.transition)
213 .lens(AppState::advanced);
214
215 let control_dynamic = Flex::column()
216 .cross_axis_alignment(CrossAxisAlignment::Start)
217 .with_child(Label::new("Control dynamic tabs"))
218 .with_child(Button::new("Add a tab").on_click(|_c, d: &mut DynamicTabData, _e| d.add_tab()))
219 .with_child(Label::new(|adv: &DynamicTabData, _e: &Env| {
220 format!("Highest tab number is {}", adv.highest_tab)
221 }))
222 .with_spacer(20.)
223 .lens(AppState::advanced);
224
225 let first_static_tab = Flex::row()
226 .with_child(Label::new("Rename tab:"))
227 .with_child(TextBox::new().lens(AppState::first_tab_name));
228
229 let main_tabs = Tabs::new()
230 .with_axis(tab_config.axis)
231 .with_edge(tab_config.edge)
232 .with_transition(tab_config.transition)
233 .with_tab(
234 |app_state: &AppState, _: &Env| app_state.first_tab_name.to_string(),
235 first_static_tab,
236 )
237 .with_tab("Dynamic", control_dynamic)
238 .with_tab("Page 3", Label::new("Page 3 content"))
239 .with_tab("Page 4", Label::new("Page 4 content"))
240 .with_tab("Page 5", Label::new("Page 5 content"))
241 .with_tab("Page 6", Label::new("Page 6 content"))
242 .with_tab_index(1);
243
244 Split::rows(main_tabs, dyn_tabs).draggable(true)
245}
More examples
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
Sourcepub fn split_point(self, split_point: f64) -> Self
pub fn split_point(self, split_point: f64) -> Self
Builder-style method to set the split point as a fraction of the split axis.
The value must be between 0.0
and 1.0
, inclusive.
The default split point is 0.5
.
Examples found in repository?
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
Sourcepub fn min_size(self, first: f64, second: f64) -> Self
pub fn min_size(self, first: f64, second: f64) -> Self
Builder-style method to set the minimum size for both sides of the split axis.
The value must be greater than or equal to 0.0
.
The value will be rounded up to the nearest integer.
Examples found in repository?
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
Sourcepub fn bar_size(self, bar_size: f64) -> Self
pub fn bar_size(self, bar_size: f64) -> Self
Builder-style method to set the size of the splitter bar.
The value must be positive or zero.
The value will be rounded up to the nearest integer.
The default splitter bar size is 6.0
.
Examples found in repository?
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
Sourcepub fn min_bar_area(self, min_bar_area: f64) -> Self
pub fn min_bar_area(self, min_bar_area: f64) -> Self
Builder-style method to set the minimum size of the splitter bar area.
The minimum splitter bar area defines the minimum size of the area where mouse hit detection is done for the splitter bar. The final area is either this or the splitter bar size, whichever is greater.
This can be useful when you want to use a very narrow visual splitter bar, but don’t want to sacrifice user experience by making it hard to click on.
The value must be positive or zero.
The value will be rounded up to the nearest integer.
The default minimum splitter bar area is 6.0
.
Examples found in repository?
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
Sourcepub fn draggable(self, draggable: bool) -> Self
pub fn draggable(self, draggable: bool) -> Self
Builder-style method to set whether the split point can be changed by dragging.
Examples found in repository?
208fn build_tab_widget(tab_config: &TabConfig) -> impl Widget<AppState> {
209 let dyn_tabs = Tabs::for_policy(NumberedTabs)
210 .with_axis(tab_config.axis)
211 .with_edge(tab_config.edge)
212 .with_transition(tab_config.transition)
213 .lens(AppState::advanced);
214
215 let control_dynamic = Flex::column()
216 .cross_axis_alignment(CrossAxisAlignment::Start)
217 .with_child(Label::new("Control dynamic tabs"))
218 .with_child(Button::new("Add a tab").on_click(|_c, d: &mut DynamicTabData, _e| d.add_tab()))
219 .with_child(Label::new(|adv: &DynamicTabData, _e: &Env| {
220 format!("Highest tab number is {}", adv.highest_tab)
221 }))
222 .with_spacer(20.)
223 .lens(AppState::advanced);
224
225 let first_static_tab = Flex::row()
226 .with_child(Label::new("Rename tab:"))
227 .with_child(TextBox::new().lens(AppState::first_tab_name));
228
229 let main_tabs = Tabs::new()
230 .with_axis(tab_config.axis)
231 .with_edge(tab_config.edge)
232 .with_transition(tab_config.transition)
233 .with_tab(
234 |app_state: &AppState, _: &Env| app_state.first_tab_name.to_string(),
235 first_static_tab,
236 )
237 .with_tab("Dynamic", control_dynamic)
238 .with_tab("Page 3", Label::new("Page 3 content"))
239 .with_tab("Page 4", Label::new("Page 4 content"))
240 .with_tab("Page 5", Label::new("Page 5 content"))
241 .with_tab("Page 6", Label::new("Page 6 content"))
242 .with_tab_index(1);
243
244 Split::rows(main_tabs, dyn_tabs).draggable(true)
245}
More examples
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
41fn make_ui() -> impl Widget<AppState> {
42 let mut switcher_column = Flex::column();
43 switcher_column.add_child(
44 Label::new(|data: &u32, _env: &Env| format!("Current view: {data}"))
45 .lens(AppState::current_view),
46 );
47 for i in 0..6 {
48 switcher_column.add_spacer(80.);
49 switcher_column.add_child(
50 Button::new(format!("View {i}"))
51 .on_click(move |_event, data: &mut u32, _env| {
52 *data = i;
53 })
54 .lens(AppState::current_view),
55 );
56 }
57
58 let view_switcher = ViewSwitcher::new(
59 |data: &AppState, _env| data.current_view,
60 |selector, _data, _env| match selector {
61 0 => Box::new(Label::new("Simple Label").center()),
62 1 => Box::new(
63 Button::new("Simple Button").on_click(|_event, _data, _env| {
64 println!("Simple button clicked!");
65 }),
66 ),
67 2 => Box::new(
68 Button::new("Another Simple Button").on_click(|_event, _data, _env| {
69 println!("Another simple button clicked!");
70 }),
71 ),
72 3 => Box::new(
73 Flex::column()
74 .with_flex_child(Label::new("Here is a label").center(), 1.0)
75 .with_flex_child(
76 Button::new("Button").on_click(|_event, _data, _env| {
77 println!("Complex button clicked!");
78 }),
79 1.0,
80 )
81 .with_flex_child(TextBox::new().lens(AppState::current_text), 1.0)
82 .with_flex_child(
83 Label::new(|data: &String, _env: &Env| format!("Value entered: {data}"))
84 .lens(AppState::current_text),
85 1.0,
86 ),
87 ),
88 4 => Box::new(
89 Split::columns(
90 Label::new("Left split").center(),
91 Label::new("Right split").center(),
92 )
93 .draggable(true),
94 ),
95 _ => Box::new(Label::new("Unknown").center()),
96 },
97 );
98
99 Flex::row()
100 .with_child(switcher_column)
101 .with_flex_child(view_switcher, 1.0)
102}
Sourcepub fn solid_bar(self, solid: bool) -> Self
pub fn solid_bar(self, solid: bool) -> Self
Builder-style method to set whether the splitter bar is drawn as a solid rectangle.
If this is false
(the default), the bar will be drawn as two parallel lines.
Examples found in repository?
24fn build_app() -> impl Widget<u32> {
25 let fixed_cols = Padding::new(
26 10.0,
27 Container::new(
28 Split::columns(
29 Align::centered(Label::new("Left Split")),
30 Align::centered(Label::new("Right Split")),
31 )
32 .split_point(0.5),
33 )
34 .border(Color::WHITE, 1.0),
35 );
36 let fixed_rows = Padding::new(
37 10.0,
38 Container::new(
39 Split::rows(
40 Align::centered(Label::new("Top Split")),
41 Align::centered(Label::new("Bottom Split")),
42 )
43 .split_point(0.4)
44 .bar_size(3.0),
45 )
46 .border(Color::WHITE, 1.0),
47 );
48 let draggable_cols = Padding::new(
49 10.0,
50 Container::new(
51 Split::columns(
52 Align::centered(Label::new("Split A")),
53 Align::centered(Label::new("Split B")),
54 )
55 .split_point(0.5)
56 .draggable(true)
57 .solid_bar(true)
58 .min_size(60.0, 60.0),
59 )
60 .border(Color::WHITE, 1.0),
61 );
62 Padding::new(
63 10.0,
64 Container::new(
65 Split::rows(
66 Split::rows(fixed_cols, fixed_rows)
67 .split_point(0.33)
68 .bar_size(3.0)
69 .min_bar_area(3.0)
70 .draggable(true),
71 draggable_cols,
72 )
73 .split_point(0.75)
74 .bar_size(5.0)
75 .min_bar_area(11.0)
76 .draggable(true),
77 )
78 .border(Color::WHITE, 1.0),
79 )
80}
Trait Implementations§
Source§impl<T: Data> Widget<T> for Split<T>
impl<T: Data> Widget<T> for Split<T>
Source§fn event(
&mut self,
ctx: &mut EventCtx<'_, '_>,
event: &Event,
data: &mut T,
env: &Env,
)
fn event( &mut self, ctx: &mut EventCtx<'_, '_>, event: &Event, data: &mut T, env: &Env, )
Source§fn lifecycle(
&mut self,
ctx: &mut LifeCycleCtx<'_, '_>,
event: &LifeCycle,
data: &T,
env: &Env,
)
fn lifecycle( &mut self, ctx: &mut LifeCycleCtx<'_, '_>, event: &LifeCycle, data: &T, env: &Env, )
Source§fn layout(
&mut self,
ctx: &mut LayoutCtx<'_, '_>,
bc: &BoxConstraints,
data: &T,
env: &Env,
) -> Size
fn layout( &mut self, ctx: &mut LayoutCtx<'_, '_>, bc: &BoxConstraints, data: &T, env: &Env, ) -> Size
Source§fn paint(&mut self, ctx: &mut PaintCtx<'_, '_, '_>, data: &T, env: &Env)
fn paint(&mut self, ctx: &mut PaintCtx<'_, '_, '_>, data: &T, env: &Env)
Source§fn compute_max_intrinsic(
&mut self,
axis: Axis,
ctx: &mut LayoutCtx<'_, '_>,
bc: &BoxConstraints,
data: &T,
env: &Env,
) -> f64
fn compute_max_intrinsic( &mut self, axis: Axis, ctx: &mut LayoutCtx<'_, '_>, bc: &BoxConstraints, data: &T, env: &Env, ) -> f64
Auto Trait Implementations§
impl<T> !Freeze for Split<T>
impl<T> !RefUnwindSafe for Split<T>
impl<T> !Send for Split<T>
impl<T> !Sync for Split<T>
impl<T> Unpin for Split<T>where
T: Unpin,
impl<T> !UnwindSafe for Split<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Source§impl<T, W> TestWidgetExt<T> for W
impl<T, W> TestWidgetExt<T> for W
Source§impl<T, W> WidgetExt<T> for W
impl<T, W> WidgetExt<T> for W
Source§fn align_left(self) -> Align<T>
fn align_left(self) -> Align<T>
Align
widget, configured to align left.Source§fn align_right(self) -> Align<T>
fn align_right(self) -> Align<T>
Align
widget, configured to align right.Source§fn align_vertical(self, align: UnitPoint) -> Align<T>
fn align_vertical(self, align: UnitPoint) -> Align<T>
Align
widget, configured to align vertically.Source§fn align_horizontal(self, align: UnitPoint) -> Align<T>
fn align_horizontal(self, align: UnitPoint) -> Align<T>
Align
widget, configured to align horizontally.Source§fn fix_width(self, width: impl Into<KeyOrValue<f64>>) -> SizedBox<T>
fn fix_width(self, width: impl Into<KeyOrValue<f64>>) -> SizedBox<T>
SizedBox
with an explicit width.Source§fn fix_height(self, height: impl Into<KeyOrValue<f64>>) -> SizedBox<T>
fn fix_height(self, height: impl Into<KeyOrValue<f64>>) -> SizedBox<T>
SizedBox
with an explicit height.Source§fn fix_size(
self,
width: impl Into<KeyOrValue<f64>>,
height: impl Into<KeyOrValue<f64>>,
) -> SizedBox<T>
fn fix_size( self, width: impl Into<KeyOrValue<f64>>, height: impl Into<KeyOrValue<f64>>, ) -> SizedBox<T>
SizedBox
with an explicit width and heightSource§fn expand_width(self) -> SizedBox<T>
fn expand_width(self) -> SizedBox<T>
Source§fn expand_height(self) -> SizedBox<T>
fn expand_height(self) -> SizedBox<T>
Source§fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>
fn background(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>
Source§fn foreground(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>
fn foreground(self, brush: impl Into<BackgroundBrush<T>>) -> Container<T>
Source§fn border(
self,
color: impl Into<KeyOrValue<Color>>,
width: impl Into<KeyOrValue<f64>>,
) -> Container<T>
fn border( self, color: impl Into<KeyOrValue<Color>>, width: impl Into<KeyOrValue<f64>>, ) -> Container<T>
Source§fn controller<C: Controller<T, Self>>(
self,
controller: C,
) -> ControllerHost<Self, C>
fn controller<C: Controller<T, Self>>( self, controller: C, ) -> ControllerHost<Self, C>
Controller
.Source§fn on_added(
self,
f: impl Fn(&mut Self, &mut LifeCycleCtx<'_, '_>, &T, &Env) + 'static,
) -> ControllerHost<Self, Added<T, Self>>
fn on_added( self, f: impl Fn(&mut Self, &mut LifeCycleCtx<'_, '_>, &T, &Env) + 'static, ) -> ControllerHost<Self, Added<T, Self>>
Source§fn on_click(
self,
f: impl Fn(&mut EventCtx<'_, '_>, &mut T, &Env) + 'static,
) -> ControllerHost<Self, Click<T>>
fn on_click( self, f: impl Fn(&mut EventCtx<'_, '_>, &mut T, &Env) + 'static, ) -> ControllerHost<Self, Click<T>>
Source§fn debug_paint_layout(self) -> EnvScope<T, Self>
fn debug_paint_layout(self) -> EnvScope<T, Self>
layout
Rect
s of this widget and its children.Source§fn debug_widget_id(self) -> EnvScope<T, Self>
fn debug_widget_id(self) -> EnvScope<T, Self>
WidgetId
s for this widget and its children, when hot. Read moreSource§fn debug_invalidation(self) -> DebugInvalidation<T, Self>
fn debug_invalidation(self) -> DebugInvalidation<T, Self>
Source§fn debug_widget(self) -> EnvScope<T, Self>
fn debug_widget(self) -> EnvScope<T, Self>
DEBUG_WIDGET
env variable for this widget (and its descendants). Read moreSource§fn with_id(self, id: WidgetId) -> IdentityWrapper<Self>
fn with_id(self, id: WidgetId) -> IdentityWrapper<Self>
Source§fn disabled_if(
self,
disabled_if: impl Fn(&T, &Env) -> bool + 'static,
) -> DisabledIf<T, Self>
fn disabled_if( self, disabled_if: impl Fn(&T, &Env) -> bool + 'static, ) -> DisabledIf<T, Self>
DisabledIf
widget. Read more