Struct arc_util::ui::window::Window

source ·
pub struct Window<T> {
    pub name: String,
    pub inner: T,
    pub options: WindowOptions,
}
Expand description

Window component.

Fields§

§name: String

The name (title) of the window.

§inner: T

Inner Component responsible for rendering content.

§options: WindowOptions

Current window options state.

Implementations§

source§

impl<T> Window<T>

source

pub fn new<P>(name: impl Into<String>, inner: T, options: WindowOptions) -> Self
where T: Windowable<P>,

Creates a new window with WindowOptions and the passed Windowable component.

source

pub fn with_default<P>(name: impl Into<String>, options: WindowOptions) -> Self
where T: Default + Windowable<P>,

Creates a new window with WindowOptions and a default Windowable component.

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.

Trait Implementations§

source§

impl<T: Clone> Clone for Window<T>

source§

fn clone(&self) -> Window<T>

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<T, P> Component<P> for Window<T>
where T: Windowable<P>,

source§

fn render(&mut self, ui: &Ui<'_>, props: P)

Renders the component.
source§

impl<T: Debug> Debug for Window<T>

source§

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

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

impl<T> Deref for Window<T>

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T> DerefMut for Window<T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<T> HasSettings for Window<T>
where T: HasSettings,

§

type Settings = WindowSettings<T>

source§

const SETTINGS_ID: &'static str = T::SETTINGS_ID

The component’s settings id.
source§

fn current_settings(&self) -> Self::Settings

Returns the component’s current settings state.
source§

fn load_settings(&mut self, loaded: Self::Settings)

Loads the component’s settings from a loaded state.
source§

impl<T> Hideable for Window<T>

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§

§

impl<T> Freeze for Window<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Window<T>
where T: RefUnwindSafe,

§

impl<T> Send for Window<T>
where T: Send,

§

impl<T> Sync for Window<T>
where T: Sync,

§

impl<T> Unpin for Window<T>
where T: Unpin,

§

impl<T> UnwindSafe for Window<T>
where T: UnwindSafe,

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.