diff --git a/main/gooey/animation/trait.LinearInterpolate.html b/main/gooey/animation/trait.LinearInterpolate.html index d417d5ffc..8b5cad0b5 100644 --- a/main/gooey/animation/trait.LinearInterpolate.html +++ b/main/gooey/animation/trait.LinearInterpolate.html @@ -35,6 +35,6 @@ assert_eq!(Enum::A.lerp(&Enum::C, 0.4), Enum::B); assert_eq!(Enum::A.lerp(&Enum::C, 0.9), Enum::C);

Required Methods§

source

fn lerp(&self, target: &Self, percent: f32) -> Self

Interpolate linearly between self and target using percent.

-

Implementations on Foreign Types§

source§

impl LinearInterpolate for f32

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for usize

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for bool

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for UPx

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i16

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i64

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u16

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u8

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Lp

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i32

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Color

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i8

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u32

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u128

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u64

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i128

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for isize

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for f64

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Angle

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Px

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

Implementors§

source§

impl LinearInterpolate for ThemeMode

source§

impl LinearInterpolate for ButtonColors

source§

impl LinearInterpolate for ZeroToOne

source§

impl<T> LinearInterpolate for BinaryLerp<T>where +

Implementations on Foreign Types§

source§

impl LinearInterpolate for f32

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for usize

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for bool

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for UPx

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i16

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i64

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u16

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u8

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Lp

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i32

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Color

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i8

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u32

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u128

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for u64

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for i128

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for isize

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for f64

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Angle

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

source§

impl LinearInterpolate for Px

source§

fn lerp(&self, target: &Self, percent: f32) -> Self

Implementors§

source§

impl LinearInterpolate for ThemeMode

source§

impl LinearInterpolate for ButtonColors

source§

impl LinearInterpolate for ZeroToOne

source§

impl<T> LinearInterpolate for BinaryLerp<T>where T: Clone + PartialEq,

source§

impl<T> LinearInterpolate for ImmediateLerp<T>where T: Clone + PartialEq,

\ No newline at end of file diff --git a/main/gooey/animation/trait.PercentBetween.html b/main/gooey/animation/trait.PercentBetween.html index 170145c28..e56419a56 100644 --- a/main/gooey/animation/trait.PercentBetween.html +++ b/main/gooey/animation/trait.PercentBetween.html @@ -3,4 +3,4 @@ fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne; }
Expand description

Calculates the ratio of one value against a minimum and maximum.

Required Methods§

source

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

Return the percentage that self is between min and max.

-

Implementations on Foreign Types§

source§

impl PercentBetween for i64

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for f64

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u128

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for UPx

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i128

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for Px

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u8

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for Lp

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for Color

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u16

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for bool

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u32

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i8

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for usize

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i16

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for f32

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u64

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i32

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for isize

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

Implementors§

source§

impl PercentBetween for ThemeMode

source§

impl PercentBetween for ZeroToOne

\ No newline at end of file +

Implementations on Foreign Types§

source§

impl PercentBetween for i64

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for f64

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u128

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for UPx

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i128

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for Px

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u8

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for Lp

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for Color

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u16

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for bool

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u32

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i8

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for usize

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i16

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for f32

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for u64

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for i32

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

source§

impl PercentBetween for isize

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

Implementors§

source§

impl PercentBetween for ThemeMode

source§

impl PercentBetween for ZeroToOne

\ No newline at end of file diff --git a/main/gooey/context/enum.Exclusive.html b/main/gooey/context/enum.Exclusive.html index 8ec317745..4fa4d849d 100644 --- a/main/gooey/context/enum.Exclusive.html +++ b/main/gooey/context/enum.Exclusive.html @@ -1,10 +1,10 @@ -Exclusive in gooey::context - Rust

Enum gooey::context::Exclusive

source ·
pub enum Exclusive<'a, T> {
+Exclusive in gooey::context - Rust

Enum gooey::context::Exclusive

source ·
pub enum Exclusive<'a, T> {
     Borrowed(&'a mut T),
     Owned(T),
 }
Expand description

An owned T or an exclusive reference to a T.

Variants§

§

