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
impl TitleBar
fn new( ui: &mut Ui, title: WidgetText, show_close_button: bool, collapsing: &mut CollapsingState, collapsible: bool, ) -> Self
sourcefn ui(
self,
ui: &mut Ui,
outer_rect: Rect,
content_response: &Option<Response>,
open: Option<&mut bool>,
collapsing: &mut CollapsingState,
collapsible: bool,
)
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
: ifNone
, window is collapsed at this frame, otherwise contains a result of rendering the window contentopen
: ifNone
, no “Close” button will be rendered, otherwise renders and processes the “Close” button and writes afalse
if window was closedcollapsing
: holds the current expanding state. Can be changed by double click on the title ifcollapsible
istrue
collapsible
: iftrue
, double click on the title bar will be handled for a change ofcollapsing
state
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§
impl Freeze for TitleBar
impl RefUnwindSafe for TitleBar
impl Send for TitleBar
impl Sync for TitleBar
impl Unpin for TitleBar
impl UnwindSafe for TitleBar
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