Struct egui::memory::Focus

source ·
pub(crate) struct Focus {
    pub(crate) id: Option<Id>,
    id_previous_frame: Option<Id>,
    id_next_frame: Option<Id>,
    give_to_next: bool,
    last_interested: Option<Id>,
    is_focus_locked: bool,
    pressed_tab: bool,
    pressed_shift_tab: bool,
}
Expand description

Keeps tracks of what widget has keyboard focus

Fields§

§id: Option<Id>

The widget with keyboard focus (i.e. a text input field).

§id_previous_frame: Option<Id>

What had keyboard focus previous frame?

§id_next_frame: Option<Id>

Give focus to this widget next frame

§give_to_next: bool

If set, the next widget that is interested in focus will automatically get it. Probably because the user pressed Tab.

§last_interested: Option<Id>

The last widget interested in focus.

§is_focus_locked: bool

If true, pressing tab will NOT move focus away from the current widget.

§pressed_tab: bool

Set at the beginning of the frame, set to false when “used”.

§pressed_shift_tab: bool

Set at the beginning of the frame, set to false when “used”.

Implementations§

source§

impl Focus

source

pub fn focused(&self) -> Option<Id>

Which widget currently has keyboard focus?

source

fn begin_frame(&mut self, new_input: &RawInput)

source

pub(crate) fn end_frame(&mut self, used_ids: &IdMap<Rect>)

source

pub(crate) fn had_focus_last_frame(&self, id: Id) -> bool

source

fn interested_in_focus(&mut self, id: Id)

Trait Implementations§

source§

impl Clone for Focus

source§

fn clone(&self) -> Focus

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 Focus

source§

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

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

impl Default for Focus

source§

fn default() -> Focus

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

Auto Trait Implementations§

§

impl RefUnwindSafe for Focus

§

impl Send for Focus

§

impl Sync for Focus

§

impl Unpin for Focus

§

impl UnwindSafe for Focus

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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 Twhere 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.
source§

impl<T> SerializableAny for Twhere T: 'static + Any + Clone + Send + Sync,