Borrowed(&'a mut T)

An exclusive borrow.

§

Owned(T)

An owned instance.

-

Trait Implementations§

source§

impl<T> Deref for Exclusive<'_, T>

§

type Target = T

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<T> DerefMut for Exclusive<'_, T>

source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for Exclusive<'a, T>where +

Trait Implementations§

source§

impl<T> Deref for Exclusive<'_, T>

§

type Target = T

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<T> DerefMut for Exclusive<'_, T>

source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> RefUnwindSafe for Exclusive<'a, T>where T: RefUnwindSafe,

§

impl<'a, T> Send for Exclusive<'a, T>where T: Send,

§

impl<'a, T> Sync for Exclusive<'a, T>where T: Sync,

§

impl<'a, T> Unpin for Exclusive<'a, T>where diff --git a/main/gooey/context/index.html b/main/gooey/context/index.html index 431be9d6e..600f92cb4 100644 --- a/main/gooey/context/index.html +++ b/main/gooey/context/index.html @@ -1,2 +1,2 @@ -gooey::context - Rust

Module gooey::context

source ·
Expand description

Types that provide access to the Gooey runtime.

+gooey::context - Rust

Module gooey::context

source ·
Expand description

Types that provide access to the Gooey runtime.

Structs

Enums

  • An owned T or an exclusive reference to a T.

Traits

\ No newline at end of file diff --git a/main/gooey/context/struct.EventContext.html b/main/gooey/context/struct.EventContext.html index 523775ffc..aa5be8bd2 100644 --- a/main/gooey/context/struct.EventContext.html +++ b/main/gooey/context/struct.EventContext.html @@ -1,4 +1,4 @@ -EventContext in gooey::context - Rust

Struct gooey::context::EventContext

source ·
pub struct EventContext<'context, 'window> {
+EventContext in gooey::context - Rust

Struct gooey::context::EventContext

source ·
pub struct EventContext<'context, 'window> {
     pub widget: WidgetContext<'context, 'window>,
     pub kludgine: &'context mut Kludgine,
 }
Expand description

A context to an event function.

@@ -8,7 +8,7 @@
§kludgine: &'context mut Kludgine

The rendering library’s state.

This is useful for accessing the current scale or information needed to measure and layout text.

-

Implementations§

source§

impl<'context, 'window> EventContext<'context, 'window>

source

pub fn for_other<'child, Widget>( +

Implementations§

source§

impl<'context, 'window> EventContext<'context, 'window>

source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<EventContext<'child, 'window>>>::Resultwhere @@ -19,129 +19,129 @@ parent widget needs to invoke events on a child widget. This is done by creating an EventContext pointing to the child and calling the appropriate function to invoke the event.

-

source

pub fn hit_test(&mut self, location: Point<Px>) -> bool

Invokes Widget::hit_test() on this +

source

pub fn hit_test(&mut self, location: Point<Px>) -> bool

Invokes Widget::hit_test() on this context’s widget and returns the result.

-
source

pub fn mouse_down( +

source

pub fn mouse_down( &mut self, location: Point<Px>, device_id: DeviceId, button: MouseButton ) -> EventHandling

Invokes Widget::mouse_down() on this context’s widget and returns the result.

-
source

pub fn mouse_drag( +

source

pub fn mouse_drag( &mut self, location: Point<Px>, device_id: DeviceId, button: MouseButton )

Invokes Widget::hit_test() on this context’s widget and returns the result.

-
source

pub fn mouse_up( +

source

pub fn mouse_up( &mut self, location: Option<Point<Px>>, device_id: DeviceId, button: MouseButton )

Invokes Widget::mouse_up() on this context’s widget and returns the result.

-
source

pub fn keyboard_input( +

source

pub fn keyboard_input( &mut self, device_id: DeviceId, input: KeyEvent, is_synthetic: bool ) -> EventHandling

Invokes Widget::keyboard_input() on this context’s widget and returns the result.

-
source

pub fn ime(&mut self, ime: Ime) -> EventHandling

Invokes Widget::ime() on this +

source

pub fn ime(&mut self, ime: Ime) -> EventHandling

Invokes Widget::ime() on this context’s widget and returns the result.

-
source

pub fn mouse_wheel( +

source

pub fn mouse_wheel( &mut self, device_id: DeviceId, delta: MouseScrollDelta, phase: TouchPhase ) -> EventHandling

Invokes Widget::mouse_wheel() on this context’s widget and returns the result.

-
source

pub fn advance_focus(&mut self)

Advances the focus to the next widget after this widget in the +

source

pub fn advance_focus(&mut self)

Advances the focus to the next widget after this widget in the configured focus order.

To focus in the reverse order, use EventContext::return_focus().

-
source

pub fn return_focus(&mut self)

Returns the focus to the previous widget before this widget in the +

source

pub fn return_focus(&mut self)

Returns the focus to the previous widget before this widget in the configured fous order.

To focus in the forward order, use EventContext::advance_focus().

-
source

pub fn root_behavior(&mut self) -> Option<(RootBehavior, WidgetInstance)>

Invokes +

source

pub fn root_behavior(&mut self) -> Option<(RootBehavior, WidgetInstance)>

Invokes Widget::root_behavior() on this context’s widget and returns the result.

-

Methods from Deref<Target = WidgetContext<'context, 'window>>§

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

-
source

pub fn for_other<'child, Widget>( +

Methods from Deref<Target = WidgetContext<'context, 'window>>§

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

+
source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<WidgetContext<'child, 'window>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<WidgetContext<'child, 'window>>,

Returns a new context representing widget.

-
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

-
source

pub fn enabled(&self) -> bool

Returns true if this widget is enabled.

-
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

-
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

+
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

+
source

pub fn enabled(&self) -> bool

Returns true if this widget is enabled.

+
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

+
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

+
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

Returns true if this function resulted in the focus being changed.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a +

source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a returning motion.

This value is meaningless outside of focus-related events.

-
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

+
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

Returns true if this function resulted in the currently active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

+
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

Returns true if this function resulted in the active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

-
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is +

source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

+
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is over a child widget.

-
source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

-
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

-
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

+
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

+
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user triggers a default action.

See MakeWidget::into_default() for more information.

-
source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user triggers an escape action.

See MakeWidget::into_escape() for more information.

-
source

pub fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

-
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

+
source

pub fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

+
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

Style queries for children will return any values matching this collection.

-
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

+
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

All children nodes will access this theme in their contexts.

-
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

+
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

All children nodes will use this theme mode.

-
source

pub fn get<Component: ComponentDefinition>( +

source

pub fn get<Component: ComponentDefinition>( &self, query: &Component ) -> Component::ComponentType

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned. Otherwise, the default value will be returned.

-
source

pub fn try_get<Component: ComponentDefinition>( +

source

pub fn try_get<Component: ComponentDefinition>( &self, query: &Component ) -> Option<Component::ComponentType>

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned.

-
source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

-
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

-
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

-
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

-
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

-
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate +

source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

+
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

+
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

+
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

+
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

+
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate caches it stores.

Methods from Deref<Target = RunningWindow<'window>>§

source

pub fn focused(&self) -> &Dynamic<bool>

Returns a dynamic that is updated whenever this window’s focus status changes.

@@ -193,8 +193,8 @@

pub fn modifiers(&self) -> Modifiers

Returns currently active modifiers.

pub fn set_min_inner_size(&self, min_size: Option<Size<UPx>>)

Sets the window’s minimum inner size.

pub fn set_max_inner_size(&self, max_size: Option<Size<UPx>>)

Sets the window’s maximum inner size.

-

Trait Implementations§

source§

impl<'window> AsEventContext<'window> for EventContext<'_, 'window>

source§

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.
source§

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the -context’s widget.
source§

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.
source§

impl<'context, 'window> Deref for EventContext<'context, 'window>

§

type Target = WidgetContext<'context, 'window>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'context, 'window> DerefMut for EventContext<'context, 'window>

source§

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

Mutably dereferences the value.
source§

impl Drop for EventContext<'_, '_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'context, 'window> !RefUnwindSafe for EventContext<'context, 'window>

§

impl<'context, 'window> Send for EventContext<'context, 'window>

§

impl<'context, 'window> !Sync for EventContext<'context, 'window>

§

impl<'context, 'window> Unpin for EventContext<'context, 'window>

§

impl<'context, 'window> !UnwindSafe for EventContext<'context, 'window>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +

Trait Implementations§

source§

impl<'window> AsEventContext<'window> for EventContext<'_, 'window>

source§

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.
source§

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the +context’s widget.
source§

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.
source§

impl<'context, 'window> Deref for EventContext<'context, 'window>

§

type Target = WidgetContext<'context, 'window>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'context, 'window> DerefMut for EventContext<'context, 'window>

source§

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

Mutably dereferences the value.
source§

impl Drop for EventContext<'_, '_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'context, 'window> !RefUnwindSafe for EventContext<'context, 'window>

§

impl<'context, 'window> Send for EventContext<'context, 'window>

§

impl<'context, 'window> !Sync for EventContext<'context, 'window>

§

impl<'context, 'window> Unpin for EventContext<'context, 'window>

§

impl<'context, 'window> !UnwindSafe for EventContext<'context, 'window>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/context/struct.GraphicsContext.html b/main/gooey/context/struct.GraphicsContext.html index ff367d89d..7bbf55eaf 100644 --- a/main/gooey/context/struct.GraphicsContext.html +++ b/main/gooey/context/struct.GraphicsContext.html @@ -1,4 +1,4 @@ -GraphicsContext in gooey::context - Rust
pub struct GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass> {
+GraphicsContext in gooey::context - Rust
pub struct GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass> {
     pub widget: WidgetContext<'context, 'window>,
     pub gfx: Exclusive<'context, Graphics<'clip, 'gfx, 'pass>>,
 }
Expand description

A context to a function that is rendering a widget.

@@ -6,112 +6,112 @@
§gfx: Exclusive<'context, Graphics<'clip, 'gfx, 'pass>>

The graphics context clipped and offset to the area of the widget being rendered. Drawing at 0,0 will draw at the top-left pixel of the laid-out widget region.

-

Implementations§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

source

pub fn borrowed(&mut self) -> GraphicsContext<'_, 'window, 'clip, 'gfx, 'pass>

Returns a new instance that borrows from self.

-
source

pub fn for_other<'child, Widget>( +

Implementations§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

source

pub fn borrowed(&mut self) -> GraphicsContext<'_, 'window, 'clip, 'gfx, 'pass>

Returns a new instance that borrows from self.

+
source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<GraphicsContext<'child, 'window, 'child, 'gfx, 'pass>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<GraphicsContext<'child, 'window, 'child, 'gfx, 'pass>>,

Returns a new GraphicsContext that allows invoking graphics functions for widget.

-
source

pub fn apply_opacity(&mut self, opacity: impl Into<ZeroToOne>)

Updates self to have opacity.

+
source

pub fn apply_opacity(&mut self, opacity: impl Into<ZeroToOne>)

Updates self to have opacity.

This setting will be mixed with the current opacity value.

-
source

pub fn clipped_to( +

source

pub fn clipped_to( &mut self, clip: Rect<Px> ) -> GraphicsContext<'_, 'window, '_, 'gfx, 'pass>

Returns a new graphics context that renders to the clip rectangle.

-
source

pub fn fill(&mut self, color: Color)

Fills the background of this widget with color, honoring the current +

source

pub fn fill(&mut self, color: Color)

Fills the background of this widget with color, honoring the current CornerRadius setting.

If the alpha channel of color is 0, this function does nothing.

-
source

pub fn stroke_outline<Unit>( +

source

pub fn stroke_outline<Unit>( &mut self, color: Color, options: StrokeOptions<Unit> )where Unit: ScreenScale<Px = Px, Lp = Lp, UPx = UPx> + Zero,

Strokes an outline around this widget’s contents.

-
source

pub fn draw_focus_ring(&mut self)

Renders the default focus ring for this widget.

-
source

pub fn apply_current_font_settings(&mut self)

Applies the current style settings for font family, text size, font +

source

pub fn draw_focus_ring(&mut self)

Renders the default focus ring for this widget.

+
source

pub fn apply_current_font_settings(&mut self)

Applies the current style settings for font family, text size, font style, and font weight.

-
source

pub fn redraw(&mut self)

Invokes Widget::redraw() on this +

source

pub fn redraw(&mut self)

Invokes Widget::redraw() on this context’s widget.

Panics

This function panics if the widget being drawn has no layout set (via LayoutContext::set_child_layout()).

-

Methods from Deref<Target = WidgetContext<'context, 'window>>§

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

-
source

pub fn for_other<'child, Widget>( +

Methods from Deref<Target = WidgetContext<'context, 'window>>§

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

+
source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<WidgetContext<'child, 'window>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<WidgetContext<'child, 'window>>,

Returns a new context representing widget.

-
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

-
source

pub fn enabled(&self) -> bool

Returns true if this widget is enabled.

-
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

-
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

+
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

+
source

pub fn enabled(&self) -> bool

Returns true if this widget is enabled.

+
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

+
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

+
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

Returns true if this function resulted in the focus being changed.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a +

source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a returning motion.

This value is meaningless outside of focus-related events.

-
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

+
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

Returns true if this function resulted in the currently active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

+
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

Returns true if this function resulted in the active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

-
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is +

source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

+
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is over a child widget.

-
source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

-
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

-
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

+
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

+
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user triggers a default action.

See MakeWidget::into_default() for more information.

-
source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user triggers an escape action.

See MakeWidget::into_escape() for more information.

-
source

pub fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

-
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

+
source

pub fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

+
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

Style queries for children will return any values matching this collection.

-
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

+
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

All children nodes will access this theme in their contexts.

-
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

+
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

All children nodes will use this theme mode.

-
source

pub fn get<Component: ComponentDefinition>( +

source

pub fn get<Component: ComponentDefinition>( &self, query: &Component ) -> Component::ComponentType

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned. Otherwise, the default value will be returned.

-
source

pub fn try_get<Component: ComponentDefinition>( +

source

pub fn try_get<Component: ComponentDefinition>( &self, query: &Component ) -> Option<Component::ComponentType>

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned.

-
source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

-
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

-
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

-
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

-
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

-
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate +

source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

+
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

+
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

+
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

+
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

+
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate caches it stores.

Methods from Deref<Target = RunningWindow<'window>>§

source

pub fn focused(&self) -> &Dynamic<bool>

Returns a dynamic that is updated whenever this window’s focus status changes.

@@ -163,8 +163,8 @@
Panics

pub fn modifiers(&self) -> Modifiers

Returns currently active modifiers.

pub fn set_min_inner_size(&self, min_size: Option<Size<UPx>>)

Sets the window’s minimum inner size.

pub fn set_max_inner_size(&self, max_size: Option<Size<UPx>>)

Sets the window’s maximum inner size.

-

Trait Implementations§

source§

impl<'window> AsEventContext<'window> for GraphicsContext<'_, 'window, '_, '_, '_>

source§

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.
source§

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the -context’s widget.
source§

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> Deref for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

type Target = WidgetContext<'context, 'window>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> DerefMut for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

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

Mutably dereferences the value.
source§

impl Drop for GraphicsContext<'_, '_, '_, '_, '_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !RefUnwindSafe for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Send for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !Sync for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Unpin for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !UnwindSafe for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +

Trait Implementations§

source§

impl<'window> AsEventContext<'window> for GraphicsContext<'_, 'window, '_, '_, '_>

source§

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.
source§

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the +context’s widget.
source§

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> Deref for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

type Target = WidgetContext<'context, 'window>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> DerefMut for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

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

Mutably dereferences the value.
source§

impl Drop for GraphicsContext<'_, '_, '_, '_, '_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !RefUnwindSafe for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Send for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !Sync for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Unpin for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !UnwindSafe for GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/context/struct.LayoutContext.html b/main/gooey/context/struct.LayoutContext.html index 9d56c5504..665c038a3 100644 --- a/main/gooey/context/struct.LayoutContext.html +++ b/main/gooey/context/struct.LayoutContext.html @@ -1,131 +1,131 @@ -LayoutContext in gooey::context - Rust
pub struct LayoutContext<'context, 'window, 'clip, 'gfx, 'pass> {
+LayoutContext in gooey::context - Rust
pub struct LayoutContext<'context, 'window, 'clip, 'gfx, 'pass> {
     pub graphics: GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>,
     /* private fields */
 }
Expand description

A context to a function that is rendering a widget.

Fields§

§graphics: GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

The graphics context that this layout operation is being performed within.

-

Implementations§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source

pub fn as_temporary(self) -> Self

Returns a new layout context that does not persist any child layout +

Implementations§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source

pub fn as_temporary(self) -> Self

Returns a new layout context that does not persist any child layout operations.

This type of context is useful for asking widgets to measuree themselves in hypothetical layout conditions while trying to determine the best layout for a composite control.

-
source

pub fn for_other<'child, Widget>( +

source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<LayoutContext<'child, 'window, 'child, 'gfx, 'pass>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<LayoutContext<'child, 'window, 'child, 'gfx, 'pass>>,

Returns a new LayoutContext that allows invoking layout functions for widget.

-
source

pub fn layout(&mut self, available_space: Size<ConstraintLimit>) -> Size<UPx>

Invokes Widget::layout() on this +

source

pub fn layout(&mut self, available_space: Size<ConstraintLimit>) -> Size<UPx>

Invokes Widget::layout() on this context’s widget and returns the result.

-
source

pub fn set_child_layout(&mut self, child: &MountedWidget, layout: Rect<Px>)

Sets the layout for child to layout.

+
source

pub fn set_child_layout(&mut self, child: &MountedWidget, layout: Rect<Px>)

Sets the layout for child to layout.

layout is relative to the current widget’s controls.

-

Methods from Deref<Target = GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>>§

source

pub fn borrowed(&mut self) -> GraphicsContext<'_, 'window, 'clip, 'gfx, 'pass>

Returns a new instance that borrows from self.

-
source

pub fn for_other<'child, Widget>( +

Methods from Deref<Target = GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>>§

source

pub fn borrowed(&mut self) -> GraphicsContext<'_, 'window, 'clip, 'gfx, 'pass>

Returns a new instance that borrows from self.

+
source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<GraphicsContext<'child, 'window, 'child, 'gfx, 'pass>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<GraphicsContext<'child, 'window, 'child, 'gfx, 'pass>>,

Returns a new GraphicsContext that allows invoking graphics functions for widget.

-
source

pub fn apply_opacity(&mut self, opacity: impl Into<ZeroToOne>)

Updates self to have opacity.

+
source

pub fn apply_opacity(&mut self, opacity: impl Into<ZeroToOne>)

Updates self to have opacity.

This setting will be mixed with the current opacity value.

-
source

pub fn clipped_to( +

source

pub fn clipped_to( &mut self, clip: Rect<Px> ) -> GraphicsContext<'_, 'window, '_, 'gfx, 'pass>

Returns a new graphics context that renders to the clip rectangle.

-
source

pub fn fill(&mut self, color: Color)

Fills the background of this widget with color, honoring the current +

source

pub fn fill(&mut self, color: Color)

Fills the background of this widget with color, honoring the current CornerRadius setting.

If the alpha channel of color is 0, this function does nothing.

-
source

pub fn stroke_outline<Unit>( +

source

pub fn stroke_outline<Unit>( &mut self, color: Color, options: StrokeOptions<Unit> )where Unit: ScreenScale<Px = Px, Lp = Lp, UPx = UPx> + Zero,

Strokes an outline around this widget’s contents.

-
source

pub fn draw_focus_ring(&mut self)

Renders the default focus ring for this widget.

-
source

pub fn apply_current_font_settings(&mut self)

Applies the current style settings for font family, text size, font +

source

pub fn draw_focus_ring(&mut self)

Renders the default focus ring for this widget.

+
source

pub fn apply_current_font_settings(&mut self)

Applies the current style settings for font family, text size, font style, and font weight.

-
source

pub fn redraw(&mut self)

Invokes Widget::redraw() on this +

source

pub fn redraw(&mut self)

Invokes Widget::redraw() on this context’s widget.

Panics

This function panics if the widget being drawn has no layout set (via LayoutContext::set_child_layout()).

-

Methods from Deref<Target = WidgetContext<'context, 'window>>§

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

-
source

pub fn for_other<'child, Widget>( +

Methods from Deref<Target = WidgetContext<'context, 'window>>§

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

+
source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<WidgetContext<'child, 'window>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<WidgetContext<'child, 'window>>,

Returns a new context representing widget.

-
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

-
source

pub fn enabled(&self) -> bool

Returns true if this widget is enabled.

-
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

-
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

+
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

+
source

pub fn enabled(&self) -> bool

Returns true if this widget is enabled.

+
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

+
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

+
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

Returns true if this function resulted in the focus being changed.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a +

source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a returning motion.

This value is meaningless outside of focus-related events.

-
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

+
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

Returns true if this function resulted in the currently active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

+
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

Returns true if this function resulted in the active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

-
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is +

source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

+
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is over a child widget.

-
source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

-
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

-
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

+
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

+
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user triggers a default action.

See MakeWidget::into_default() for more information.

-
source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user triggers an escape action.

See MakeWidget::into_escape() for more information.

-
source

pub fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

-
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

+
source

pub fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

+
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

Style queries for children will return any values matching this collection.

-
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

+
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

All children nodes will access this theme in their contexts.

-
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

+
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

All children nodes will use this theme mode.

-
source

pub fn get<Component: ComponentDefinition>( +

source

pub fn get<Component: ComponentDefinition>( &self, query: &Component ) -> Component::ComponentType

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned. Otherwise, the default value will be returned.

-
source

pub fn try_get<Component: ComponentDefinition>( +

source

pub fn try_get<Component: ComponentDefinition>( &self, query: &Component ) -> Option<Component::ComponentType>

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned.

-
source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

-
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

-
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

-
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

-
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

-
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate +

source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

+
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

+
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

+
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

+
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

+
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate caches it stores.

Methods from Deref<Target = RunningWindow<'window>>§

source

pub fn focused(&self) -> &Dynamic<bool>

Returns a dynamic that is updated whenever this window’s focus status changes.

@@ -177,8 +177,8 @@
Panics

pub fn modifiers(&self) -> Modifiers

Returns currently active modifiers.

pub fn set_min_inner_size(&self, min_size: Option<Size<UPx>>)

Sets the window’s minimum inner size.

pub fn set_max_inner_size(&self, max_size: Option<Size<UPx>>)

Sets the window’s maximum inner size.

-

Trait Implementations§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> AsEventContext<'window> for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.
source§

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the -context’s widget.
source§

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> Deref for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

type Target = GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> DerefMut for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !RefUnwindSafe for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Send for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !Sync for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Unpin for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !UnwindSafe for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +

Trait Implementations§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> AsEventContext<'window> for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.
source§

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the +context’s widget.
source§

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> Deref for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

type Target = GraphicsContext<'context, 'window, 'clip, 'gfx, 'pass>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'context, 'window, 'clip, 'gfx, 'pass> DerefMut for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !RefUnwindSafe for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Send for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !Sync for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> Unpin for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

§

impl<'context, 'window, 'clip, 'gfx, 'pass> !UnwindSafe for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/context/struct.WidgetCacheKey.html b/main/gooey/context/struct.WidgetCacheKey.html index d05e0d729..376d96707 100644 --- a/main/gooey/context/struct.WidgetCacheKey.html +++ b/main/gooey/context/struct.WidgetCacheKey.html @@ -1,9 +1,9 @@ -WidgetCacheKey in gooey::context - Rust
pub struct WidgetCacheKey { /* private fields */ }
Expand description

An type that contains information about the state of a widget.

+WidgetCacheKey in gooey::context - Rust
pub struct WidgetCacheKey { /* private fields */ }
Expand description

An type that contains information about the state of a widget.

This value can be stored and compared in future widget events. If the cache keys are not equal, the widget should clear all caches.

-

Trait Implementations§

source§

impl Clone for WidgetCacheKey

source§

fn clone(&self) -> WidgetCacheKey

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 WidgetCacheKey

source§

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

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

impl Default for WidgetCacheKey

source§

fn default() -> Self

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

impl PartialEq<WidgetCacheKey> for WidgetCacheKey

source§

fn eq(&self, other: &WidgetCacheKey) -> bool

This method tests for self and other values to be equal, and is used +

Trait Implementations§

source§

impl Clone for WidgetCacheKey

source§

fn clone(&self) -> WidgetCacheKey

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 WidgetCacheKey

source§

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

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

impl Default for WidgetCacheKey

source§

fn default() -> Self

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

impl PartialEq<WidgetCacheKey> for WidgetCacheKey

source§

fn eq(&self, other: &WidgetCacheKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for WidgetCacheKey

source§

impl Eq for WidgetCacheKey

source§

impl StructuralEq for WidgetCacheKey

source§

impl StructuralPartialEq for WidgetCacheKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +sufficient, and should not be overridden without very good reason.

source§

impl Copy for WidgetCacheKey

source§

impl Eq for WidgetCacheKey

source§

impl StructuralEq for WidgetCacheKey

source§

impl StructuralPartialEq for WidgetCacheKey

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/context/struct.WidgetContext.html b/main/gooey/context/struct.WidgetContext.html index fe3fc4213..b401ca093 100644 --- a/main/gooey/context/struct.WidgetContext.html +++ b/main/gooey/context/struct.WidgetContext.html @@ -1,81 +1,81 @@ -WidgetContext in gooey::context - Rust
pub struct WidgetContext<'context, 'window> { /* private fields */ }
Expand description

A context for a widget.

+WidgetContext in gooey::context - Rust
pub struct WidgetContext<'context, 'window> { /* private fields */ }
Expand description

A context for a widget.

This type provides access to the widget hierarchy from the perspective of a specific widget.

-

Implementations§

source§

impl<'context, 'window> WidgetContext<'context, 'window>

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

-
source

pub fn for_other<'child, Widget>( +

Implementations§

source§

impl<'context, 'window> WidgetContext<'context, 'window>

source

pub fn borrowed(&mut self) -> WidgetContext<'_, 'window>

Returns a new instance that borrows from self.

+
source

pub fn for_other<'child, Widget>( &'child mut self, widget: &Widget ) -> <Widget::Managed as MapManagedWidget<WidgetContext<'child, 'window>>>::Resultwhere Widget: ManageWidget, Widget::Managed: MapManagedWidget<WidgetContext<'child, 'window>>,

Returns a new context representing widget.

-
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

-
source

pub const fn enabled(&self) -> bool

Returns true if this widget is enabled.

-
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

-
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

-
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

+
source

pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool

Returns true if possible_parent is in this widget’s parent list.

+
source

pub const fn enabled(&self) -> bool

Returns true if this widget is enabled.

+
source

pub fn redraw_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn invalidate_when_changed(&self, value: &impl Trackable)

Ensures that this widget will be redrawn when value has been updated.

+
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the last layout of this widget.

+
source

pub fn focus(&mut self)

Sets the currently focused widget to this widget.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

+
source

pub fn blur(&mut self) -> bool

Clears focus from this widget, if it is the focused widget.

Returns true if this function resulted in the focus being changed.

Widget events relating to focus changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a +

source

pub fn focus_is_advancing(&mut self) -> bool

Returns true if the last focus event was an advancing motion, not a returning motion.

This value is meaningless outside of focus-related events.

-
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

+
source

pub fn activate(&mut self) -> bool

Activates this widget, if it is not already active.

Returns true if this function resulted in the currently active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

+
source

pub fn deactivate(&mut self) -> bool

Deactivates this widget, if it is the currently active widget.

Returns true if this function resulted in the active widget being changed.

Widget events relating to activation changes are deferred until after the all contexts for the currently firing event are dropped.

-
source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

-
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is +

source

pub fn active(&self) -> bool

Returns true if this widget is currently the active widget.

+
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently hovered, even if the cursor is over a child widget.

-
source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

-
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

-
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

+
source

pub fn focused(&self, check_window: bool) -> bool

Returns true if this widget is currently focused for user input.

+
source

pub fn is_default(&self) -> bool

Returns true if this widget is the target to activate when the user triggers a default action.

See MakeWidget::into_default() for more information.

-
source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user +

source

pub fn is_escape(&self) -> bool

Returns true if this widget is the target to activate when the user triggers an escape action.

See MakeWidget::into_escape() for more information.

-
source

pub const fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

-
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

+
source

pub const fn widget(&self) -> &MountedWidget

Returns the widget this context is for.

+
source

pub fn attach_styles(&self, styles: impl IntoValue<Styles>)

Attaches styles to the widget hierarchy for this widget.

Style queries for children will return any values matching this collection.

-
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

+
source

pub fn attach_theme(&self, theme: Value<ThemePair>)

Attaches theme to the widget hierarchy for this widget.

All children nodes will access this theme in their contexts.

-
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

+
source

pub fn attach_theme_mode(&self, theme_mode: Value<ThemeMode>)

Attaches theme_mode to the widget hierarchy for this widget.

All children nodes will use this theme mode.

-
source

pub fn get<Component: ComponentDefinition>( +

source

pub fn get<Component: ComponentDefinition>( &self, query: &Component ) -> Component::ComponentType

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned. Otherwise, the default value will be returned.

-
source

pub fn try_get<Component: ComponentDefinition>( +

source

pub fn try_get<Component: ComponentDefinition>( &self, query: &Component ) -> Option<Component::ComponentType>

Queries the widget hierarchy for a single style component.

This function traverses up the widget hierarchy looking for the component being requested. If a matching component is found, it will be returned.

-
source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

-
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

-
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

-
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

-
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

-
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate +

source

pub fn window(&self) -> &RunningWindow<'window>

Returns the window containing this widget.

+
source

pub fn window_mut(&mut self) -> &mut RunningWindow<'window>

Returns an exclusive reference to the window containing this widget.

+
source

pub fn theme_pair(&self) -> &ThemePair

Returns the theme pair for the window.

+
source

pub fn theme(&self) -> &Theme

Returns the current theme in either light or dark mode.

+
source

pub fn inverse_theme(&self) -> &Theme

Returns the opposite theme of Self::theme().

+
source

pub fn cache_key(&self) -> WidgetCacheKey

Returns a key that can be checked to see if a widget should invalidate caches it stores.

Methods from Deref<Target = RunningWindow<'window>>§

source

pub fn focused(&self) -> &Dynamic<bool>

Returns a dynamic that is updated whenever this window’s focus status changes.

@@ -127,7 +127,7 @@

pub fn modifiers(&self) -> Modifiers

Returns currently active modifiers.

pub fn set_min_inner_size(&self, min_size: Option<Size<UPx>>)

Sets the window’s minimum inner size.

pub fn set_max_inner_size(&self, max_size: Option<Size<UPx>>)

Sets the window’s maximum inner size.

-

Trait Implementations§

source§

impl<'window> Deref for WidgetContext<'_, 'window>

§

type Target = RunningWindow<'window>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'window> DerefMut for WidgetContext<'_, 'window>

source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'context, 'window> !RefUnwindSafe for WidgetContext<'context, 'window>

§

impl<'context, 'window> Send for WidgetContext<'context, 'window>

§

impl<'context, 'window> !Sync for WidgetContext<'context, 'window>

§

impl<'context, 'window> Unpin for WidgetContext<'context, 'window>

§

impl<'context, 'window> !UnwindSafe for WidgetContext<'context, 'window>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +

Trait Implementations§

source§

impl<'window> Deref for WidgetContext<'_, 'window>

§

type Target = RunningWindow<'window>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'window> DerefMut for WidgetContext<'_, 'window>

source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'context, 'window> !RefUnwindSafe for WidgetContext<'context, 'window>

§

impl<'context, 'window> Send for WidgetContext<'context, 'window>

§

impl<'context, 'window> !Sync for WidgetContext<'context, 'window>

§

impl<'context, 'window> Unpin for WidgetContext<'context, 'window>

§

impl<'context, 'window> !UnwindSafe for WidgetContext<'context, 'window>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/context/trait.AsEventContext.html b/main/gooey/context/trait.AsEventContext.html index a084a98e2..f611ba27f 100644 --- a/main/gooey/context/trait.AsEventContext.html +++ b/main/gooey/context/trait.AsEventContext.html @@ -1,4 +1,4 @@ -AsEventContext in gooey::context - Rust
pub trait AsEventContext<'window> {
+AsEventContext in gooey::context - Rust
pub trait AsEventContext<'window> {
     // Required method
     fn as_event_context(&mut self) -> EventContext<'_, 'window>;
 
@@ -6,8 +6,8 @@
     fn push_child(&mut self, child: WidgetInstance) -> MountedWidget { ... }
     fn remove_child(&mut self, child: &MountedWidget) { ... }
 }
Expand description

Converts from one context to an EventContext.

-

Required Methods§

source

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.

-

Provided Methods§

source

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the +

Required Methods§

source

fn as_event_context(&mut self) -> EventContext<'_, 'window>

Returns this context as an EventContext.

+

Provided Methods§

source

fn push_child(&mut self, child: WidgetInstance) -> MountedWidget

Pushes a new child widget into the widget hierarchy beneathq the context’s widget.

-
source

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.

-

Implementors§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> AsEventContext<'window> for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

impl<'window> AsEventContext<'window> for EventContext<'_, 'window>

source§

impl<'window> AsEventContext<'window> for GraphicsContext<'_, 'window, '_, '_, '_>

\ No newline at end of file +

source

fn remove_child(&mut self, child: &MountedWidget)

Removes a widget from the hierarchy.

+

Implementors§

source§

impl<'context, 'window, 'clip, 'gfx, 'pass> AsEventContext<'window> for LayoutContext<'context, 'window, 'clip, 'gfx, 'pass>

source§

impl<'window> AsEventContext<'window> for EventContext<'_, 'window>

source§

impl<'window> AsEventContext<'window> for GraphicsContext<'_, 'window, '_, '_, '_>

\ No newline at end of file diff --git a/main/gooey/context/trait.ManageWidget.html b/main/gooey/context/trait.ManageWidget.html index 298ddb9b8..f4e6e751d 100644 --- a/main/gooey/context/trait.ManageWidget.html +++ b/main/gooey/context/trait.ManageWidget.html @@ -1,10 +1,10 @@ -ManageWidget in gooey::context - Rust
pub trait ManageWidget {
+ManageWidget in gooey::context - Rust
pub trait ManageWidget {
     type Managed: MapManagedWidget<MountedWidget>;
 
     // Required method
     fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed;
 }
Expand description

A type chat can convert to a MountedWidget through a WidgetContext.

-

Required Associated Types§

source

type Managed: MapManagedWidget<MountedWidget>

The managed type, which can be Option<MountedWidget> or +

Required Associated Types§

source

type Managed: MapManagedWidget<MountedWidget>

The managed type, which can be Option<MountedWidget> or MountedWidget.

-

Required Methods§

source

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.

-

Implementors§

\ No newline at end of file +

Required Methods§

source

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.

+

Implementors§

\ No newline at end of file diff --git a/main/gooey/context/trait.MapManagedWidget.html b/main/gooey/context/trait.MapManagedWidget.html index 284e8c734..a91b8dcb6 100644 --- a/main/gooey/context/trait.MapManagedWidget.html +++ b/main/gooey/context/trait.MapManagedWidget.html @@ -1,9 +1,9 @@ -MapManagedWidget in gooey::context - Rust
pub trait MapManagedWidget<T> {
+MapManagedWidget in gooey::context - Rust
pub trait MapManagedWidget<T> {
     type Result;
 
     // Required method
     fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result;
 }
Expand description

A type that can produce another type when provided a MountedWidget.

-

Required Associated Types§

source

type Result

The result of the mapping operation.

-

Required Methods§

source

fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result

Call map with a MountedWidget.

-

Implementations on Foreign Types§

source§

impl<T> MapManagedWidget<T> for Option<MountedWidget>

§

type Result = Option<T>

source§

fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result

Implementors§

\ No newline at end of file +

Required Associated Types§

source

type Result

The result of the mapping operation.

+

Required Methods§

source

fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result

Call map with a MountedWidget.

+

Implementations on Foreign Types§

source§

impl<T> MapManagedWidget<T> for Option<MountedWidget>

§

type Result = Option<T>

source§

fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result

Implementors§

\ No newline at end of file diff --git a/main/gooey/context/trait.Trackable.html b/main/gooey/context/trait.Trackable.html index edb4b4ec3..2d12972d2 100644 --- a/main/gooey/context/trait.Trackable.html +++ b/main/gooey/context/trait.Trackable.html @@ -1,3 +1,3 @@ -Trackable in gooey::context - Rust

Trait gooey::context::Trackable

source ·
pub trait Trackable: Trackable { }
Expand description

A type that can be tracked to refresh or invalidate widgets.

-

Implementors§

source§

impl<T> Trackable for Twhere +Trackable in gooey::context - Rust

Trait gooey::context::Trackable

source ·
pub trait Trackable: Trackable { }
Expand description

A type that can be tracked to refresh or invalidate widgets.

+

Implementors§

source§

impl<T> Trackable for Twhere T: Trackable,

\ No newline at end of file diff --git a/main/gooey/value/struct.Dynamic.html b/main/gooey/value/struct.Dynamic.html index 44becf1b4..b8f3405cc 100644 --- a/main/gooey/value/struct.Dynamic.html +++ b/main/gooey/value/struct.Dynamic.html @@ -237,11 +237,11 @@
Panics
returning a dynamic that contains the validation status.

source§

impl Dynamic<WidgetInstance>

source

pub fn into_switcher(self) -> Switcher

Returns a new Switcher widget whose contents is the value of this dynamic.

-
source§

impl Dynamic<Children>

source

pub fn into_rows(self) -> Stack

Returns self as a vertical Stack of rows.

-
source

pub fn into_columns(self) -> Stack

Returns self as a horizontal Stack of columns.

-
source

pub fn into_layers(self) -> Layers

Returns self as Layers, with the widgets being stacked in the Z +

source§

impl Dynamic<Children>

source

pub fn into_rows(self) -> Stack

Returns self as a vertical Stack of rows.

+
source

pub fn into_columns(self) -> Stack

Returns self as a horizontal Stack of columns.

+
source

pub fn into_layers(self) -> Layers

Returns self as Layers, with the widgets being stacked in the Z direction.

-
source

pub fn wrap(self) -> Wrap

Returns a Wrap that lays the children out horizontally, wrapping +

source

pub fn wrap(self) -> Wrap

Returns a Wrap that lays the children out horizontally, wrapping into additional rows as needed.

Trait Implementations§

source§

impl<T> Clone for Dynamic<T>

source§

fn clone(&self) -> Self

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> Debug for Dynamic<T>where T: Debug,

source§

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

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

impl<T> Default for Dynamic<T>where @@ -363,7 +363,7 @@
Panics
C: FromUints<U>,

source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
source§

impl<T> Trackable for Twhere +[WithDispatch] wrapper. Read more

source§

impl<T> Trackable for Twhere T: Trackable,

§

impl<T> WasmNotSend for Twhere T: Send,

§

impl<T> WasmNotSync for Twhere T: Sync,

\ No newline at end of file diff --git a/main/gooey/value/struct.DynamicReader.html b/main/gooey/value/struct.DynamicReader.html index 050cb204b..b37f71506 100644 --- a/main/gooey/value/struct.DynamicReader.html +++ b/main/gooey/value/struct.DynamicReader.html @@ -89,7 +89,7 @@
Panics
C: FromUints<U>,
source§

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a -[WithDispatch] wrapper. Read more
source§

impl<T> Trackable for Twhere +[WithDispatch] wrapper. Read more
source§

impl<T> Trackable for Twhere T: Trackable,

§

impl<T> WasmNotSend for Twhere T: Send,

§

impl<T> WasmNotSync for Twhere T: Sync,

\ No newline at end of file diff --git a/main/gooey/widget/enum.ChildrenSyncChange.html b/main/gooey/widget/enum.ChildrenSyncChange.html index 405b796ac..9b4fe561b 100644 --- a/main/gooey/widget/enum.ChildrenSyncChange.html +++ b/main/gooey/widget/enum.ChildrenSyncChange.html @@ -1,4 +1,4 @@ -ChildrenSyncChange in gooey::widget - Rust
pub enum ChildrenSyncChange {
+ChildrenSyncChange in gooey::widget - Rust
pub enum ChildrenSyncChange {
     Insert(usize, WidgetInstance),
     Swap(usize, usize),
     Truncate(usize),
diff --git a/main/gooey/widget/enum.WidgetRef.html b/main/gooey/widget/enum.WidgetRef.html
index b04d5b34d..5fb57f9b2 100644
--- a/main/gooey/widget/enum.WidgetRef.html
+++ b/main/gooey/widget/enum.WidgetRef.html
@@ -1,23 +1,23 @@
-WidgetRef in gooey::widget - Rust

Enum gooey::widget::WidgetRef

source ·
pub enum WidgetRef {
+WidgetRef in gooey::widget - Rust

Enum gooey::widget::WidgetRef

source ·
pub enum WidgetRef {
     Unmounted(WidgetInstance),
     Mounted(MountedWidget),
 }
Expand description

A child widget

Variants§

§

Unmounted(WidgetInstance)

An unmounted child widget

§

Mounted(MountedWidget)

A mounted child widget

-

Implementations§

source§

impl WidgetRef

source

pub fn new(widget: impl MakeWidget) -> Self

Returns a new unmounted child

-
source

pub fn mount_if_needed<'window>( +

Implementations§

source§

impl WidgetRef

source

pub fn new(widget: impl MakeWidget) -> Self

Returns a new unmounted child

+
source

pub fn mount_if_needed<'window>( &mut self, context: &mut impl AsEventContext<'window> )

Returns this child, mounting it in the process if necessary.

-
source

pub fn mounted<'window>( +

source

pub fn mounted<'window>( &mut self, context: &mut impl AsEventContext<'window> ) -> MountedWidget

Returns this child, mounting it in the process if necessary.

-
source

pub fn widget(&self) -> &WidgetInstance

Returns the a reference to the underlying widget instance.

-

Trait Implementations§

source§

impl AsMut<WidgetRef> for Align

source§

fn as_mut(&mut self) -> &mut WidgetRef

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<WidgetId> for WidgetRef

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for WidgetRef

source§

fn clone(&self) -> WidgetRef

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 WidgetRef

source§

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

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

impl ManageWidget for WidgetRef

§

type Managed = Option<MountedWidget>

The managed type, which can be Option<MountedWidget> or -MountedWidget.
source§

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl PartialEq<WidgetRef> for WidgetRef

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +
source

pub fn widget(&self) -> &WidgetInstance

Returns the a reference to the underlying widget instance.

+

Trait Implementations§

source§

impl AsMut<WidgetRef> for Align

source§

fn as_mut(&mut self) -> &mut WidgetRef

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<WidgetId> for WidgetRef

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for WidgetRef

source§

fn clone(&self) -> WidgetRef

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 WidgetRef

source§

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

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

impl ManageWidget for WidgetRef

§

type Managed = Option<MountedWidget>

The managed type, which can be Option<MountedWidget> or +MountedWidget.
source§

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl PartialEq<WidgetRef> for WidgetRef

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for WidgetRef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +sufficient, and should not be overridden without very good reason.

source§

impl Eq for WidgetRef

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/widget/index.html b/main/gooey/widget/index.html index 1a25cbd90..2e4be88a1 100644 --- a/main/gooey/widget/index.html +++ b/main/gooey/widget/index.html @@ -1,3 +1,3 @@ -gooey::widget - Rust

Module gooey::widget

source ·
Expand description

Types for creating reusable widgets (aka components or views).

+gooey::widget - Rust

Module gooey::widget

source ·
Expand description

Types for creating reusable widgets (aka components or views).

Structs

Enums

Constants

Traits

Type Aliases

  • A type that represents whether an event has been handled or ignored.
\ No newline at end of file diff --git a/main/gooey/widget/struct.Children.html b/main/gooey/widget/struct.Children.html index 027bd4394..943dc8cd3 100644 --- a/main/gooey/widget/struct.Children.html +++ b/main/gooey/widget/struct.Children.html @@ -1,25 +1,25 @@ -Children in gooey::widget - Rust

Struct gooey::widget::Children

source ·
pub struct Children { /* private fields */ }
Expand description

A list of Widgets.

-

Implementations§

source§

impl Children

source

pub const fn new() -> Self

Returns an empty list.

-
source

pub fn with_capacity(capacity: usize) -> Self

Returns a list with enough capacity to hold capacity widgets without +Children in gooey::widget - Rust

Struct gooey::widget::Children

source ·
pub struct Children { /* private fields */ }
Expand description

A list of Widgets.

+

Implementations§

source§

impl Children

source

pub const fn new() -> Self

Returns an empty list.

+
source

pub fn with_capacity(capacity: usize) -> Self

Returns a list with enough capacity to hold capacity widgets without reallocation.

-
source

pub fn push<W>(&mut self, widget: W)where +

source

pub fn push<W>(&mut self, widget: W)where W: MakeWidget,

Pushes widget into the list.

-
source

pub fn insert<W>(&mut self, index: usize, widget: W)where +

source

pub fn insert<W>(&mut self, index: usize, widget: W)where W: MakeWidget,

Inserts widget into the list at index.

-
source

pub fn and<W>(self, widget: W) -> Selfwhere +

source

pub fn and<W>(self, widget: W) -> Selfwhere W: MakeWidget,

Adds widget to self and returns the updated list.

-
source

pub fn len(&self) -> usize

Returns the number of widgets in this list.

-
source

pub fn is_empty(&self) -> bool

Returns true if there are no widgets in this list.

-
source

pub fn truncate(&mut self, length: usize)

Truncates the collection of children to length.

+
source

pub fn len(&self) -> usize

Returns the number of widgets in this list.

+
source

pub fn is_empty(&self) -> bool

Returns true if there are no widgets in this list.

+
source

pub fn truncate(&mut self, length: usize)

Truncates the collection of children to length.

If this collection is already smaller or the same size as length, this function does nothing.

-
source

pub fn into_rows(self) -> Stack

Returns self as a vertical Stack of rows.

-
source

pub fn into_columns(self) -> Stack

Returns self as a horizontal Stack of columns.

-
source

pub fn into_layers(self) -> Layers

Returns self as Layers, with the widgets being stacked in the Z +

source

pub fn into_rows(self) -> Stack

Returns self as a vertical Stack of rows.

+
source

pub fn into_columns(self) -> Stack

Returns self as a horizontal Stack of columns.

+
source

pub fn into_layers(self) -> Layers

Returns self as Layers, with the widgets being stacked in the Z direction.

-
source

pub fn wrap(self) -> Wrap

Returns a Wrap that lays the children out horizontally, wrapping +

source

pub fn wrap(self) -> Wrap

Returns a Wrap that lays the children out horizontally, wrapping into additional rows as needed.

-
source

pub fn synchronize_with<Collection>( +

source

pub fn synchronize_with<Collection>( &self, collection: &mut Collection, get_index: impl Fn(&Collection, usize) -> Option<&WidgetInstance>, @@ -2369,10 +2369,10 @@

Examples
Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

Trait Implementations§

source§

impl Debug for Children

source§

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

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

impl Default for Children

source§

fn default() -> Children

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

impl Deref for Children

§

type Target = [WidgetInstance]

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl DerefMut for Children

source§

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

Mutably dereferences the value.
source§

impl<W> FromIterator<W> for Childrenwhere - W: MakeWidget,

source§

fn from_iter<T: IntoIterator<Item = W>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl GetWidget<usize> for Children

source§

fn get<'a>(&'a self, key: &usize) -> Option<&'a WidgetInstance>

Returns the widget associated with key, if found.
source§

impl<'a> IntoIterator for &'a Children

§

type IntoIter = Iter<'a, WidgetInstance>

Which kind of iterator are we turning this into?
§

type Item = &'a WidgetInstance

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq<Children> for Children

source§

fn eq(&self, other: &Children) -> bool

This method tests for self and other values to be equal, and is used +

Trait Implementations§

source§

impl Debug for Children

source§

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

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

impl Default for Children

source§

fn default() -> Children

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

impl Deref for Children

§

type Target = [WidgetInstance]

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl DerefMut for Children

source§

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

Mutably dereferences the value.
source§

impl<W> FromIterator<W> for Childrenwhere + W: MakeWidget,

source§

fn from_iter<T: IntoIterator<Item = W>>(iter: T) -> Self

Creates a value from an iterator. Read more
source§

impl GetWidget<usize> for Children

source§

fn get<'a>(&'a self, key: &usize) -> Option<&'a WidgetInstance>

Returns the widget associated with key, if found.
source§

impl<'a> IntoIterator for &'a Children

§

type IntoIter = Iter<'a, WidgetInstance>

Which kind of iterator are we turning this into?
§

type Item = &'a WidgetInstance

The type of the elements being iterated over.
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl PartialEq<Children> for Children

source§

fn eq(&self, other: &Children) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for Children

source§

impl StructuralEq for Children

source§

impl StructuralPartialEq for Children

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +sufficient, and should not be overridden without very good reason.

source§

impl Eq for Children

source§

impl StructuralEq for Children

source§

impl StructuralPartialEq for Children

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/widget/struct.MountedChildren.html b/main/gooey/widget/struct.MountedChildren.html index d47549b89..1bd539324 100644 --- a/main/gooey/widget/struct.MountedChildren.html +++ b/main/gooey/widget/struct.MountedChildren.html @@ -1,17 +1,17 @@ -MountedChildren in gooey::widget - Rust
pub struct MountedChildren<T = MountedWidget> { /* private fields */ }
Expand description

A collection of mounted children.

+MountedChildren in gooey::widget - Rust
pub struct MountedChildren<T = MountedWidget> { /* private fields */ }
Expand description

A collection of mounted children.

This collection is a helper aimed at making it easier to build widgets that contain multiple children widgets. It is used in conjunction with a Value<Children>.

-

Implementations§

source§

impl<T> MountedChildren<T>where - T: MountableChild,

Implementations§

source§

impl<T> MountedChildren<T>where + T: MountableChild,

source

pub fn synchronize_with( &mut self, children: &Value<Children>, context: &mut EventContext<'_, '_> )

Mounts and unmounts all children needed to be in sync with children.

-
source

pub fn drain(&mut self) -> Drain<'_, T>

Returns an iterator that contains every widget in this collection.

+
source

pub fn drain(&mut self) -> Drain<'_, T>

Returns an iterator that contains every widget in this collection.

When the iterator is dropped, this collection will be empty.

-
source

pub fn children(&self) -> &[T]

Returns a reference to the children.

-

Trait Implementations§

source§

impl<T: Debug> Debug for MountedChildren<T>

source§

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

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

impl<T> Default for MountedChildren<T>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for MountedChildren<T>where +

source

pub fn children(&self) -> &[T]

Returns a reference to the children.

+

Trait Implementations§

source§

impl<T: Debug> Debug for MountedChildren<T>

source§

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

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

impl<T> Default for MountedChildren<T>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

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

§

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

§

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

§

impl<T> Unpin for MountedChildren<T>where diff --git a/main/gooey/widget/struct.MountedWidget.html b/main/gooey/widget/struct.MountedWidget.html index b38693490..985aae823 100644 --- a/main/gooey/widget/struct.MountedWidget.html +++ b/main/gooey/widget/struct.MountedWidget.html @@ -1,34 +1,34 @@ MountedWidget in gooey::widget - Rust

Struct gooey::widget::MountedWidget

source ·
pub struct MountedWidget { /* private fields */ }
Expand description

A Widget that has been attached to a widget hierarchy.

-

Implementations§

source§

impl MountedWidget

source

pub fn lock(&self) -> WidgetGuard<'_>

Locks the widget for exclusive access. Locking widgets should only be +

Implementations§

source§

impl MountedWidget

source

pub fn lock(&self) -> WidgetGuard<'_>

Locks the widget for exclusive access. Locking widgets should only be done for brief moments of time when you are certain no deadlocks can occur due to other widget locks being held.

-
source

pub fn invalidate(&self)

Invalidates this widget.

-
source

pub fn id(&self) -> WidgetId

Returns the unique id of this widget instance.

-
source

pub const fn instance(&self) -> &WidgetInstance

Returns the underlying widget instance

-
source

pub fn next_focus(&self) -> Option<MountedWidget>

Returns the next widget to focus after this widget.

+
source

pub fn invalidate(&self)

Invalidates this widget.

+
source

pub fn id(&self) -> WidgetId

Returns the unique id of this widget instance.

+
source

pub const fn instance(&self) -> &WidgetInstance

Returns the underlying widget instance

+
source

pub fn next_focus(&self) -> Option<MountedWidget>

Returns the next widget to focus after this widget.

This function returns the value set in MakeWidget::with_next_focus().

-
source

pub fn previous_focus(&self) -> Option<MountedWidget>

Returns the widget to focus before this widget.

+
source

pub fn previous_focus(&self) -> Option<MountedWidget>

Returns the widget to focus before this widget.

There is no direct way to set this value. This relationship is created automatically using MakeWidget::with_next_focus().

-
source

pub fn explicit_focus_target(&self, advance: bool) -> Option<MountedWidget>

Returns the next or previous focus target, if one was set using +

source

pub fn explicit_focus_target(&self, advance: bool) -> Option<MountedWidget>

Returns the next or previous focus target, if one was set using MakeWidget::with_next_focus().

-
source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the region that the widget was last rendered at.

-
source

pub fn effective_styles(&self) -> Styles

Returns the effective styles for the current tree.

-
source

pub fn active(&self) -> bool

Returns true if this widget is the currently active widget.

-
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently the hovered widget.

-
source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

-
source

pub fn focused(&self) -> bool

Returns true if this widget is the currently focused widget.

-
source

pub fn parent(&self) -> Option<MountedWidget>

Returns the parent of this widget.

-
source

pub fn has_parent(&self) -> bool

Returns true if this node has a parent.

-

Trait Implementations§

source§

impl AsRef<WidgetId> for MountedWidget

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for MountedWidget

source§

fn clone(&self) -> MountedWidget

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 MountedWidget

source§

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

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

impl ManageWidget for MountedWidget

§

type Managed = MountedWidget

The managed type, which can be Option<MountedWidget> or -MountedWidget.
source§

fn manage(&self, _context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl<T> MapManagedWidget<T> for MountedWidget

§

type Result = T

The result of the mapping operation.
source§

fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result

Call map with a MountedWidget.
source§

impl MountableChild for MountedWidget

source

pub fn last_layout(&self) -> Option<Rect<Px>>

Returns the region that the widget was last rendered at.

+
source

pub fn effective_styles(&self) -> Styles

Returns the effective styles for the current tree.

+
source

pub fn active(&self) -> bool

Returns true if this widget is the currently active widget.

+
source

pub fn hovered(&self) -> bool

Returns true if this widget is currently the hovered widget.

+
source

pub fn primary_hover(&self) -> bool

Returns true if this widget that is directly beneath the cursor.

+
source

pub fn focused(&self) -> bool

Returns true if this widget is the currently focused widget.

+
source

pub fn parent(&self) -> Option<MountedWidget>

Returns the parent of this widget.

+
source

pub fn has_parent(&self) -> bool

Returns true if this node has a parent.

+

Trait Implementations§

source§

impl AsRef<WidgetId> for MountedWidget

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for MountedWidget

source§

fn clone(&self) -> MountedWidget

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 MountedWidget

source§

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

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

impl ManageWidget for MountedWidget

§

type Managed = MountedWidget

The managed type, which can be Option<MountedWidget> or +MountedWidget.
source§

fn manage(&self, _context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl<T> MapManagedWidget<T> for MountedWidget

§

type Result = T

The result of the mapping operation.
source§

fn map(self, map: impl FnOnce(MountedWidget) -> T) -> Self::Result

Call map with a MountedWidget.
source§

impl MountableChild for MountedWidget

source§

fn mount( widget: MountedWidget, _into: &MountedChildren<Self>, _index: usize -) -> Self

Returns the mounted representation of widget.
source§

fn widget(&self) -> &MountedWidget

Returns a reference to the widget.
source§

fn unmount(self) -> MountedWidget

Returns the widget and performs any other cleanup for this widget being unmounted.q
source§

impl PartialEq<MountedWidget> for MountedWidget

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used +) -> Self

Returns the mounted representation of widget.
source§

fn widget(&self) -> &MountedWidget

Returns a reference to the widget.
source§

fn unmount(self) -> MountedWidget

Returns the widget and performs any other cleanup for this widget being unmounted.q
source§

impl PartialEq<MountedWidget> for MountedWidget

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<WidgetInstance> for MountedWidget

source§

fn eq(&self, other: &WidgetInstance) -> bool

This method tests for self and other values to be equal, and is used +sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<WidgetInstance> for MountedWidget

source§

fn eq(&self, other: &WidgetInstance) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, diff --git a/main/gooey/widget/struct.WidgetGuard.html b/main/gooey/widget/struct.WidgetGuard.html index 424c294f1..2ac317ffe 100644 --- a/main/gooey/widget/struct.WidgetGuard.html +++ b/main/gooey/widget/struct.WidgetGuard.html @@ -1,9 +1,9 @@ -WidgetGuard in gooey::widget - Rust

Struct gooey::widget::WidgetGuard

source ·
pub struct WidgetGuard<'a>(/* private fields */);
Expand description

Exclusive access to a widget.

+WidgetGuard in gooey::widget - Rust

Struct gooey::widget::WidgetGuard

source ·
pub struct WidgetGuard<'a>(/* private fields */);
Expand description

Exclusive access to a widget.

This type is powered by a Mutex, which means care must be taken to prevent deadlocks.

-

Implementations§

source§

impl WidgetGuard<'_>

source

pub fn downcast_ref<T>(&self) -> Option<&T>where +

Implementations§

source§

impl WidgetGuard<'_>

source

pub fn downcast_ref<T>(&self) -> Option<&T>where T: 'static,

Returns a reference to T if it is the type contained.

-
source

pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where +

source

pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where T: 'static,

Returns an exclusive reference to T if it is the type contained.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for WidgetGuard<'a>

§

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

§

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

§

impl<'a> Unpin for WidgetGuard<'a>

§

impl<'a> UnwindSafe for WidgetGuard<'a>

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, diff --git a/main/gooey/widget/struct.WidgetId.html b/main/gooey/widget/struct.WidgetId.html index 5c2534ab0..26a4cad13 100644 --- a/main/gooey/widget/struct.WidgetId.html +++ b/main/gooey/widget/struct.WidgetId.html @@ -1,18 +1,18 @@ -WidgetId in gooey::widget - Rust

Struct gooey::widget::WidgetId

source ·
pub struct WidgetId(/* private fields */);
Expand description

The unique id of a WidgetInstance.

+WidgetId in gooey::widget - Rust

Struct gooey::widget::WidgetId

source ·
pub struct WidgetId(/* private fields */);
Expand description

The unique id of a WidgetInstance.

Each WidgetInstance is guaranteed to have a unique WidgetId across the lifetime of an application.

-

Implementations§

source§

impl WidgetId

source

pub fn find_in(self, context: &WidgetContext<'_, '_>) -> Option<MountedWidget>

Finds this widget mounted in this window, if present.

-

Trait Implementations§

source§

impl AsRef<WidgetId> for MountedWidget

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<WidgetId> for WidgetInstance

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<WidgetId> for WidgetRef

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for WidgetId

source§

fn clone(&self) -> WidgetId

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 WidgetId

source§

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

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

impl From<WidgetTag> for WidgetId

source§

fn from(value: WidgetTag) -> Self

Converts to this type from the input type.
source§

impl Hash for WidgetId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where +

Implementations§

source§

impl WidgetId

source

pub fn find_in(self, context: &WidgetContext<'_, '_>) -> Option<MountedWidget>

Finds this widget mounted in this window, if present.

+

Trait Implementations§

source§

impl AsRef<WidgetId> for MountedWidget

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<WidgetId> for WidgetInstance

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<WidgetId> for WidgetRef

source§

fn as_ref(&self) -> &WidgetId

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for WidgetId

source§

fn clone(&self) -> WidgetId

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 WidgetId

source§

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

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

impl From<WidgetTag> for WidgetId

source§

fn from(value: WidgetTag) -> Self

Converts to this type from the input type.
source§

impl Hash for WidgetId

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl ManageWidget for WidgetId

§

type Managed = Option<MountedWidget>

The managed type, which can be Option<MountedWidget> or -MountedWidget.
source§

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl Ord for WidgetId

source§

fn cmp(&self, other: &WidgetId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl ManageWidget for WidgetId

§

type Managed = Option<MountedWidget>

The managed type, which can be Option<MountedWidget> or +MountedWidget.
source§

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl Ord for WidgetId

source§

fn cmp(&self, other: &WidgetId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<WidgetId> for WidgetId

source§

fn eq(&self, other: &WidgetId) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more

source§

impl PartialEq<WidgetId> for WidgetId

source§

fn eq(&self, other: &WidgetId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<WidgetId> for WidgetId

source§

fn partial_cmp(&self, other: &WidgetId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<WidgetId> for WidgetId

source§

fn partial_cmp(&self, other: &WidgetId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for WidgetId

source§

impl Eq for WidgetId

source§

impl StructuralEq for WidgetId

source§

impl StructuralPartialEq for WidgetId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +operator. Read more

source§

impl Copy for WidgetId

source§

impl Eq for WidgetId

source§

impl StructuralEq for WidgetId

source§

impl StructuralPartialEq for WidgetId

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/widget/struct.WidgetInstance.html b/main/gooey/widget/struct.WidgetInstance.html index cfafe2f3c..d630f0cfc 100644 --- a/main/gooey/widget/struct.WidgetInstance.html +++ b/main/gooey/widget/struct.WidgetInstance.html @@ -74,8 +74,8 @@
Panics
self, collapse_when: impl IntoDynamic<bool> ) -> Collapse

Returns a widget that collapses self horizontally based on the dynamic boolean value. Read more
source§

fn collapse_vertically(self, collapse_when: impl IntoDynamic<bool>) -> Collapse

Returns a widget that collapses self vertically based on the dynamic -boolean value. Read more
source§

fn validation(self, validation: impl IntoDynamic<Validation>) -> Validated

Returns a widget that shows validation errors and/or hints.
source§

fn tooltip(self, layer: &OverlayLayer, tip: impl MakeWidget) -> Tooltipped

Returns a widget that shows tip on layer when self is hovered.
source§

impl ManageWidget for WidgetInstance

§

type Managed = Option<MountedWidget>

The managed type, which can be Option<MountedWidget> or -MountedWidget.
source§

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl PartialEq<WidgetInstance> for MountedWidget

source§

fn eq(&self, other: &WidgetInstance) -> bool

This method tests for self and other values to be equal, and is used +boolean value. Read more
source§

fn validation(self, validation: impl IntoDynamic<Validation>) -> Validated

Returns a widget that shows validation errors and/or hints.
source§

fn tooltip(self, layer: &OverlayLayer, tip: impl MakeWidget) -> Tooltipped

Returns a widget that shows tip on layer when self is hovered.
source§

impl ManageWidget for WidgetInstance

§

type Managed = Option<MountedWidget>

The managed type, which can be Option<MountedWidget> or +MountedWidget.
source§

fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed

Resolve self into a MountedWidget.
source§

impl PartialEq<WidgetInstance> for MountedWidget

source§

fn eq(&self, other: &WidgetInstance) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<WidgetInstance> for WidgetInstance

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always diff --git a/main/gooey/widget/struct.WidgetTag.html b/main/gooey/widget/struct.WidgetTag.html index ff0f51063..949bad4c0 100644 --- a/main/gooey/widget/struct.WidgetTag.html +++ b/main/gooey/widget/struct.WidgetTag.html @@ -1,16 +1,16 @@ -WidgetTag in gooey::widget - Rust

Struct gooey::widget::WidgetTag

source ·
pub struct WidgetTag(/* private fields */);
Expand description

A WidgetId that has not been assigned to a WidgetInstance.

+WidgetTag in gooey::widget - Rust

Struct gooey::widget::WidgetTag

source ·
pub struct WidgetTag(/* private fields */);
Expand description

A WidgetId that has not been assigned to a WidgetInstance.

This type is passed to MakeWidgetWithTag::make_with_tag() to create a WidgetInstance with a preallocated id.

This type cannot be cloned or copied to ensure only a single widget can be assigned a given WidgetId. The contained WidgetId can be accessed via id(), Into<WidgetId>, or Deref.

-

Implementations§

source§

impl WidgetTag

source

pub fn new() -> (Self, WidgetId)

Returns a unique tag and its contained id.

-
source

pub fn unique() -> Self

Returns a newly allocated WidgetId that is guaranteed to be unique +

Implementations§

source§

impl WidgetTag

source

pub fn new() -> (Self, WidgetId)

Returns a unique tag and its contained id.

+
source

pub fn unique() -> Self

Returns a newly allocated WidgetId that is guaranteed to be unique for the lifetime of the application.

-
source

pub const fn id(&self) -> WidgetId

Returns the contained widget id.

-

Trait Implementations§

source§

impl Debug for WidgetTag

source§

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

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

impl Deref for WidgetTag

§

type Target = WidgetId

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl From<WidgetTag> for WidgetId

source§

fn from(value: WidgetTag) -> Self

Converts to this type from the input type.
source§

impl PartialEq<WidgetTag> for WidgetTag

source§

fn eq(&self, other: &WidgetTag) -> bool

This method tests for self and other values to be equal, and is used +
source

pub const fn id(&self) -> WidgetId

Returns the contained widget id.

+

Trait Implementations§

source§

impl Debug for WidgetTag

source§

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

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

impl Deref for WidgetTag

§

type Target = WidgetId

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl From<WidgetTag> for WidgetId

source§

fn from(value: WidgetTag) -> Self

Converts to this type from the input type.
source§

impl PartialEq<WidgetTag> for WidgetTag

source§

fn eq(&self, other: &WidgetTag) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Eq for WidgetTag

source§

impl StructuralEq for WidgetTag

source§

impl StructuralPartialEq for WidgetTag

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +sufficient, and should not be overridden without very good reason.

source§

impl Eq for WidgetTag

source§

impl StructuralEq for WidgetTag

source§

impl StructuralPartialEq for WidgetTag

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/widget/trait.MountableChild.html b/main/gooey/widget/trait.MountableChild.html index b3e691655..6c0415556 100644 --- a/main/gooey/widget/trait.MountableChild.html +++ b/main/gooey/widget/trait.MountableChild.html @@ -1,4 +1,4 @@ -MountableChild in gooey::widget - Rust
pub trait MountableChild: Sized {
+MountableChild in gooey::widget - Rust
pub trait MountableChild: Sized {
     // Required methods
     fn mount(
         widget: MountedWidget,
@@ -8,11 +8,11 @@
     fn unmount(self) -> MountedWidget;
     fn widget(&self) -> &MountedWidget;
 }
Expand description

A child in a MountedChildren collection.

-

Required Methods§

Required Methods§

source

fn mount( widget: MountedWidget, into: &MountedChildren<Self>, index: usize ) -> Self

Returns the mounted representation of widget.

-
source

fn unmount(self) -> MountedWidget

Returns the widget and performs any other cleanup for this widget being unmounted.q

-
source

fn widget(&self) -> &MountedWidget

Returns a reference to the widget.

-

Implementors§

\ No newline at end of file +
source

fn unmount(self) -> MountedWidget

Returns the widget and performs any other cleanup for this widget being unmounted.q

+
source

fn widget(&self) -> &MountedWidget

Returns a reference to the widget.

+

Implementors§

\ No newline at end of file diff --git a/main/gooey/window/enum.ThemeMode.html b/main/gooey/window/enum.ThemeMode.html index a7c838f75..9b91e7a44 100644 --- a/main/gooey/window/enum.ThemeMode.html +++ b/main/gooey/window/enum.ThemeMode.html @@ -1,21 +1,21 @@ -ThemeMode in gooey::window - Rust

Enum gooey::window::ThemeMode

source ·
pub enum ThemeMode {
+ThemeMode in gooey::window - Rust

Enum gooey::window::ThemeMode

source ·
pub enum ThemeMode {
     Light,
     Dark,
 }
Expand description

Controls whether the light or dark theme is applied.

Variants§

§

Light

Applies the light theme

§

Dark

Applies the dark theme

-

Implementations§

source§

impl ThemeMode

source

pub const fn inverse(self) -> Self

Returns the opposite mode of self.

-
source

pub fn toggle(&mut self)

Updates self with its inverse.

-

Trait Implementations§

source§

impl Clone for ThemeMode

source§

fn clone(&self) -> ThemeMode

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 ThemeMode

source§

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

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

impl Default for ThemeMode

source§

fn default() -> ThemeMode

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

impl From<Theme> for ThemeMode

source§

fn from(value: Theme) -> Self

Converts to this type from the input type.
source§

impl From<ThemeMode> for Theme

source§

fn from(value: ThemeMode) -> Self

Converts to this type from the input type.
source§

impl LinearInterpolate for ThemeMode

source§

fn lerp(&self, __target: &Self, __percent: f32) -> Self

Implementations§

source§

impl ThemeMode

source

pub const fn inverse(self) -> Self

Returns the opposite mode of self.

+
source

pub fn toggle(&mut self)

Updates self with its inverse.

+

Trait Implementations§

source§

impl Clone for ThemeMode

source§

fn clone(&self) -> ThemeMode

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 ThemeMode

source§

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

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

impl Default for ThemeMode

source§

fn default() -> ThemeMode

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

impl From<Theme> for ThemeMode

source§

fn from(value: Theme) -> Self

Converts to this type from the input type.
source§

impl From<ThemeMode> for Theme

source§

fn from(value: ThemeMode) -> Self

Converts to this type from the input type.
source§

impl LinearInterpolate for ThemeMode

source§

fn lerp(&self, __target: &Self, __percent: f32) -> Self

Panics

Panics if the the enum variants are overflown (this can only happen on percentages outside 0..1 range).

-
source§

impl Not for ThemeMode

§

type Output = ThemeMode

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for ThemeMode

source§

fn cmp(&self, other: &ThemeMode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere +

source§

impl Not for ThemeMode

§

type Output = ThemeMode

The resulting type after applying the ! operator.
source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
source§

impl Ord for ThemeMode

source§

fn cmp(&self, other: &ThemeMode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ThemeMode> for ThemeMode

source§

fn eq(&self, other: &ThemeMode) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
source§

impl PartialEq<ThemeMode> for ThemeMode

source§

fn eq(&self, other: &ThemeMode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ThemeMode> for ThemeMode

source§

fn partial_cmp(&self, other: &ThemeMode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ThemeMode> for ThemeMode

source§

fn partial_cmp(&self, other: &ThemeMode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl PercentBetween for ThemeMode

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

Return the percentage that self is between min and max.
source§

impl Ranged for ThemeMode

source§

const MAX: Self = Self::Dark

The maximum value for this type.
source§

const MIN: Self = Self::Light

The minimum value for this type.
source§

impl Copy for ThemeMode

source§

impl Eq for ThemeMode

source§

impl StructuralEq for ThemeMode

source§

impl StructuralPartialEq for ThemeMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere +operator. Read more

source§

impl PercentBetween for ThemeMode

source§

fn percent_between(&self, min: &Self, max: &Self) -> ZeroToOne

Return the percentage that self is between min and max.
source§

impl Ranged for ThemeMode

source§

const MAX: Self = Self::Dark

The maximum value for this type.
source§

const MIN: Self = Self::Light

The minimum value for this type.
source§

impl Copy for ThemeMode

source§

impl Eq for ThemeMode

source§

impl StructuralEq for ThemeMode

source§

impl StructuralPartialEq for ThemeMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, diff --git a/main/gooey/window/index.html b/main/gooey/window/index.html index 2f57f2f8a..e8dad9408 100644 --- a/main/gooey/window/index.html +++ b/main/gooey/window/index.html @@ -1,2 +1,2 @@ -gooey::window - Rust

Module gooey::window

source ·
Expand description

Types for displaying a Widget inside of a desktop window.

+gooey::window - Rust

Module gooey::window

source ·
Expand description

Types for displaying a Widget inside of a desktop window.

Structs

Enums

  • Controls whether the light or dark theme is applied.

Traits

Type Aliases

\ No newline at end of file diff --git a/main/src/gooey/context.rs.html b/main/src/gooey/context.rs.html index 877c5a915..da2e227b8 100644 --- a/main/src/gooey/context.rs.html +++ b/main/src/gooey/context.rs.html @@ -1441,24 +1441,6 @@ 1441 1442 1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461
//! Types that provide access to the Gooey runtime.
 use std::borrow::Cow;
 use std::ops::{Deref, DerefMut};
@@ -1483,6 +1465,7 @@
     Opacity, TextSize, WidgetBackground,
 };
 use crate::styles::{ComponentDefinition, Styles, Theme, ThemePair};
+use crate::tree::Tree;
 use crate::utils::IgnorePoison;
 use crate::value::{IntoValue, Value};
 use crate::widget::{
@@ -1623,7 +1606,7 @@
     }
 
     pub(crate) fn hover(&mut self, location: Point<Px>) {
-        let changes = self.current_node.tree.hover(Some(&self.current_node));
+        let changes = self.tree.hover(Some(&self.current_node));
         for unhovered in changes.unhovered {
             let mut context = self.for_other(&unhovered);
             unhovered.lock().as_widget().unhover(&mut context);
@@ -1648,7 +1631,7 @@
     }
 
     pub(crate) fn clear_hover(&mut self) {
-        let changes = self.current_node.tree.hover(None);
+        let changes = self.tree.hover(None);
         assert!(changes.hovered.is_empty());
 
         for old_hover in changes.unhovered {
@@ -1662,16 +1645,13 @@
     fn apply_pending_activation(&mut self) {
         let mut activation_changes = 0;
         while activation_changes < Self::MAX_PENDING_CHANGE_CYCLES {
-            let active = self
-                .pending_state
-                .active
-                .and_then(|w| self.current_node.tree.widget(w));
-            if self.current_node.tree.active_widget() == active.as_ref().map(|w| w.node_id) {
+            let active = self.pending_state.active.and_then(|w| self.tree.widget(w));
+            if self.tree.active_widget() == active.as_ref().map(|w| w.node_id) {
                 break;
             }
             activation_changes += 1;
 
-            let new = match self.current_node.tree.activate(active.as_ref()) {
+            let new = match self.tree.activate(active.as_ref()) {
                 Ok(old) => {
                     if let Some(old) = old {
                         let mut old_context = self.for_other(&old);
@@ -1682,10 +1662,7 @@
                 Err(()) => false,
             };
             if new {
-                let active = self
-                    .pending_state
-                    .active
-                    .and_then(|w| self.current_node.tree.widget(w));
+                let active = self.pending_state.active.and_then(|w| self.tree.widget(w));
                 if let Some(active) = &active {
                     active
                         .lock()
@@ -1707,11 +1684,8 @@
     fn apply_pending_focus(&mut self) {
         let mut focus_changes = 0;
         while focus_changes < Self::MAX_PENDING_CHANGE_CYCLES {
-            let focus = self
-                .pending_state
-                .focus
-                .and_then(|w| self.current_node.tree.widget(w));
-            if self.current_node.tree.focused_widget() == focus.as_ref().map(|w| w.node_id) {
+            let focus = self.pending_state.focus.and_then(|w| self.tree.widget(w));
+            if self.tree.focused_widget() == focus.as_ref().map(|w| w.node_id) {
                 break;
             }
             focus_changes += 1;
@@ -1731,7 +1705,7 @@
                     break self.next_focus_after(focus, self.pending_state.focus_is_advancing);
                 }
             });
-            let new = match self.current_node.tree.focus(self.pending_state.focus) {
+            let new = match self.tree.focus(self.pending_state.focus) {
                 Ok(old) => {
                     if let Some(old_widget) = old {
                         let mut old_context = self.for_other(&old_widget);
@@ -1741,7 +1715,7 @@
                         } else {
                             // This widget is rejecting the focus change.
                             drop(old_context);
-                            let _result = self.current_node.tree.focus(Some(old_widget.id()));
+                            let _result = self.tree.focus(Some(old_widget.id()));
                             self.pending_state.focus = Some(old_widget.id());
                             break;
                         }
@@ -1751,11 +1725,7 @@
                 Err(()) => false,
             };
             if new {
-                if let Some(focus) = self
-                    .pending_state
-                    .focus
-                    .and_then(|w| self.current_node.tree.widget(w))
-                {
+                if let Some(focus) = self.pending_state.focus.and_then(|w| self.tree.widget(w)) {
                     focus.lock().as_widget().focus(&mut self.for_other(&focus));
                 }
             } else {
@@ -1780,8 +1750,8 @@
         self.apply_pending_focus();
 
         // Check that our hover widget still exists. If not, we should try to find a new one.
-        if let Some(hover) = self.current_node.tree.hovered_widget() {
-            if self.current_node.tree.widget_from_node(hover).is_none() {
+        if let Some(hover) = self.tree.hovered_widget() {
+            if self.tree.widget_from_node(hover).is_none() {
                 self.update_hovered_widget();
             }
         }
@@ -1790,7 +1760,7 @@
     pub(crate) fn update_hovered_widget(&mut self) {
         self.cursor.widget = None;
         if let Some(location) = self.cursor.location {
-            for widget in self.current_node.tree.widgets_under_point(location) {
+            for widget in self.tree.widgets_under_point(location) {
                 let mut widget_context = self.for_other(&widget);
                 let Some(widget_layout) = widget_context.last_layout() else {
                     continue;
@@ -2127,9 +2097,7 @@
             "redraw called without set_widget_layout"
         );
 
-        self.current_node
-            .tree
-            .note_widget_rendered(self.current_node.node_id);
+        self.tree.note_widget_rendered(self.current_node.node_id);
         let widget = self.current_node.clone();
         let mut widget = widget.lock();
         if !widget.as_widget().full_control_redraw() {
@@ -2287,10 +2255,7 @@
     #[must_use]
     fn push_child(&mut self, child: WidgetInstance) -> MountedWidget {
         let mut context = self.as_event_context();
-        let pushed_widget = context
-            .current_node
-            .tree
-            .push_boxed(child, Some(&context.current_node));
+        let pushed_widget = context.tree.push_boxed(child, Some(&context.current_node));
         pushed_widget
             .lock()
             .as_widget()
@@ -2305,10 +2270,7 @@
             .lock()
             .as_widget()
             .unmounted(&mut context.for_other(child));
-        context
-            .current_node
-            .tree
-            .remove_child(child, &context.current_node);
+        context.tree.remove_child(child, &context.current_node);
     }
 }
 
@@ -2330,6 +2292,7 @@
 /// specific widget.
 pub struct WidgetContext<'context, 'window> {
     current_node: MountedWidget,
+    pub(crate) tree: Tree,
     redraw_status: &'context InvalidationStatus,
     window: &'context mut RunningWindow<'window>,
     theme: Cow<'context, ThemePair>,
@@ -2352,18 +2315,18 @@
             kludgine: window.handle(),
             redraw_status: redraw_status.clone(),
         });
+        let tree = current_node.tree();
         Self {
             pending_state: PendingState::Owned(PendingWidgetState {
-                focus: current_node
-                    .tree
+                focus: tree
                     .focused_widget()
-                    .and_then(|id| current_node.tree.widget_from_node(id).map(|w| w.id())),
-                active: current_node
-                    .tree
+                    .and_then(|id| tree.widget_from_node(id).map(|w| w.id())),
+                active: tree
                     .active_widget()
-                    .and_then(|id| current_node.tree.widget_from_node(id).map(|w| w.id())),
+                    .and_then(|id| tree.widget_from_node(id).map(|w| w.id())),
                 focus_is_advancing: false,
             }),
+            tree,
             effective_styles: current_node.effective_styles(),
             cache: WidgetCacheKey {
                 theme_mode,
@@ -2380,6 +2343,7 @@
     /// Returns a new instance that borrows from `self`.
     pub fn borrowed(&mut self) -> WidgetContext<'_, 'window> {
         WidgetContext {
+            tree: self.tree.clone(),
             current_node: self.current_node.clone(),
             redraw_status: self.redraw_status,
             window: &mut *self.window,
@@ -2419,6 +2383,7 @@
                     enabled: current_node.enabled(&self.handle()),
                 },
                 current_node,
+                tree: self.tree.clone(),
                 redraw_status: self.redraw_status,
                 window: &mut *self.window,
                 theme,
@@ -2431,8 +2396,7 @@
     /// Returns true if `possible_parent` is in this widget's parent list.
     #[must_use]
     pub fn is_child_of(&self, possible_parent: &WidgetInstance) -> bool {
-        self.current_node
-            .tree
+        self.tree
             .is_child(self.current_node.node_id, possible_parent)
     }
 
@@ -2568,7 +2532,7 @@
     /// for more information.
     #[must_use]
     pub fn is_default(&self) -> bool {
-        self.current_node.tree.default_widget() == Some(self.current_node.node_id)
+        self.tree.default_widget() == Some(self.current_node.node_id)
     }
 
     /// Returns true if this widget is the target to activate when the user
@@ -2579,7 +2543,7 @@
     /// for more information.
     #[must_use]
     pub fn is_escape(&self) -> bool {
-        self.current_node.tree.escape_widget() == Some(self.current_node.node_id)
+        self.tree.escape_widget() == Some(self.current_node.node_id)
     }
 
     /// Returns the widget this context is for.
@@ -2790,7 +2754,7 @@
     type Managed = Option<MountedWidget>;
 
     fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed {
-        context.current_node.tree.widget(*self)
+        context.tree.widget(*self)
     }
 }
 
@@ -2798,7 +2762,7 @@
     type Managed = Option<MountedWidget>;
 
     fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed {
-        context.current_node.tree.widget(self.id())
+        context.tree.widget(self.id())
     }
 }
 
@@ -2807,7 +2771,7 @@
 
     fn manage(&self, context: &WidgetContext<'_, '_>) -> Self::Managed {
         match self {
-            WidgetRef::Unmounted(instance) => context.current_node.tree.widget(instance.id()),
+            WidgetRef::Unmounted(instance) => context.tree.widget(instance.id()),
             WidgetRef::Mounted(instance) => Some(instance.clone()),
         }
     }
diff --git a/main/src/gooey/tree.rs.html b/main/src/gooey/tree.rs.html
index 8806f0422..82c36a512 100644
--- a/main/src/gooey/tree.rs.html
+++ b/main/src/gooey/tree.rs.html
@@ -621,8 +621,17 @@
 621
 622
 623
+624
+625
+626
+627
+628
+629
+630
+631
+632
 
use std::mem;
-use std::sync::{Arc, Mutex};
+use std::sync::{Arc, Mutex, Weak};
 
 use ahash::AHashMap;
 use alot::{LotId, Lots};
@@ -686,7 +695,7 @@
         MountedWidget {
             node_id,
             widget,
-            tree: self.clone(),
+            tree: WeakTree(Arc::downgrade(&self.data)),
         }
     }
 
@@ -1044,7 +1053,7 @@
         Some(MountedWidget {
             node_id,
             widget: self.nodes[node_id].widget.clone(),
-            tree: tree.clone(),
+            tree: WeakTree(Arc::downgrade(&tree.data)),
         })
     }
 
@@ -1052,7 +1061,7 @@
         Some(MountedWidget {
             node_id,
             widget: self.nodes.get(node_id)?.widget.clone(),
-            tree: tree.clone(),
+            tree: WeakTree(Arc::downgrade(&tree.data)),
         })
     }
 
@@ -1244,4 +1253,13 @@
     constraints: Size<ConstraintLimit>,
     size: Size<UPx>,
 }
+
+#[derive(Clone, Debug)]
+pub struct WeakTree(Weak<Mutex<TreeData>>);
+
+impl WeakTree {
+    pub fn upgrade(&self) -> Option<Tree> {
+        self.0.upgrade().map(|data| Tree { data })
+    }
+}
 

\ No newline at end of file diff --git a/main/src/gooey/widget.rs.html b/main/src/gooey/widget.rs.html index 8918333b4..ede20a7d1 100644 --- a/main/src/gooey/widget.rs.html +++ b/main/src/gooey/widget.rs.html @@ -2353,6 +2353,17 @@ 2353 2354 2355 +2356 +2357 +2358 +2359 +2360 +2361 +2362 +2363 +2364 +2365 +2366
//! Types for creating reusable widgets (aka components or views).
 
 use std::any::Any;
@@ -2389,7 +2400,7 @@
     ComponentDefinition, ContainerLevel, Dimension, DimensionRange, Edges, IntoComponentValue,
     IntoDynamicComponentValue, Styles, ThemePair, VisualOrder,
 };
-use crate::tree::Tree;
+use crate::tree::{Tree, WeakTree};
 use crate::utils::IgnorePoison;
 use crate::value::{Dynamic, Generation, IntoDynamic, IntoValue, Validation, Value};
 use crate::widgets::checkbox::{Checkable, CheckboxState};
@@ -4048,7 +4059,7 @@
 pub struct MountedWidget {
     pub(crate) node_id: LotId,
     pub(crate) widget: WidgetInstance,
-    pub(crate) tree: Tree,
+    pub(crate) tree: WeakTree,
 }
 
 impl Debug for MountedWidget {
@@ -4058,6 +4069,10 @@
 }
 
 impl MountedWidget {
+    pub(crate) fn tree(&self) -> Tree {
+        self.tree.upgrade().expect("tree missing")
+    }
+
     /// Locks the widget for exclusive access. Locking widgets should only be
     /// done for brief moments of time when you are certain no deadlocks can
     /// occur due to other widget locks being held.
@@ -4068,11 +4083,14 @@
 
     /// Invalidates this widget.
     pub fn invalidate(&self) {
-        self.tree.invalidate(self.node_id, false);
+        let Some(tree) = self.tree.upgrade() else {
+            return;
+        };
+        tree.invalidate(self.node_id, false);
     }
 
     pub(crate) fn set_layout(&self, rect: Rect<Px>) {
-        self.tree.set_layout(self.node_id, rect);
+        self.tree().set_layout(self.node_id, rect);
     }
 
     /// Returns the unique id of this widget instance.
@@ -4095,7 +4113,7 @@
     pub fn next_focus(&self) -> Option<MountedWidget> {
         self.widget
             .next_focus()
-            .and_then(|next_focus| self.tree.widget(next_focus))
+            .and_then(|next_focus| self.tree.upgrade()?.widget(next_focus))
     }
 
     /// Returns the widget to focus before this widget.
@@ -4104,7 +4122,7 @@
     /// automatically using [`MakeWidget::with_next_focus()`].
     #[must_use]
     pub fn previous_focus(&self) -> Option<MountedWidget> {
-        self.tree.previous_focus(self.id())
+        self.tree.upgrade()?.previous_focus(self.id())
     }
 
     /// Returns the next or previous focus target, if one was set using
@@ -4121,85 +4139,89 @@
     /// Returns the region that the widget was last rendered at.
     #[must_use]
     pub fn last_layout(&self) -> Option<Rect<Px>> {
-        self.tree.layout(self.node_id)
+        self.tree.upgrade()?.layout(self.node_id)
     }
 
     /// Returns the effective styles for the current tree.
     #[must_use]
     pub fn effective_styles(&self) -> Styles {
-        self.tree.effective_styles(self.node_id)
+        self.tree().effective_styles(self.node_id)
     }
 
     /// Returns true if this widget is the currently active widget.
     #[must_use]
     pub fn active(&self) -> bool {
-        self.tree.active_widget() == Some(self.node_id)
+        self.tree().active_widget() == Some(self.node_id)
     }
 
     pub(crate) fn enabled(&self, handle: &WindowHandle) -> bool {
-        self.tree.is_enabled(self.node_id, handle)
+        self.tree().is_enabled(self.node_id, handle)
     }
 
     /// Returns true if this widget is currently the hovered widget.
     #[must_use]
     pub fn hovered(&self) -> bool {
-        self.tree.is_hovered(self.node_id)
+        self.tree().is_hovered(self.node_id)
     }
 
     /// Returns true if this widget that is directly beneath the cursor.
     #[must_use]
     pub fn primary_hover(&self) -> bool {
-        self.tree.hovered_widget() == Some(self.node_id)
+        self.tree().hovered_widget() == Some(self.node_id)
     }
 
     /// Returns true if this widget is the currently focused widget.
     #[must_use]
     pub fn focused(&self) -> bool {
-        self.tree.focused_widget() == Some(self.node_id)
+        self.tree().focused_widget() == Some(self.node_id)
     }
 
     /// Returns the parent of this widget.
     #[must_use]
     pub fn parent(&self) -> Option<MountedWidget> {
-        self.tree
-            .parent(self.node_id)
-            .and_then(|id| self.tree.widget_from_node(id))
+        let tree = self.tree.upgrade()?;
+
+        tree.parent(self.node_id)
+            .and_then(|id| tree.widget_from_node(id))
     }
 
     /// Returns true if this node has a parent.
     #[must_use]
     pub fn has_parent(&self) -> bool {
-        self.tree.parent(self.node_id).is_some()
+        let Some(tree) = self.tree.upgrade() else {
+            return false;
+        };
+        tree.parent(self.node_id).is_some()
     }
 
     pub(crate) fn attach_styles(&self, styles: Value<Styles>) {
-        self.tree.attach_styles(self.node_id, styles);
+        self.tree().attach_styles(self.node_id, styles);
     }
 
     pub(crate) fn attach_theme(&self, theme: Value<ThemePair>) {
-        self.tree.attach_theme(self.node_id, theme);
+        self.tree().attach_theme(self.node_id, theme);
     }
 
     pub(crate) fn attach_theme_mode(&self, theme: Value<ThemeMode>) {
-        self.tree.attach_theme_mode(self.node_id, theme);
+        self.tree().attach_theme_mode(self.node_id, theme);
     }
 
     pub(crate) fn overidden_theme(
         &self,
     ) -> (Styles, Option<Value<ThemePair>>, Option<Value<ThemeMode>>) {
-        self.tree.overriden_theme(self.node_id)
+        self.tree().overriden_theme(self.node_id)
     }
 
     pub(crate) fn begin_layout(&self, constraints: Size<ConstraintLimit>) -> Option<Size<UPx>> {
-        self.tree.begin_layout(self.node_id, constraints)
+        self.tree().begin_layout(self.node_id, constraints)
     }
 
     pub(crate) fn persist_layout(&self, constraints: Size<ConstraintLimit>, size: Size<UPx>) {
-        self.tree.persist_layout(self.node_id, constraints, size);
+        self.tree().persist_layout(self.node_id, constraints, size);
     }
 
     pub(crate) fn visually_ordered_children(&self, order: VisualOrder) -> Vec<MountedWidget> {
-        self.tree.visually_ordered_children(self.node_id, order)
+        self.tree().visually_ordered_children(self.node_id, order)
     }
 }
 
@@ -4657,7 +4679,7 @@
     /// Finds this widget mounted in this window, if present.
     #[must_use]
     pub fn find_in(self, context: &WidgetContext<'_, '_>) -> Option<MountedWidget> {
-        context.widget().tree.widget(self)
+        context.tree.widget(self)
     }
 }
 
diff --git a/main/src/gooey/window.rs.html b/main/src/gooey/window.rs.html
index aa7f22209..d40b3badd 100644
--- a/main/src/gooey/window.rs.html
+++ b/main/src/gooey/window.rs.html
@@ -1487,20 +1487,6 @@
 1487
 1488
 1489
-1490
-1491
-1492
-1493
-1494
-1495
-1496
-1497
-1498
-1499
-1500
-1501
-1502
-1503
 
//! Types for displaying a [`Widget`] inside of a desktop window.
 
 use std::cell::RefCell;
@@ -1903,6 +1889,7 @@
 
 struct GooeyWindow<T> {
     behavior: T,
+    tree: Tree,
     root: MountedWidget,
     contents: Drawing,
     should_close: bool,
@@ -1948,11 +1935,11 @@
         kludgine: &mut Kludgine,
     ) {
         if is_pressed {
-            if let Some(default) = widget.and_then(|id| self.root.tree.widget_from_node(id)) {
+            if let Some(default) = widget.and_then(|id| self.tree.widget_from_node(id)) {
                 if let Some(previously_active) = self
                     .keyboard_activated
                     .take()
-                    .and_then(|id| self.root.tree.widget(id))
+                    .and_then(|id| self.tree.widget(id))
                 {
                     EventContext::new(
                         WidgetContext::new(
@@ -1984,7 +1971,7 @@
         } else if let Some(keyboard_activated) = self
             .keyboard_activated
             .take()
-            .and_then(|id| self.root.tree.widget(id))
+            .and_then(|id| self.tree.widget(id))
         {
             EventContext::new(
                 WidgetContext::new(
@@ -2012,7 +1999,7 @@
         let mut padding = Edges::<Px>::default();
 
         loop {
-            let Some(managed) = self.root.tree.widget(root_or_child.id()) else {
+            let Some(managed) = self.tree.widget(root_or_child.id()) else {
                 break;
             };
 
@@ -2184,7 +2171,8 @@
             &mut RunningWindow::new(window, &gooey, &focused, &occluded, &inner_size),
             context.user,
         );
-        let root = Tree::default().push_boxed(behavior.make_root(), None);
+        let tree = Tree::default();
+        let root = tree.push_boxed(behavior.make_root(), None);
 
         let (current_theme, theme) = match theme {
             Value::Constant(theme) => (theme, None),
@@ -2194,6 +2182,7 @@
         Self {
             behavior,
             root,
+            tree,
             contents: Drawing::default(),
             should_close: false,
             cursor: CursorState {
@@ -2234,8 +2223,7 @@
 
         self.redraw_status.refresh_received();
         graphics.reset_text_attributes();
-        self.root
-            .tree
+        self.tree
             .new_frame(self.redraw_status.invalidations().drain());
 
         let resizable = window.winit().is_resizable();
@@ -2444,8 +2432,8 @@
         input: KeyEvent,
         is_synthetic: bool,
     ) {
-        let target = self.root.tree.focused_widget().unwrap_or(self.root.node_id);
-        let Some(target) = self.root.tree.widget_from_node(target) else {
+        let target = self.tree.focused_widget().unwrap_or(self.root.node_id);
+        let Some(target) = self.tree.widget_from_node(target) else {
             return;
         };
         let mut window = RunningWindow::new(
@@ -2490,12 +2478,8 @@
                     if input.state.is_pressed() {
                         let reverse = window.modifiers().state().shift_key();
 
-                        let target = self.root.tree.focused_widget().unwrap_or(self.root.node_id);
-                        let target = self
-                            .root
-                            .tree
-                            .widget_from_node(target)
-                            .expect("missing widget");
+                        let target = self.tree.focused_widget().unwrap_or(self.root.node_id);
+                        let target = self.tree.widget_from_node(target).expect("missing widget");
                         let mut target = EventContext::new(
                             WidgetContext::new(
                                 target,
@@ -2518,7 +2502,7 @@
                 Key::Named(NamedKey::Enter) => {
                     self.keyboard_activate_widget(
                         input.state.is_pressed(),
-                        self.root.tree.default_widget(),
+                        self.tree.default_widget(),
                         &mut window,
                         kludgine,
                     );
@@ -2526,7 +2510,7 @@
                 Key::Named(NamedKey::Escape) => {
                     self.keyboard_activate_widget(
                         input.state.is_pressed(),
-                        self.root.tree.escape_widget(),
+                        self.tree.escape_widget(),
                         &mut window,
                         kludgine,
                     );
@@ -2553,16 +2537,10 @@
         phase: TouchPhase,
     ) {
         let widget = self
-            .root
-            .tree
+            .tree
             .hovered_widget()
-            .and_then(|hovered| self.root.tree.widget_from_node(hovered))
-            .unwrap_or_else(|| {
-                self.root
-                    .tree
-                    .widget(self.root.id())
-                    .expect("missing widget")
-            });
+            .and_then(|hovered| self.tree.widget_from_node(hovered))
+            .unwrap_or_else(|| self.tree.widget(self.root.id()).expect("missing widget"));
 
         let mut window = RunningWindow::new(
             window,
@@ -2596,16 +2574,10 @@
         ime: Ime,
     ) {
         let widget = self
-            .root
-            .tree
+            .tree
             .focused_widget()
-            .and_then(|hovered| self.root.tree.widget_from_node(hovered))
-            .unwrap_or_else(|| {
-                self.root
-                    .tree
-                    .widget(self.root.id())
-                    .expect("missing widget")
-            });
+            .and_then(|hovered| self.tree.widget_from_node(hovered))
+            .unwrap_or_else(|| self.tree.widget(self.root.id()).expect("missing widget"));
         let mut window = RunningWindow::new(
             window,
             &self.gooey,
@@ -2663,7 +2635,7 @@
         if let Some(state) = self.mouse_buttons.get(&device_id) {
             // Mouse Drag
             for (button, handler) in state {
-                let Some(handler) = self.root.tree.widget(*handler) else {
+                let Some(handler) = self.tree.widget(*handler) else {
                     continue;
                 };
                 let mut context = EventContext::new(
@@ -2747,7 +2719,7 @@
                 if let (ElementState::Pressed, Some(location), Some(hovered)) = (
                     state,
                     self.cursor.location,
-                    self.cursor.widget.and_then(|id| self.root.tree.widget(id)),
+                    self.cursor.widget.and_then(|id| self.tree.widget(id)),
                 ) {
                     if let Some(handler) = recursively_handle_event(
                         &mut EventContext::new(
@@ -2786,7 +2758,7 @@
                 if device_buttons.is_empty() {
                     self.mouse_buttons.remove(&device_id);
                 }
-                let Some(handler) = self.root.tree.widget(handler) else {
+                let Some(handler) = self.tree.widget(handler) else {
                     return;
                 };
                 let cursor_location = self.cursor.location;