Skip to main content

Extras

Struct Extras 

Source
pub struct Extras {
Show 57 fields pub object_fit: Option<ObjectFit>, pub window_drag: Option<WindowDrag>, pub window_control: Option<WindowControl>, pub fixed: Option<bool>, pub drop_shadow: Option<DropShadow>, pub sticky: Option<bool>, pub z_index: Option<Option<i32>>, pub isolate: Option<bool>, pub positioned: Option<bool>, pub pointer_events_none: Option<bool>, pub visibility_hidden: Option<bool>, pub user_select: Option<UserSelect>, pub inline_level: Option<bool>, pub appearance_none: Option<bool>, pub accent_color: Option<Option<Hsla>>, pub fill: Option<SvgPaint>, pub stroke: Option<SvgPaint>, pub svg_presentation: Option<Rc<Vec<(&'static str, Rc<str>)>>>, pub text_transform: Option<TextTransform>, pub white_space: Option<WhiteSpaceMode>, pub content: Option<Rc<str>>, pub content_none: bool, pub background_clip_text: Option<bool>, pub text_fill_color: Option<TextFill>, pub background_key_color: Option<Hsla>, pub background_images: Option<Rc<Vec<BackgroundLayer>>>, pub background_urls: Option<Rc<Vec<BackgroundUrl>>>, pub background_size: Option<Rc<Vec<BackgroundSize>>>, pub background_position: Option<Rc<Vec<(TileLength, TileLength)>>>, pub background_repeat: Option<Rc<Vec<(bool, bool)>>>, pub list_marker: Option<ListMarker>, pub list_marker_inside: Option<bool>, pub web_font: Option<Rc<[String]>>, pub underline_offset: Option<f32>, pub decoration: DecorationPatch, pub outline: OutlinePatch, pub current_color: CurrentColorTargets, pub current_color_overrides: CurrentColorTargets, pub blur: Option<f32>, pub filter_url: Option<Rc<str>>, pub scrollbar_width: Option<ScrollbarWidth>, pub scrollbar_color: Option<(Hsla, Hsla)>, pub overscroll_x: Option<OverscrollBehavior>, pub overscroll_y: Option<OverscrollBehavior>, pub contain_paint: Option<bool>, pub contain_size: Option<u8>, pub scroll_smooth: Option<bool>, pub overflow_x: Option<OverflowKeyword>, pub overflow_y: Option<OverflowKeyword>, pub mask_images: Option<MaskImages>, pub mask_clips: Option<MaskClips>, pub mask_composite: Option<MaskCompositing>, pub mask: MaskPatch, pub radius_inherit: RadiusInherit, pub view_transition_name: Option<Option<Rc<str>>>, pub view_transition_class: Option<Rc<[Rc<str>]>>, pub plus_lighter: Option<bool>,
}

Fields§

§object_fit: Option<ObjectFit>§window_drag: Option<WindowDrag>

None means undeclared, which lets the renderer inherit the parent’s value; Some(None) is an explicit opt-out.

§window_control: Option<WindowControl>§fixed: Option<bool>§drop_shadow: Option<DropShadow>§sticky: Option<bool>

Whether sticky diverges depends on whether an ancestor scrolls, which only the renderer knows (advise_out_of_flow).

§z_index: Option<Option<i32>>§isolate: Option<bool>§positioned: Option<bool>

The element declared a position other than static. gpui cannot say this: static and relative both map onto its default Relative.

§pointer_events_none: Option<bool>

The cascade folds only the element’s own declaration; restyle_with rewrites it to the effective (inherited) value before the states are stored.

§visibility_hidden: Option<bool>

The declared visibility. gpui’s own switch also goes off for the screen-reader-only clip: rect(0 0 0 0), while CSS visibility stays visible (read by el.focus()).

§user_select: Option<UserSelect>

user-select as declared; auto defers to the parent when a selection asks (sk_tree::selection), so it is not folded down.

§inline_level: Option<bool>

The display had an inline outer type. taffy lays the box out block-level, which ignores the parent’s text-align; the renderer advises (advise_inline_level).

§appearance_none: Option<bool>§accent_color: Option<Option<Hsla>>§fill: Option<SvgPaint>§stroke: Option<SvgPaint>§svg_presentation: Option<Rc<Vec<(&'static str, Rc<str>)>>>§text_transform: Option<TextTransform>

text-transform. gpui has no such text-style field: the shaper is handed a string, so the case change is applied to that string by the renderer.

§white_space: Option<WhiteSpaceMode>

The whitespace-processing half of white-space; gpui models only whether a line may wrap, so collapsing is applied to the string by the renderer, like text_transform.

§content: Option<Rc<str>>§content_none: bool

content: none / normal was declared: a later rule that says so takes back the string an earlier one gave, where leaving content unset says nothing.

§background_clip_text: Option<bool>§text_fill_color: Option<TextFill>

-webkit-text-fill-color overrides foreground color, independently of the background clipped behind the text.

§background_key_color: Option<Hsla>§background_images: Option<Rc<Vec<BackgroundLayer>>>

Kept apart from the refinement: size/position/repeat are separate properties, often from separate rules, folded onto the layers after the cascade.

§background_urls: Option<Rc<Vec<BackgroundUrl>>>§background_size: Option<Rc<Vec<BackgroundSize>>>§background_position: Option<Rc<Vec<(TileLength, TileLength)>>>§background_repeat: Option<Rc<Vec<(bool, bool)>>>§list_marker: Option<ListMarker>§list_marker_inside: Option<bool>§web_font: Option<Rc<[String]>>

The web fonts this element’s font-family asks for that are not loaded yet: the families of the list, up to the one used, that set_web_font_families named, in order.

§underline_offset: Option<f32>§decoration: DecorationPatch§outline: OutlinePatch§current_color: CurrentColorTargets

currentColor is the computed color, unknown while a declaration is mapped (no inherited text property is folded), so targets are recorded and substituted after the cascade.

§current_color_overrides: CurrentColorTargets§blur: Option<f32>

filter: blur() radius in px. Exact only for a solid, contentless leaf box (the “glow blob”), which the renderer repaints as its own shadow.

§filter_url: Option<Rc<str>>§scrollbar_width: Option<ScrollbarWidth>§scrollbar_color: Option<(Hsla, Hsla)>§overscroll_x: Option<OverscrollBehavior>§overscroll_y: Option<OverscrollBehavior>§contain_paint: Option<bool>

contain includes paint containment: the box clips its content as overflow: clip does.

§contain_size: Option<u8>

The axes contain size-contains (Extras::CONTAIN_WIDTH, Extras::CONTAIN_HEIGHT).

§scroll_smooth: Option<bool>

scroll-behavior: smooth: a programmatic scroll of this box that does not say otherwise glides.

§overflow_x: Option<OverflowKeyword>

Only a qualifier of the refinement’s axis, which stays the truth (see compute_overflow).

§overflow_y: Option<OverflowKeyword>§mask_images: Option<MaskImages>

mask-image (or the mask shorthand’s images). The three mask_* fields are kept apart because they cascade apart, and Extras::mask_ring reads them together.

§mask_clips: Option<MaskClips>§mask_composite: Option<MaskCompositing>§mask: MaskPatch§radius_inherit: RadiusInherit§view_transition_name: Option<Option<Rc<str>>>

view-transition-name; Some(None) is none, auto and match-element are kept as written.

§view_transition_class: Option<Rc<[Rc<str>]>>

view-transition-class; empty is none.

§plus_lighter: Option<bool>

mix-blend-mode: plus-lighter (Some(false) is normal); only view transition images blend.

Implementations§

Source§

impl Extras

Source

pub fn mask_ring(&self) -> bool

Source

pub fn resolve_background_layers(&self) -> Vec<Background>

Source

pub fn resolve_background_stack(&self) -> Option<Vec<PaintLayer>>

Source

pub fn resolve_mask_stack(&self) -> Option<MaskStack>

The mask to paint, or None when every layer is none. Not for the gradient-border ring (Extras::mask_ring), which the background paints itself.

Source

pub fn z(&self) -> Option<i32>

Source

pub fn may_defer(&self) -> bool

A superset of what the renderer defers (whether z-index applies depends on the parent’s display); safe for a cache that refuses boundaries conservatively.

Source§

impl Extras

Source

pub const CONTAIN_WIDTH: u8 = 1

Source

pub const CONTAIN_HEIGHT: u8 = 2

Source

pub fn overflow_names(&self, base: &StyleRefinement) -> [&'static str; 2]

Trait Implementations§

Source§

impl Clone for Extras

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 Extras

Source§

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

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

impl Default for Extras

Source§

fn default() -> Self

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

impl PartialEq for Extras

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 Extras

Auto Trait Implementations§

§

impl !Send for Extras

§

impl !Sync for Extras

§

impl Forget for Extras

§

impl Freeze for Extras

§

impl Move for Extras

§

impl RefUnwindSafe for Extras

§

impl Unpin for Extras

§

impl UnsafeUnpin for Extras

§

impl UnwindSafe for Extras

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