Ui

Struct Ui 

Source
pub struct Ui<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Ui<'a>

Source

pub fn adhoc<'v, A>(&self, view: A) -> A::Output
where A: Adhoc<'v>,

Source

pub fn show<'v, B>(&self, args: B) -> Response<<B::View as View>::Response>
where B: Builder<'v>,

Source

pub fn show_children<'v, B, R>( &self, args: B, show: impl FnOnce(&Self) -> R, ) -> Response<(<B::View as View>::Response, R)>
where B: Builder<'v>, R: 'static,

Source§

impl<'a> Ui<'a>

Source

pub fn client_rect(&self) -> Rect

Source

pub fn current_available_rect(&self) -> Rect

Source

pub fn frame_count(&self) -> u64

Source

pub fn dt(&self) -> f32

Source

pub fn size_changed(&self) -> Option<Vec2>

Source

pub fn palette(&self) -> Ref<'_, Palette>

Source

pub fn set_palette(&self, palette: Palette)

Source§

impl<'a> Ui<'a>

Source

pub fn key_pressed(&self, keybind: impl Into<Keybind>) -> bool

Source

pub fn cursor_pos(&self) -> Pos2

Source

pub fn is_hovered(&self) -> bool

Source

pub fn is_parent_hovered(&self) -> bool

Source

pub fn is_focused(&self) -> bool

Source

pub fn is_parent_focused(&self) -> bool

Source

pub fn set_focus(&self, id: impl Into<Option<ViewId>>)

Source§

impl<'a> Ui<'a>

Source

pub fn current(&self) -> ViewId

Source

pub fn children(&self) -> RefMapped<'_, [ViewId]>

Source

pub fn children_for(&self, id: ViewId) -> Option<RefMapped<'_, [ViewId]>>

Source§

impl<'a> Ui<'a>

Source

pub fn layer<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn new_layer<R>( &self, layer: Layer, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn float<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source§

impl<'a> Ui<'a>

Source

pub fn center<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn aligned<R>( &self, align: Align2, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn margin<R>( &self, margin: impl Into<Margin>, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn background<R>( &self, bg: impl Into<Rgba>, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn offset<R>( &self, offset: impl Into<Pos2>, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn exact_size<R>( &self, size: impl Into<Size>, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn exact_height<R>( &self, height: i32, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn exact_width<R>( &self, width: i32, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn constrain<R>( &self, constrain: Constrain, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn unconstrained<R>( &self, unconstrained: Unconstrained, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn draggable<R>( &self, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<(Option<DraggingResponse>, R)>
where R: 'static,

Source

pub fn mouse_area<R>( &self, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<(MouseAreaResponse, R)>
where R: 'static,

Source

pub fn key_area<R>( &self, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<(KeyAreaResponse, R)>
where R: 'static,

Source

pub fn progress(&self, value: f32) -> Response

Source

pub fn text_input(&self, focus: bool) -> Response<TextInputResponse>

Source

pub fn slider(&self, value: &mut f32) -> Response

Source

pub fn toggle<R>( &self, state: bool, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<(ToggleResponse, R)>
where R: 'static,

Source

pub fn toggle_switch(&self, value: &mut bool) -> Response<ToggleResponse>

Source

pub fn button(&self, label: impl Into<Str>) -> Response<ButtonResponse>

Source

pub fn checkbox( &self, value: &mut bool, label: impl Into<Str>, ) -> Response<bool>

Source

pub fn todo_value( &self, value: &mut bool, label: impl Into<Str>, ) -> Response<bool>

Source

pub fn selected( &self, value: &mut bool, label: impl Into<Str>, ) -> Response<bool>

Source

pub fn radio<V>( &self, value: V, existing: &mut V, label: impl Into<Str>, ) -> Response<bool>
where V: PartialEq,

Source

pub fn label(&self, data: impl Into<Str>) -> Response

Source

pub fn expand<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn flex<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn vertical_wrap<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn horizontal_wrap<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn expand_space(&self) -> Response

Source

pub fn expand_axis(&self) -> Response

Source

pub fn separator(&self) -> Response

Source

pub fn vertical<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn horizontal<R>(&self, show: impl FnOnce(&Ui<'_>) -> R) -> Response<R>
where R: 'static,

Source

pub fn border<R>( &self, border: Border, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Source

pub fn frame<R>( &self, border: Border, title: impl Into<Str>, show: impl FnOnce(&Ui<'_>) -> R, ) -> Response<R>
where R: 'static,

Auto Trait Implementations§

§

impl<'a> Freeze for Ui<'a>

§

impl<'a> !RefUnwindSafe for Ui<'a>

§

impl<'a> !Send for Ui<'a>

§

impl<'a> !Sync for Ui<'a>

§

impl<'a> Unpin for Ui<'a>

§

impl<'a> !UnwindSafe for Ui<'a>

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.