pub struct SizedBox<T> { /* private fields */ }
Expand description
A widget with predefined size.
If given a child, this widget forces its child to have a specific width and/or height (assuming values are permitted by this widget’s parent). If either the width or height is not set, this widget will size itself to match the child’s size in that dimension.
If not given a child, SizedBox will try to size itself as close to the specified height and width as possible given the parent’s constraints. If height or width is not set, it will be treated as zero.
Implementations§
Source§impl<T> SizedBox<T>
impl<T> SizedBox<T>
Sourcepub fn new(child: impl Widget<T> + 'static) -> Self
pub fn new(child: impl Widget<T> + 'static) -> Self
Construct container with child, and both width and height not set.
Examples found in repository?
241fn build_widget(state: &Params) -> Box<dyn Widget<AppState>> {
242 let mut flex = match state.axis {
243 FlexType::Column => Flex::column(),
244 FlexType::Row => Flex::row(),
245 }
246 .cross_axis_alignment(state.cross_alignment)
247 .main_axis_alignment(state.main_alignment)
248 .must_fill_main_axis(state.fill_major_axis);
249
250 flex.add_child(
251 TextBox::new()
252 .with_placeholder("Sample text")
253 .lens(DemoState::input_text),
254 );
255 space_if_needed(&mut flex, state);
256
257 flex.add_child(
258 Button::new("Clear").on_click(|_ctx, data: &mut DemoState, _env| {
259 data.input_text.clear();
260 data.enabled = false;
261 data.volume = 0.0;
262 }),
263 );
264
265 space_if_needed(&mut flex, state);
266
267 flex.add_child(
268 Label::new(|data: &DemoState, _: &Env| data.input_text.clone()).with_text_size(32.0),
269 );
270 space_if_needed(&mut flex, state);
271 flex.add_child(Checkbox::new("Demo").lens(DemoState::enabled));
272 space_if_needed(&mut flex, state);
273 flex.add_child(Switch::new().lens(DemoState::enabled));
274 space_if_needed(&mut flex, state);
275 flex.add_child(Slider::new().lens(DemoState::volume));
276 space_if_needed(&mut flex, state);
277 flex.add_child(ProgressBar::new().lens(DemoState::volume));
278 space_if_needed(&mut flex, state);
279 flex.add_child(
280 Stepper::new()
281 .with_range(0.0, 1.0)
282 .with_step(0.1)
283 .with_wraparound(true)
284 .lens(DemoState::volume),
285 );
286
287 let mut flex = SizedBox::new(flex);
288 if state.fix_minor_axis {
289 match state.axis {
290 FlexType::Row => flex = flex.height(200.),
291 FlexType::Column => flex = flex.width(200.),
292 }
293 }
294 if state.fix_major_axis {
295 match state.axis {
296 FlexType::Row => flex = flex.width(600.),
297 FlexType::Column => flex = flex.height(300.),
298 }
299 }
300
301 let flex = flex
302 .padding(8.0)
303 .border(Color::grey(0.6), 2.0)
304 .rounded(5.0)
305 .lens(AppState::demo_state);
306
307 if state.debug_layout {
308 flex.debug_paint_layout().boxed()
309 } else {
310 flex.boxed()
311 }
312}
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Construct container without child, and both width and height not set.
If the widget is unchanged, it will do nothing, which can be useful if you want to draw a
widget some of the time (for example, it is used to implement
Maybe
).
Examples found in repository?
More examples
23fn build_app() -> impl Widget<u32> {
24 let mut col = Flex::column();
25 let rows = 30;
26 let cols = 30;
27
28 for i in 0..cols {
29 let mut row = Flex::row();
30 let col_progress = i as f64 / cols as f64;
31
32 for j in 0..rows {
33 let row_progress = j as f64 / rows as f64;
34
35 row.add_child(
36 Container::new(SizedBox::empty().width(200.0).height(200.0))
37 .background(Color::rgb(1.0 * col_progress, 1.0 * row_progress, 1.0)),
38 );
39 }
40
41 col.add_child(row);
42 }
43
44 Scroll::new(col)
45}
231fn interactive_area() -> impl Widget<AppState> {
232 let text_box = TextBox::multiline()
233 .with_text_color(Color::rgb8(0xf0, 0xf0, 0xea))
234 .fix_size(INTERACTIVE_AREA_DIM, INTERACTIVE_AREA_DIM)
235 .lens(AppState::text_input)
236 .controller(EventLogger {
237 filter: |event| matches!(event, Event::KeyDown(_) | Event::KeyUp(_)),
238 });
239
240 let mouse_box = SizedBox::empty()
241 .fix_size(INTERACTIVE_AREA_DIM, INTERACTIVE_AREA_DIM)
242 .background(CURSOR_BACKGROUND_COLOR)
243 .rounded(5.0)
244 .border(INTERACTIVE_AREA_BORDER, 1.0)
245 .controller(EventLogger {
246 filter: |event| {
247 matches!(
248 event,
249 Event::MouseDown(_) | Event::MouseUp(_) | Event::Wheel(_)
250 )
251 },
252 });
253
254 Flex::row()
255 .with_flex_spacer(1.0)
256 .with_child(text_box)
257 .with_flex_spacer(1.0)
258 .with_child(mouse_box)
259 .with_flex_spacer(1.0)
260 .padding(10.0)
261}
Sourcepub fn width(self, width: impl Into<KeyOrValue<f64>>) -> Self
pub fn width(self, width: impl Into<KeyOrValue<f64>>) -> Self
Set container’s width.
Examples found in repository?
23fn build_app() -> impl Widget<u32> {
24 let mut col = Flex::column();
25 let rows = 30;
26 let cols = 30;
27
28 for i in 0..cols {
29 let mut row = Flex::row();
30 let col_progress = i as f64 / cols as f64;
31
32 for j in 0..rows {
33 let row_progress = j as f64 / rows as f64;
34
35 row.add_child(
36 Container::new(SizedBox::empty().width(200.0).height(200.0))
37 .background(Color::rgb(1.0 * col_progress, 1.0 * row_progress, 1.0)),
38 );
39 }
40
41 col.add_child(row);
42 }
43
44 Scroll::new(col)
45}
More examples
241fn build_widget(state: &Params) -> Box<dyn Widget<AppState>> {
242 let mut flex = match state.axis {
243 FlexType::Column => Flex::column(),
244 FlexType::Row => Flex::row(),
245 }
246 .cross_axis_alignment(state.cross_alignment)
247 .main_axis_alignment(state.main_alignment)
248 .must_fill_main_axis(state.fill_major_axis);
249
250 flex.add_child(
251 TextBox::new()
252 .with_placeholder("Sample text")
253 .lens(DemoState::input_text),
254 );
255 space_if_needed(&mut flex, state);
256
257 flex.add_child(
258 Button::new("Clear").on_click(|_ctx, data: &mut DemoState, _env| {
259 data.input_text.clear();
260 data.enabled = false;
261 data.volume = 0.0;
262 }),
263 );
264
265 space_if_needed(&mut flex, state);
266
267 flex.add_child(
268 Label::new(|data: &DemoState, _: &Env| data.input_text.clone()).with_text_size(32.0),
269 );
270 space_if_needed(&mut flex, state);
271 flex.add_child(Checkbox::new("Demo").lens(DemoState::enabled));
272 space_if_needed(&mut flex, state);
273 flex.add_child(Switch::new().lens(DemoState::enabled));
274 space_if_needed(&mut flex, state);
275 flex.add_child(Slider::new().lens(DemoState::volume));
276 space_if_needed(&mut flex, state);
277 flex.add_child(ProgressBar::new().lens(DemoState::volume));
278 space_if_needed(&mut flex, state);
279 flex.add_child(
280 Stepper::new()
281 .with_range(0.0, 1.0)
282 .with_step(0.1)
283 .with_wraparound(true)
284 .lens(DemoState::volume),
285 );
286
287 let mut flex = SizedBox::new(flex);
288 if state.fix_minor_axis {
289 match state.axis {
290 FlexType::Row => flex = flex.height(200.),
291 FlexType::Column => flex = flex.width(200.),
292 }
293 }
294 if state.fix_major_axis {
295 match state.axis {
296 FlexType::Row => flex = flex.width(600.),
297 FlexType::Column => flex = flex.height(300.),
298 }
299 }
300
301 let flex = flex
302 .padding(8.0)
303 .border(Color::grey(0.6), 2.0)
304 .rounded(5.0)
305 .lens(AppState::demo_state);
306
307 if state.debug_layout {
308 flex.debug_paint_layout().boxed()
309 } else {
310 flex.boxed()
311 }
312}
Sourcepub fn height(self, height: impl Into<KeyOrValue<f64>>) -> Self
pub fn height(self, height: impl Into<KeyOrValue<f64>>) -> Self
Set container’s height.
Examples found in repository?
23fn build_app() -> impl Widget<u32> {
24 let mut col = Flex::column();
25 let rows = 30;
26 let cols = 30;
27
28 for i in 0..cols {
29 let mut row = Flex::row();
30 let col_progress = i as f64 / cols as f64;
31
32 for j in 0..rows {
33 let row_progress = j as f64 / rows as f64;
34
35 row.add_child(
36 Container::new(SizedBox::empty().width(200.0).height(200.0))
37 .background(Color::rgb(1.0 * col_progress, 1.0 * row_progress, 1.0)),
38 );
39 }
40
41 col.add_child(row);
42 }
43
44 Scroll::new(col)
45}
More examples
241fn build_widget(state: &Params) -> Box<dyn Widget<AppState>> {
242 let mut flex = match state.axis {
243 FlexType::Column => Flex::column(),
244 FlexType::Row => Flex::row(),
245 }
246 .cross_axis_alignment(state.cross_alignment)
247 .main_axis_alignment(state.main_alignment)
248 .must_fill_main_axis(state.fill_major_axis);
249
250 flex.add_child(
251 TextBox::new()
252 .with_placeholder("Sample text")
253 .lens(DemoState::input_text),
254 );
255 space_if_needed(&mut flex, state);
256
257 flex.add_child(
258 Button::new("Clear").on_click(|_ctx, data: &mut DemoState, _env| {
259 data.input_text.clear();
260 data.enabled = false;
261 data.volume = 0.0;
262 }),
263 );
264
265 space_if_needed(&mut flex, state);
266
267 flex.add_child(
268 Label::new(|data: &DemoState, _: &Env| data.input_text.clone()).with_text_size(32.0),
269 );
270 space_if_needed(&mut flex, state);
271 flex.add_child(Checkbox::new("Demo").lens(DemoState::enabled));
272 space_if_needed(&mut flex, state);
273 flex.add_child(Switch::new().lens(DemoState::enabled));
274 space_if_needed(&mut flex, state);
275 flex.add_child(Slider::new().lens(DemoState::volume));
276 space_if_needed(&mut flex, state);
277 flex.add_child(ProgressBar::new().lens(DemoState::volume));
278 space_if_needed(&mut flex, state);
279 flex.add_child(
280 Stepper::new()
281 .with_range(0.0, 1.0)
282 .with_step(0.1)
283 .with_wraparound(true)
284 .lens(DemoState::volume),
285 );
286
287 let mut flex = SizedBox::new(flex);
288 if state.fix_minor_axis {
289 match state.axis {
290 FlexType::Row => flex = flex.height(200.),
291 FlexType::Column => flex = flex.width(200.),
292 }
293 }
294 if state.fix_major_axis {
295 match state.axis {
296 FlexType::Row => flex = flex.width(600.),
297 FlexType::Column => flex = flex.height(300.),
298 }
299 }
300
301 let flex = flex
302 .padding(8.0)
303 .border(Color::grey(0.6), 2.0)
304 .rounded(5.0)
305 .lens(AppState::demo_state);
306
307 if state.debug_layout {
308 flex.debug_paint_layout().boxed()
309 } else {
310 flex.boxed()
311 }
312}
53fn ui_builder() -> impl Widget<AppData> {
54 let mut root = Flex::column();
55
56 // Build a button to add children to both lists
57 root.add_child(
58 Button::new("Add")
59 .on_click(|_, data: &mut AppData, _| {
60 // Add child to left list
61 data.l_index += 1;
62 data.left.push_back(data.l_index as u32);
63
64 // Add child to right list
65 data.r_index += 1;
66 data.right.push_back(data.r_index as u32);
67 })
68 .fix_height(30.0)
69 .expand_width(),
70 );
71
72 let mut lists = Flex::row().cross_axis_alignment(CrossAxisAlignment::Start);
73
74 // Build a simple list
75 lists.add_flex_child(
76 Scroll::new(List::new(|| {
77 Label::new(|item: &u32, _env: &_| format!("List item #{item}"))
78 .align_vertical(UnitPoint::LEFT)
79 .padding(10.0)
80 .expand()
81 .height(50.0)
82 .background(Color::rgb(0.5, 0.5, 0.5))
83 }))
84 .vertical()
85 .lens(AppData::left),
86 1.0,
87 );
88
89 // Build a list with shared data
90 lists.add_flex_child(
91 Scroll::new(
92 List::new(|| {
93 Flex::row()
94 .with_child(
95 Label::new(|(_, item): &(Vector<u32>, u32), _env: &_| {
96 format!("List item #{item}")
97 })
98 .align_vertical(UnitPoint::LEFT),
99 )
100 .with_flex_spacer(1.0)
101 .with_child(
102 Button::new("Delete")
103 .on_click(|_ctx, (shared, item): &mut (Vector<u32>, u32), _env| {
104 // We have access to both child's data and shared data.
105 // Remove element from right list.
106 shared.retain(|v| v != item);
107 })
108 .fix_size(80.0, 20.0)
109 .align_vertical(UnitPoint::CENTER),
110 )
111 .padding(10.0)
112 .background(Color::rgb(0.5, 0.0, 0.5))
113 .fix_height(50.0)
114 })
115 .with_spacing(10.),
116 )
117 .vertical()
118 .lens(lens::Identity.map(
119 // Expose shared data with children data
120 |d: &AppData| (d.right.clone(), d.right.clone()),
121 |d: &mut AppData, x: (Vector<u32>, Vector<u32>)| {
122 // If shared data was changed reflect the changes in our AppData
123 d.right = x.0
124 },
125 )),
126 1.0,
127 );
128
129 root.add_flex_child(lists, 1.0);
130
131 root.with_child(Label::new("horizontal list"))
132 .with_child(
133 Scroll::new(
134 List::new(|| {
135 Label::new(|item: &u32, _env: &_| format!("List item #{item}"))
136 .padding(10.0)
137 .background(Color::rgb(0.5, 0.5, 0.0))
138 .fix_height(50.0)
139 })
140 .horizontal()
141 .with_spacing(10.)
142 .lens(AppData::left),
143 )
144 .horizontal(),
145 )
146 .debug_paint_layout()
147}
Sourcepub fn expand(self) -> Self
pub fn expand(self) -> Self
Expand container to fit the parent.
Only call this method if you want your widget to occupy all available
space. If you only care about expanding in one of width or height, use
expand_width
or expand_height
instead.
Sourcepub fn expand_width(self) -> Self
pub fn expand_width(self) -> Self
Expand the container on the x-axis.
This will force the child to have maximum width.
Examples found in repository?
53fn ui_builder() -> impl Widget<AppData> {
54 let mut root = Flex::column();
55
56 // Build a button to add children to both lists
57 root.add_child(
58 Button::new("Add")
59 .on_click(|_, data: &mut AppData, _| {
60 // Add child to left list
61 data.l_index += 1;
62 data.left.push_back(data.l_index as u32);
63
64 // Add child to right list
65 data.r_index += 1;
66 data.right.push_back(data.r_index as u32);
67 })
68 .fix_height(30.0)
69 .expand_width(),
70 );
71
72 let mut lists = Flex::row().cross_axis_alignment(CrossAxisAlignment::Start);
73
74 // Build a simple list
75 lists.add_flex_child(
76 Scroll::new(List::new(|| {
77 Label::new(|item: &u32, _env: &_| format!("List item #{item}"))
78 .align_vertical(UnitPoint::LEFT)
79 .padding(10.0)
80 .expand()
81 .height(50.0)
82 .background(Color::rgb(0.5, 0.5, 0.5))
83 }))
84 .vertical()
85 .lens(AppData::left),
86 1.0,
87 );
88
89 // Build a list with shared data
90 lists.add_flex_child(
91 Scroll::new(
92 List::new(|| {
93 Flex::row()
94 .with_child(
95 Label::new(|(_, item): &(Vector<u32>, u32), _env: &_| {
96 format!("List item #{item}")
97 })
98 .align_vertical(UnitPoint::LEFT),
99 )
100 .with_flex_spacer(1.0)
101 .with_child(
102 Button::new("Delete")
103 .on_click(|_ctx, (shared, item): &mut (Vector<u32>, u32), _env| {
104 // We have access to both child's data and shared data.
105 // Remove element from right list.
106 shared.retain(|v| v != item);
107 })
108 .fix_size(80.0, 20.0)
109 .align_vertical(UnitPoint::CENTER),
110 )
111 .padding(10.0)
112 .background(Color::rgb(0.5, 0.0, 0.5))
113 .fix_height(50.0)
114 })
115 .with_spacing(10.),
116 )
117 .vertical()
118 .lens(lens::Identity.map(
119 // Expose shared data with children data
120 |d: &AppData| (d.right.clone(), d.right.clone()),
121 |d: &mut AppData, x: (Vector<u32>, Vector<u32>)| {
122 // If shared data was changed reflect the changes in our AppData
123 d.right = x.0
124 },
125 )),
126 1.0,
127 );
128
129 root.add_flex_child(lists, 1.0);
130
131 root.with_child(Label::new("horizontal list"))
132 .with_child(
133 Scroll::new(
134 List::new(|| {
135 Label::new(|item: &u32, _env: &_| format!("List item #{item}"))
136 .padding(10.0)
137 .background(Color::rgb(0.5, 0.5, 0.0))
138 .fix_height(50.0)
139 })
140 .horizontal()
141 .with_spacing(10.)
142 .lens(AppData::left),
143 )
144 .horizontal(),
145 )
146 .debug_paint_layout()
147}
Sourcepub fn expand_height(self) -> Self
pub fn expand_height(self) -> Self
Expand the container on the y-axis.
This will force the child to have maximum height.
Trait Implementations§
Source§impl<T: Data> Widget<T> for SizedBox<T>
impl<T: Data> Widget<T> for SizedBox<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 SizedBox<T>
impl<T> !RefUnwindSafe for SizedBox<T>
impl<T> !Send for SizedBox<T>
impl<T> !Sync for SizedBox<T>
impl<T> Unpin for SizedBox<T>
impl<T> !UnwindSafe for SizedBox<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