Skip to main content

Theme

Struct Theme 

Source
pub struct Theme {
    pub no_color: bool,
    pub color_support: ColorSupport,
    pub mode: ThemeMode,
    /* private fields */
}
Expand description

Theme configuration supporting --no-color mode and adaptive light/dark palettes.

The theme is deterministic: given the same (ThemeMode, ColorSupport), all style methods return identical Style values (Requirement 35.8 / Property 34). ColorSupport::None always takes precedence over the mode — no colours are emitted regardless of palette (Req 35.7).

Fields§

§no_color: bool§color_support: ColorSupport§mode: ThemeMode

Implementations§

Source§

impl Theme

Source

pub fn new(no_color: bool, mode: ThemeMode) -> Self

Create a new theme with automatic colour-support detection and an explicitly resolved ThemeMode.

Source

pub fn with_color_support(color_support: ColorSupport) -> Self

Create a theme with an explicit colour-support level (useful for testing). Defaults to ThemeMode::Dark for backward compatibility.

Source

pub fn with_color_support_mode( color_support: ColorSupport, mode: ThemeMode, ) -> Self

Create a theme with an explicit colour-support level and mode.

Source

pub fn toggle_mode(&mut self)

Toggle between Dark and Light mode at runtime (Req 35.6), rebuilding the active palette.

Source

pub fn sidebar_style(&self) -> Style

Source

pub fn sidebar_selected(&self) -> Style

Source

pub fn list_item(&self) -> Style

Source

pub fn list_selected(&self) -> Style

Source

pub fn detail_key(&self) -> Style

Source

pub fn detail_value(&self) -> Style

Source

pub fn status_bar(&self) -> Style

Source

pub fn help_bar(&self) -> Style

Source

pub fn error_style(&self) -> Style

Source

pub fn search_style(&self) -> Style

Source

pub fn border_style(&self) -> Style

Source

pub fn border_focused(&self) -> Style

Style for the focused panel border (Requirement 16.6). Visually distinct from unfocused borders to indicate active panel.

Source

pub fn border_unfocused(&self) -> Style

Style for unfocused panel border (Requirement 16.6). Subdued compared to focused border.

Source

pub fn gate_not_run(&self) -> Style

Style for validation gate status: NotRun (dim/gray).

Source

pub fn gate_running(&self) -> Style

Style for validation gate status: Running (warning/yellow).

Source

pub fn gate_passed(&self) -> Style

Style for validation gate status: Passed (green).

Source

pub fn gate_failed(&self) -> Style

Style for validation gate status: Failed (red).

Source

pub fn gate_timed_out(&self) -> Style

Style for validation gate status: TimedOut (info/magenta).

Source

pub fn filter_chip(&self) -> Style

Style for filter chips display.

Source

pub fn sparkline_filled(&self) -> Style

Style for sparkline bar (filled portion).

Source

pub fn sparkline_empty(&self) -> Style

Style for sparkline bar (empty portion).

Source

pub fn help_overlay_title(&self) -> Style

Style for help overlay title.

Source

pub fn help_overlay_section(&self) -> Style

Style for help overlay section header.

Source

pub fn completion_highlight(&self) -> Style

Style for completion suggestion (highlighted).

Source

pub fn completion_normal(&self) -> Style

Style for completion suggestion (normal).

Auto Trait Implementations§

§

impl Freeze for Theme

§

impl RefUnwindSafe for Theme

§

impl Send for Theme

§

impl Sync for Theme

§

impl Unpin for Theme

§

impl UnsafeUnpin for Theme

§

impl UnwindSafe for Theme

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<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> Same for T

Source§

type Output = T

Should always be Self
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