Skip to main content

Theme

Struct Theme 

Source
#[non_exhaustive]
pub struct Theme {
Show 34 fields pub text: Color, pub accent: Color, pub result_accent: Color, pub focus: Color, pub success: Color, pub info: Color, pub warning: Color, pub metadata: Color, pub border: Color, pub shell_border: Color, pub panel_focus_border: Color, pub error: Color, pub dim: Color, pub input_bg: Color, pub shell_bg: Color, pub sidebar_bg: Color, pub workspace_bg: Color, pub focus_bg: Color, pub panel_bg: Color, pub surface_raised: Color, pub header_bg: Color, pub selection_bg: Color, pub selection_fg: Color, pub selected_idle_bg: Color, pub selected_idle_fg: Color, pub pill_bg: Color, pub badge_bg: Color, pub primary_action_bg: Color, pub primary_action_fg: Color, pub secondary_action_bg: Color, pub secondary_action_fg: Color, pub preview_bg: Color, pub overlay_bg: Color, pub divider: Color,
}
Expand description

Public configuration and theming types. UI colors used across the TUI.

Most applications can start from Theme::from_preset and override only the fields they want to change.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§text: Color

Primary text color.

§accent: Color

Accent color for interactive UI chrome.

§result_accent: Color

Accent color for breadcrumb and command/result emphasis.

§focus: Color

Focus treatment color for active controls and panels.

§success: Color

Success-oriented feedback color.

§info: Color

Informative accent for source and state metadata.

§warning: Color

Caution-oriented color reserved for non-error warning states.

§metadata: Color

Passive metadata and descriptive text color.

§border: Color

Border color.

§shell_border: Color

Border color for passive shell chrome.

§panel_focus_border: Color

Focused interactive panel border color.

§error: Color

Error color.

§dim: Color

Dimmed text color.

§input_bg: Color

Input background color.

§shell_bg: Color

Background for the outer shell frame.

§sidebar_bg: Color

Background for the navigation surface.

§workspace_bg: Color

Background for the active editing surface.

§focus_bg: Color

Focused row background color.

§panel_bg: Color

Panel background color.

§surface_raised: Color

Raised surface for selected rows and compact controls.

§header_bg: Color

Header band background color.

§selection_bg: Color

Filled background for selected items.

§selection_fg: Color

Foreground for selected items.

§selected_idle_bg: Color

Background for selected but unfocused items.

§selected_idle_fg: Color

Foreground for selected but unfocused items.

§pill_bg: Color

Pill background color.

§badge_bg: Color

Badge background color for compact metadata chips.

§primary_action_bg: Color

Primary action background color.

§primary_action_fg: Color

Primary action foreground color.

§secondary_action_bg: Color

Secondary action background color.

§secondary_action_fg: Color

Secondary action foreground color.

§preview_bg: Color

Background for the read-only preview band.

§overlay_bg: Color

Background for overlays such as dropdowns and help.

§divider: Color

Divider color.

Implementations§

Source§

impl Theme

Source

pub fn from_preset(preset: ThemePreset) -> Self

Build a theme from a built-in preset.

Trait Implementations§

Source§

impl Clone for Theme

Source§

fn clone(&self) -> Theme

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 Theme

Source§

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

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

impl Default for Theme

Source§

fn default() -> Self

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

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> 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, 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> 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.