pub struct Theme { /* private fields */ }Expand description
A resolved theme. Construct with Theme::new (One-Dark) or
Theme::with_palette; every accessor returns a ratatui Style that is
plain (Style::default) when color is disabled.
Implementations§
Source§impl Theme
impl Theme
Sourcepub fn new(enabled: bool) -> Theme
pub fn new(enabled: bool) -> Theme
Builds a theme over the default (One-Dark) palette. When enabled is
false every color accessor returns a plain style, preserving the
monochrome (NO_COLOR) appearance.
Sourcepub fn with_palette(enabled: bool, palette: Palette) -> Theme
pub fn with_palette(enabled: bool, palette: Palette) -> Theme
Builds a theme over a specific Palette (the configured one). Color is
still gated by enabled.
Sourcepub fn enabled(&self) -> bool
pub fn enabled(&self) -> bool
Whether color is enabled (some widgets adjust their fallback styling).
Sourcepub fn branchless(&self) -> Style
pub fn branchless(&self) -> Style
Style for the worktree-less branch marker (○): muted, since a branch row
is secondary to the real worktrees above it (issue #47).
Sourcepub fn ahead(&self, count: u32) -> Style
pub fn ahead(&self, count: u32) -> Style
Style for the ahead count (↑N): green when ahead, muted at zero.
Sourcepub fn behind(&self, count: u32) -> Style
pub fn behind(&self, count: u32) -> Style
Style for the behind count (↓N): red when behind, muted at zero.
Sourcepub fn commit_hash(&self) -> Style
pub fn commit_hash(&self) -> Style
Style for a commit short hash.
Sourcepub fn branch(&self, is_current: bool, is_detached: bool) -> Style
pub fn branch(&self, is_current: bool, is_detached: bool) -> Style
Style for a branch name, by role.
Sourcepub fn pr_state(&self, state: PrState) -> Style
pub fn pr_state(&self, state: PrState) -> Style
Style for a PR’s number/state cell, by PR state.
Sourcepub fn selection(&self) -> Style
pub fn selection(&self) -> Style
The selected-row highlight: a background bar when color is enabled (so the per-field foreground colors stay readable), reversed video otherwise.
Sourcepub fn selection_symbol(&self) -> &'static str
pub fn selection_symbol(&self) -> &'static str
The left-bar highlight symbol for the selected row.
Sourcepub fn mode_chip(&self, mode: &Mode) -> Style
pub fn mode_chip(&self, mode: &Mode) -> Style
The status-bar mode chip, colored per mode (reversed when disabled).
Sourcepub fn border(&self, focused: bool) -> Style
pub fn border(&self, focused: bool) -> Style
A pane border style; the focused pane is accented, others muted.
Sourcepub fn title(&self, focused: bool) -> Style
pub fn title(&self, focused: bool) -> Style
A pane title style; the focused pane is accented/bold, others muted.
Sourcepub fn hint_label(&self) -> Style
pub fn hint_label(&self) -> Style
Style for the description text next to a key hint.
Sourcepub fn status(&self, kind: StatusKind) -> Style
pub fn status(&self, kind: StatusKind) -> Style
Style for a transient status message, by severity.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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