pub struct Window {
pub style: Style,
pub header_color: Color,
pub title_color: Color,
pub button_color: Color,
pub button_text_color: Color,
/* private fields */
}Expand description
Title-bar + content-area window widget (LVGL win parity).
Create with Window::new, set the title with Window::set_title, add
optional header buttons with Window::add_header_button, and query
geometry via Window::header_bounds and Window::content_bounds.
Fields§
§style: StyleOverall window background style (Part::MAIN).
header_color: ColorBackground color for the header bar.
title_color: ColorHeader title text color.
Header button background color (Part::ITEMS).
Header button icon text color.
Implementations§
Source§impl Window
impl Window
Sourcepub fn new(bounds: Rect, header_height: i32) -> Window
pub fn new(bounds: Rect, header_height: i32) -> Window
Create a window with the given outer bounds and header height.
Use DEFAULT_HEADER_HEIGHT when no specific height is needed.
Append an icon button to the header bar and return its WindowButtonId.
icon is an optional UTF-8 glyph or short string drawn inside the
button. width is the button width in pixels.
Return and clear the most recently activated header button id.
Returns None when no button was pressed since the last poll.
Sourcepub fn header_bounds(&self) -> Rect
pub fn header_bounds(&self) -> Rect
Return the screen-space rect of the header bar.
Sourcepub fn content_bounds(&self) -> Rect
pub fn content_bounds(&self) -> Rect
Return the screen-space rect of the content area (below the header).
Sourcepub fn set_font(&mut self, font: &'static dyn FontMetrics)
pub fn set_font(&mut self, font: &'static dyn FontMetrics)
Assign the font used to render this widget (FONT-00 §5); resolves to
FONT_6X10 when unset.
Sourcepub fn set_header_height(&mut self, h: i32)
pub fn set_header_height(&mut self, h: i32)
Update the header height and recompute content bounds.