pub struct Separator { /* private fields */ }
Implementations§
Source§impl Separator
impl Separator
Sourcepub fn new() -> Separator
pub fn new() -> Separator
Examples found in repository?
examples/gallery.rs (line 70)
35fn build_root() -> impl Widget<State> {
36 let button = ToggleButton::<State>::from_icon(
37 &TURTLE,
38 4.0,
39 "Turtle",
40 |x| x.chosen == Animal::Turtle,
41 |_, state, _| {
42 state.chosen = Animal::Turtle;
43 println!("toggle");
44 },
45 |_, state, _| {
46 state.chosen = Animal::Snail;
47 println!("untoggle");
48 },
49 )
50 .tooltip("Turtle")
51 .fix_width(32.0)
52 .padding(10.0)
53 .background(Color::WHITE)
54 .border(Color::BLACK, 3.0);
55
56 let group = RadioGroup::icon_row(
57 vec![
58 (&SNAIL, Animal::Snail, "Snail".into()),
59 (&TURTLE, Animal::Turtle, "Turtle".into()),
60 (&RABBIT, Animal::Rabbit, "Rabbit".into()),
61 ],
62 4.0,
63 )
64 .fix_height(32.0)
65 .lens(State::chosen)
66 .padding(10.0)
67 .background(Color::WHITE)
68 .border(Color::BLACK, 3.0);
69
70 let sep = Separator::new().height(50.0).color(Color::rgb8(80, 70, 60));
71
72 let vgroup = RadioGroup::icon_column(
73 vec![
74 (&SNAIL, Animal::Snail, "Snail".into()),
75 (&TURTLE, Animal::Turtle, "Turtle".into()),
76 (&RABBIT, Animal::Rabbit, "Rabbit".into()),
77 ],
78 4.0,
79 )
80 .fix_width(32.0)
81 .lens(State::chosen)
82 .padding(10.0)
83 .background(Color::WHITE)
84 .border(Color::BLACK, 3.0);
85
86 ModalHost::new(
87 Flex::column()
88 .with_child(button)
89 .with_child(group)
90 .with_child(sep)
91 .with_child(vgroup)
92 .with_flex_spacer(1.0),
93 )
94}
pub fn width(self, width: f64) -> Separator
Sourcepub fn height(self, height: f64) -> Separator
pub fn height(self, height: f64) -> Separator
Examples found in repository?
examples/gallery.rs (line 70)
35fn build_root() -> impl Widget<State> {
36 let button = ToggleButton::<State>::from_icon(
37 &TURTLE,
38 4.0,
39 "Turtle",
40 |x| x.chosen == Animal::Turtle,
41 |_, state, _| {
42 state.chosen = Animal::Turtle;
43 println!("toggle");
44 },
45 |_, state, _| {
46 state.chosen = Animal::Snail;
47 println!("untoggle");
48 },
49 )
50 .tooltip("Turtle")
51 .fix_width(32.0)
52 .padding(10.0)
53 .background(Color::WHITE)
54 .border(Color::BLACK, 3.0);
55
56 let group = RadioGroup::icon_row(
57 vec![
58 (&SNAIL, Animal::Snail, "Snail".into()),
59 (&TURTLE, Animal::Turtle, "Turtle".into()),
60 (&RABBIT, Animal::Rabbit, "Rabbit".into()),
61 ],
62 4.0,
63 )
64 .fix_height(32.0)
65 .lens(State::chosen)
66 .padding(10.0)
67 .background(Color::WHITE)
68 .border(Color::BLACK, 3.0);
69
70 let sep = Separator::new().height(50.0).color(Color::rgb8(80, 70, 60));
71
72 let vgroup = RadioGroup::icon_column(
73 vec![
74 (&SNAIL, Animal::Snail, "Snail".into()),
75 (&TURTLE, Animal::Turtle, "Turtle".into()),
76 (&RABBIT, Animal::Rabbit, "Rabbit".into()),
77 ],
78 4.0,
79 )
80 .fix_width(32.0)
81 .lens(State::chosen)
82 .padding(10.0)
83 .background(Color::WHITE)
84 .border(Color::BLACK, 3.0);
85
86 ModalHost::new(
87 Flex::column()
88 .with_child(button)
89 .with_child(group)
90 .with_child(sep)
91 .with_child(vgroup)
92 .with_flex_spacer(1.0),
93 )
94}
Sourcepub fn color(self, color: impl Into<KeyOrValue<Color>>) -> Separator
pub fn color(self, color: impl Into<KeyOrValue<Color>>) -> Separator
Examples found in repository?
examples/gallery.rs (line 70)
35fn build_root() -> impl Widget<State> {
36 let button = ToggleButton::<State>::from_icon(
37 &TURTLE,
38 4.0,
39 "Turtle",
40 |x| x.chosen == Animal::Turtle,
41 |_, state, _| {
42 state.chosen = Animal::Turtle;
43 println!("toggle");
44 },
45 |_, state, _| {
46 state.chosen = Animal::Snail;
47 println!("untoggle");
48 },
49 )
50 .tooltip("Turtle")
51 .fix_width(32.0)
52 .padding(10.0)
53 .background(Color::WHITE)
54 .border(Color::BLACK, 3.0);
55
56 let group = RadioGroup::icon_row(
57 vec![
58 (&SNAIL, Animal::Snail, "Snail".into()),
59 (&TURTLE, Animal::Turtle, "Turtle".into()),
60 (&RABBIT, Animal::Rabbit, "Rabbit".into()),
61 ],
62 4.0,
63 )
64 .fix_height(32.0)
65 .lens(State::chosen)
66 .padding(10.0)
67 .background(Color::WHITE)
68 .border(Color::BLACK, 3.0);
69
70 let sep = Separator::new().height(50.0).color(Color::rgb8(80, 70, 60));
71
72 let vgroup = RadioGroup::icon_column(
73 vec![
74 (&SNAIL, Animal::Snail, "Snail".into()),
75 (&TURTLE, Animal::Turtle, "Turtle".into()),
76 (&RABBIT, Animal::Rabbit, "Rabbit".into()),
77 ],
78 4.0,
79 )
80 .fix_width(32.0)
81 .lens(State::chosen)
82 .padding(10.0)
83 .background(Color::WHITE)
84 .border(Color::BLACK, 3.0);
85
86 ModalHost::new(
87 Flex::column()
88 .with_child(button)
89 .with_child(group)
90 .with_child(sep)
91 .with_child(vgroup)
92 .with_flex_spacer(1.0),
93 )
94}
Trait Implementations§
Source§impl<T> Widget<T> for Separator
impl<T> Widget<T> for Separator
Source§fn event(&mut self, _: &mut EventCtx<'_, '_>, _: &Event, _: &mut T, _: &Env)
fn event(&mut self, _: &mut EventCtx<'_, '_>, _: &Event, _: &mut T, _: &Env)
Handle an event. Read more
Source§fn lifecycle(
&mut self,
_: &mut LifeCycleCtx<'_, '_>,
_: &LifeCycle,
_: &T,
_: &Env,
)
fn lifecycle( &mut self, _: &mut LifeCycleCtx<'_, '_>, _: &LifeCycle, _: &T, _: &Env, )
Handle a life cycle notification. Read more
Auto Trait Implementations§
impl Freeze for Separator
impl RefUnwindSafe for Separator
impl Send for Separator
impl Sync for Separator
impl Unpin for Separator
impl UnwindSafe for Separator
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
Mutably borrows from an owned value. Read more
Source§impl<T, W> TooltipExt<T, W> for W
impl<T, W> TooltipExt<T, W> 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>
Wrap this widget in an
Align
widget, configured to align left.Source§fn align_right(self) -> Align<T>
fn align_right(self) -> Align<T>
Wrap this widget in an
Align
widget, configured to align right.Source§fn align_vertical(self, align: UnitPoint) -> Align<T>
fn align_vertical(self, align: UnitPoint) -> Align<T>
Wrap this widget in an
Align
widget, configured to align vertically.Source§fn align_horizontal(self, align: UnitPoint) -> Align<T>
fn align_horizontal(self, align: UnitPoint) -> Align<T>
Wrap this widget in an
Align
widget, configured to align horizontally.Source§fn fix_width(self, width: f64) -> SizedBox<T>
fn fix_width(self, width: f64) -> SizedBox<T>
Wrap this widget in a
SizedBox
with an explicit width.Source§fn fix_height(self, height: f64) -> SizedBox<T>
fn fix_height(self, height: f64) -> SizedBox<T>
Wrap this widget in a
SizedBox
with an explicit width.Source§fn fix_size(self, width: f64, height: f64) -> SizedBox<T>
fn fix_size(self, width: f64, height: f64) -> SizedBox<T>
Wrap this widget in an
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 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>(self, controller: C) -> ControllerHost<Self, C>where
C: Controller<T, Self>,
fn controller<C>(self, controller: C) -> ControllerHost<Self, C>where
C: Controller<T, Self>,
Wrap this widget with the provided
Controller
.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>
Draw the
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>
Display the
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>
Draw a color-changing rectangle over this widget, allowing you to see the
invalidation regions.
Source§fn debug_widget(self) -> EnvScope<T, Self>
fn debug_widget(self) -> EnvScope<T, Self>
Set the
DEBUG_WIDGET
env variable for this widget (and its descendants). Read moreSource§fn parse(self) -> Parse<Self>
fn parse(self) -> Parse<Self>
👎Deprecated since 0.7.0: Use TextBox::with_formatter instead
Parse a
Widget<String>
’s contents