Skip to main content

PaneAffordanceTheme

Struct PaneAffordanceTheme 

Source
pub struct PaneAffordanceTheme {
    pub background: Color,
    pub splitter_idle: Color,
    pub splitter_hover: Color,
    pub splitter_active: Color,
    pub snap: Color,
    pub focus_ring: Color,
    pub high_contrast: bool,
}
Expand description

Themeable colors for pane interaction affordances (bd-3bfbp).

Covers the splitter rail/handle in its three interaction states (idle / hover / active), the magnetic-snap dock-preview emphasis, and the keyboard focus ring around the active pane. Every color is derived from a ResolvedTheme slot — there are no ad-hoc hardcoded values — and then contrast-clamped so the affordance stays visible against the pane surface it is drawn on:

  • In the default profile each state meets at least WCAG AA: the large-text bar (3.0:1) for the ever-present low-emphasis idle divider, and the normal-text bar (4.5:1) for the meaning-bearing hover/active/snap/ring states.
  • In the high-contrast profile (high_contrast = true) every state is lifted to WCAG AAA (7.0:1).

Clamping preserves the themed hue when it already passes the target, and otherwise blends it toward whichever extreme (pure black or pure white) maximizes contrast with the surface, by the smallest amount that reaches the target ratio. This keeps affordances on-palette in well-designed themes while guaranteeing they never become invisible in low-contrast ones.

Fields§

§background: Color

Surface the affordances are drawn on (the pane background).

§splitter_idle: Color

Idle splitter rail/handle (low-emphasis, always-present divider).

§splitter_hover: Color

Hovered splitter (pointer over the handle).

§splitter_active: Color

Actively dragged splitter.

§snap: Color

Magnetic-snap / dock-preview emphasis.

§focus_ring: Color

Keyboard focus ring around the active pane.

§high_contrast: bool

Whether this was built in the high-contrast profile.

Implementations§

Source§

impl PaneAffordanceTheme

Source

pub fn from_resolved(theme: &ResolvedTheme, high_contrast: bool) -> Self

Derive affordance colors from a resolved theme.

high_contrast selects the WCAG target tier (AA vs AAA). Pass the effective accessibility preference for the host here.

Source

pub fn min_contrast_ratio(&self) -> f64

The minimum WCAG contrast ratio across all affordance states vs the surface. Useful as a single accessibility health metric in tests.

Trait Implementations§

Source§

impl Clone for PaneAffordanceTheme

Source§

fn clone(&self) -> PaneAffordanceTheme

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 Copy for PaneAffordanceTheme

Source§

impl Debug for PaneAffordanceTheme

Source§

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

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

impl Eq for PaneAffordanceTheme

Source§

impl PartialEq for PaneAffordanceTheme

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PaneAffordanceTheme

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for 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<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