[−][src]Struct thyme::PersistentState
The internal state stored by Thyme for a given Widget that persists between frames.
Note that Thyme will generally be able to automatically generate unique IDs for many widgets such as buttons. But, if you want to access this data for a particular widget you will need to specify a known ID for that widget.
Example
fn reset_window_state(ui: &mut Frame, window_id: &str) { ui.modify(window_id, |state| { state.resize = Point::default(); state.moved = Point::default(); state.is_open = true; }); }
Fields
is_open: bool
Whether the widget will be shown. Defaults to true.
expanded: bool
Whether a tree or similar widget is expanded, showing all children, or not
resize: Point
An amount, in logical pixels that the widget has been resized by. Default to zero.
moved: Point
An amount, in logical pizels that the widget has been moved by. Defaults to zero.
scroll: Point
An amount, in logical pixels that the internal content has been scrolled by. Defaults to zero.
base_time_millis: u32
The "zero" time for timed images associated with this widget. Defaults to zero,
which is the internal Context
init time.
characters: Vec<char>
Any characters that have been sent to this widget from the keyboard. Defaults to empty. Widgets should typically drain this list as they work with input.
text: Option<String>
The text for this widget, overriding default text. Defaults to None
.
Trait Implementations
impl Debug for PersistentState
[src]
impl Default for PersistentState
[src]
Auto Trait Implementations
impl RefUnwindSafe for PersistentState
impl Send for PersistentState
impl Sync for PersistentState
impl Unpin for PersistentState
impl UnwindSafe for PersistentState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,