Skip to main content

ComputedStates

Struct ComputedStates 

Source
pub struct ComputedStates {
Show 25 fields pub base: Rc<StyleRefinement>, pub hover: Option<Rc<StyleRefinement>>, pub active: Option<Rc<StyleRefinement>>, pub focus: Option<Rc<StyleRefinement>>, pub focus_visible: Option<Rc<StyleRefinement>>, pub focus_within: Option<Rc<StyleRefinement>>, pub group_hover: Option<(u64, Rc<StyleRefinement>)>, pub group_active: Option<(u64, Rc<StyleRefinement>)>, pub group_focus: Option<Rc<GroupFocus>>, pub transitions: Rc<Vec<TransitionSpec>>, pub animations: Rc<Vec<AnimationSpec>>, pub extras: Extras, pub before: Option<Rc<PseudoBox>>, pub after: Option<Rc<PseudoBox>>, pub placeholder: Option<Rc<StyleRefinement>>, pub selection: Option<Rc<StyleRefinement>>, pub file_selector_button: Option<Rc<StyleRefinement>>, pub range_track: Option<Rc<ControlPseudo>>, pub range_thumb: Option<Rc<ControlPseudo>>, pub color_swatch: Option<Rc<ControlPseudo>>, pub color_swatch_wrapper: Option<Rc<ControlPseudo>>, pub vars: Rc<Vars>, pub color: Option<Hsla>, pub font_size: f32, pub computed_font: Font, /* private fields */
}

Fields§

§base: Rc<StyleRefinement>§hover: Option<Rc<StyleRefinement>>§active: Option<Rc<StyleRefinement>>§focus: Option<Rc<StyleRefinement>>

:focus — gpui’s .focus() rung. A node that has one MUST be given a tracked focus handle by the renderer, or gpui has nothing to key it on.

§focus_visible: Option<Rc<StyleRefinement>>§focus_within: Option<Rc<StyleRefinement>>§group_hover: Option<(u64, Rc<StyleRefinement>)>§group_active: Option<(u64, Rc<StyleRefinement>)>§group_focus: Option<Rc<GroupFocus>>

:focus, :focus-visible and :focus-within on an ancestor compound, folded at render.

§transitions: Rc<Vec<TransitionSpec>>§animations: Rc<Vec<AnimationSpec>>§extras: Extras§before: Option<Rc<PseudoBox>>§after: Option<Rc<PseudoBox>>§placeholder: Option<Rc<StyleRefinement>>§selection: Option<Rc<StyleRefinement>>

Only background-color reaches the widget: gpui’s selection is a quad behind the glyphs.

§file_selector_button: Option<Rc<StyleRefinement>>§range_track: Option<Rc<ControlPseudo>>§range_thumb: Option<Rc<ControlPseudo>>§color_swatch: Option<Rc<ControlPseudo>>§color_swatch_wrapper: Option<Rc<ControlPseudo>>§vars: Rc<Vars>

Children read this one, so the restyle pass must walk in document order.

§color: Option<Hsla>

The effective color (own or threaded from the parent), kept only because currentColor is a computed value that needs it; no other inherited text property is folded here.

§font_size: f32§computed_font: Font

Implementations§

Source§

impl ComputedStates

Source

pub fn needs_focus_handle(&self) -> bool

True when the renderer has to give this node a focus handle for gpui to have anything to hang the focus rungs on.

Source

pub fn control_state(&self, rung: usize) -> bool

Source

pub fn hover_transitions(&self) -> bool

Source

pub fn hovered(&self, own: bool, group: bool) -> Option<StyleRefinement>

The refinement with the pointer over the element and/or its .group ancestor. It must fold in gpui’s order (group-hover, then hover) so both paths end on the same value.

Trait Implementations§

Source§

impl Clone for ComputedStates

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ComputedStates

Source§

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

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

impl Default for ComputedStates

Source§

fn default() -> Self

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

impl PartialEq for ComputedStates

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ComputedStates

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more