pub struct WindowOptions {
    pub visible: bool,
    pub position: WindowPosition,
    pub width: f32,
    pub height: f32,
    pub title_bar: bool,
    pub background: bool,
    pub title_bar_background: bool,
    pub resize: bool,
    pub auto_resize: bool,
    pub scroll: bool,
    pub scroll_bar: bool,
    pub hotkey: WindowHotkey,
}
Expand description

Window options.

Fields§

§visible: bool

Whether the window is (currently) visible.

§position: WindowPosition

Position of the window.

§width: f32

Width of the window in pixels.

§height: f32

Height of the window in pixels.

§title_bar: bool

Whether to show the window titlebar.

§background: bool

Whether to show the window body background.

§title_bar_background: bool

Whether to show the window titlebar background.

§resize: bool

Whether to allow manually resizing the window.

§auto_resize: bool

Whether to automatically resize the window according to contents.

§scroll: bool

Whether to allow scrolling.

§scroll_bar: bool

Whether to show the scrollbar.

§hotkey: WindowHotkey

Hotkey to open the window with.

Implementations§

source§

impl WindowOptions

source

pub fn new() -> Self

Creates new window options.

source

pub fn key_press(&mut self, key: usize) -> bool

Handles a key press event.

Toggles visibility and returns true if the key matches the hotkey.

source

pub fn update(&mut self, ui: &Ui<'_>)

Updates the options with values from the Ui

source

pub fn render_options_menus(&mut self, ui: &Ui<'_>, pos: [f32; 2])

Renders the options menus for window style & position.

source

pub fn render_style_options(&mut self, ui: &Ui<'_>)

Renders the window style options.

source§

impl WindowOptions

source

pub fn render_window<'ui>( &mut self, ui: &'ui Ui<'_>, name: &str ) -> Option<WindowToken<'ui>>

Renders the window according to the options.

Trait Implementations§

source§

impl Clone for WindowOptions

source§

fn clone(&self) -> WindowOptions

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for WindowOptions

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for WindowOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Hideable for WindowOptions

source§

fn is_visible(&self) -> bool

Returns whether the component is currently visible.
source§

fn visible_mut(&mut self) -> &mut bool

Returns a mutable reference to the component’s visibility state.
source§

fn hide(&mut self)

Hides the component.
source§

fn show(&mut self)

Shows the component.
source§

fn toggle_visibility(&mut self)

Toggles the component’s visibility.
source§

fn set_visibility(&mut self, visible: bool)

Sets the component’s visibility state.

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.