Struct egui::containers::window::TitleBar

source ·
struct TitleBar {
    id: Id,
    title_galley: Arc<Galley>,
    min_rect: Rect,
    rect: Rect,
}

Fields§

§id: Id

A title Id used for dragging windows

§title_galley: Arc<Galley>

Prepared text in the title

§min_rect: Rect

Size of the title bar in a collapsed state (if window is collapsible), which includes all necessary space for showing the expand button, the title and the close button.

§rect: Rect

Size of the title bar in an expanded state. This size become known only after expanding window and painting its content

Implementations§

source§

impl TitleBar

source

fn new( ui: &mut Ui, title: WidgetText, show_close_button: bool, collapsing: &mut CollapsingState, collapsible: bool, ) -> Self

source

fn ui( self, ui: &mut Ui, outer_rect: Rect, content_response: &Option<Response>, open: Option<&mut bool>, collapsing: &mut CollapsingState, collapsible: bool, )

Finishes painting of the title bar when the window content size already known.

§Parameters
  • ui:
  • outer_rect:
  • content_response: if None, window is collapsed at this frame, otherwise contains a result of rendering the window content
  • open: if None, no “Close” button will be rendered, otherwise renders and processes the “Close” button and writes a false if window was closed
  • collapsing: holds the current expanding state. Can be changed by double click on the title if collapsible is true
  • collapsible: if true, double click on the title bar will be handled for a change of collapsing state
source

fn close_button_ui(&self, ui: &mut Ui) -> Response

Paints the “Close” button at the right side of the title bar and processes clicks on it.

The button is square and its size is determined by the crate::style::Spacing::icon_width setting.

Auto Trait Implementations§

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.