pub struct Panel<Msg> { /* private fields */ }Expand description
A surface one step above its background, optionally titled, selectable and pressable.
A pressable panel answers the pointer like a button: hovering raises its surface one tone and
shows a soft pillar down its whole left edge, pressing flashes one tone brighter, and focus
reached with the keyboard raises it with a breathing pillar. A selected panel keeps the accent
pillar down the same edge, as on dialogs. Panels without on_press, and disabled ones, never react to the pointer.
Style keys: panel (bg, padding, pillar), panel-title (fg, bold), states
hover, focus and pressed (pressable panels only) and selected.
Implementations§
Source§impl<Msg: 'static> Panel<Msg>
impl<Msg: 'static> Panel<Msg>
Sourcepub fn new() -> Self
pub fn new() -> Self
An untitled panel. Add its content with View::add_with.
Sourcepub fn title(self, title: impl Into<String>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
A small heading drawn in the panel’s first row.
Sourcepub fn selected(self, selected: bool) -> Self
pub fn selected(self, selected: bool) -> Self
Raises the panel to the selected surface with the accent pillar.
Trait Implementations§
Source§impl<Msg: Clone + 'static> Container<Msg> for Panel<Msg>
impl<Msg: Clone + 'static> Container<Msg> for Panel<Msg>
Source§fn set_children(&mut self, children: Vec<Node<Msg>>)
fn set_children(&mut self, children: Vec<Node<Msg>>)
Source§impl<Msg: Clone + 'static> Widget<Msg> for Panel<Msg>
impl<Msg: Clone + 'static> Widget<Msg> for Panel<Msg>
Source§fn measure(&self, cx: &mut MeasureCx<'_>, available: Size) -> Size
fn measure(&self, cx: &mut MeasureCx<'_>, available: Size) -> Size
available.Source§fn event(&self, cx: &mut EventCx<'_, Msg>, event: &Event) -> bool
fn event(&self, cx: &mut EventCx<'_, Msg>, event: &Event) -> bool
true when the event was used; unused key and scroll events
bubble to the parent widget.Source§fn children_mut(&mut self) -> &mut [Node<Msg>]
fn children_mut(&mut self) -> &mut [Node<Msg>]
Source§fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
fn paint_overlay(&self, _cx: &mut PaintCx<'_>, _anchor: Rect)
PaintCx::request_overlay. anchor is the area the widget was painted in.Auto Trait Implementations§
impl<Msg> !RefUnwindSafe for Panel<Msg>
impl<Msg> !Send for Panel<Msg>
impl<Msg> !Sync for Panel<Msg>
impl<Msg> !UnwindSafe for Panel<Msg>
impl<Msg> Freeze for Panel<Msg>
impl<Msg> Unpin for Panel<Msg>
impl<Msg> UnsafeUnpin for Panel<Msg>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more