TitleBar

Struct TitleBar 

Source
pub struct TitleBar<'a, Message, Theme = Theme, Renderer = Renderer>
where Theme: Catalog, Renderer: Renderer,
{ /* private fields */ }
Expand description

The title bar of a Pane.

Implementations§

Source§

impl<'a, Message, Theme, Renderer> TitleBar<'a, Message, Theme, Renderer>
where Theme: Catalog, Renderer: Renderer,

Source

pub fn new(content: impl Into<Element<'a, Message, Theme, Renderer>>) -> Self

Creates a new TitleBar with the given content.

Source

pub fn controls( self, controls: impl Into<Controls<'a, Message, Theme, Renderer>>, ) -> Self

Sets the controls of the TitleBar.

Source

pub fn padding<P: Into<Padding>>(self, padding: P) -> Self

Sets the Padding of the TitleBar.

Source

pub fn always_show_controls(self) -> Self

Sets whether or not the controls attached to this TitleBar are always visible.

By default, the controls are only visible when the Pane of this TitleBar is hovered.

Source

pub fn style(self, style: impl Fn(&Theme) -> Style + 'a) -> Self
where Theme::Class<'a>: From<StyleFn<'a, Theme>>,

Sets the style of the TitleBar.

Source

pub fn class(self, class: impl Into<Theme::Class<'a>>) -> Self

Available on crate feature advanced only.

Sets the style class of the TitleBar.

Source§

impl<Message, Theme, Renderer> TitleBar<'_, Message, Theme, Renderer>
where Theme: Catalog, Renderer: Renderer,

Source

pub fn draw( &self, tree: &Tree, renderer: &mut Renderer, theme: &Theme, inherited_style: &Style, layout: Layout<'_>, cursor: Cursor, viewport: &Rectangle, show_controls: bool, )

Draws the TitleBar with the provided Renderer and Layout.

Source

pub fn is_over_pick_area( &self, layout: Layout<'_>, cursor_position: Point, ) -> bool

Returns whether the mouse cursor is over the pick area of the TitleBar or not.

The whole TitleBar is a pick area, except its controls.

Auto Trait Implementations§

§

impl<'a, Message, Theme, Renderer> Freeze for TitleBar<'a, Message, Theme, Renderer>
where <Theme as Catalog>::Class<'a>: Freeze,

§

impl<'a, Message, Theme = Theme, Renderer = Renderer> !RefUnwindSafe for TitleBar<'a, Message, Theme, Renderer>

§

impl<'a, Message, Theme = Theme, Renderer = Renderer> !Send for TitleBar<'a, Message, Theme, Renderer>

§

impl<'a, Message, Theme = Theme, Renderer = Renderer> !Sync for TitleBar<'a, Message, Theme, Renderer>

§

impl<'a, Message, Theme, Renderer> Unpin for TitleBar<'a, Message, Theme, Renderer>
where <Theme as Catalog>::Class<'a>: Unpin,

§

impl<'a, Message, Theme = Theme, Renderer = Renderer> !UnwindSafe for TitleBar<'a, Message, Theme, Renderer>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.