pub struct StyleSet {Show 17 fields
pub name: String,
pub author: String,
pub is_dark: bool,
pub primary: Style,
pub secondary: Style,
pub muted: Style,
pub border: Style,
pub border_muted: Style,
pub selection: Style,
pub cursor: Style,
pub cursor_muted: Style,
pub error: Style,
pub warning: Style,
pub info: Style,
pub success: Style,
pub highlight: Style,
pub link: Style,
/* private fields */
}Expand description
The main StyleSet struct with predefined styles as named fields
Fields§
§name: StringHuman-readable theme name.
Theme author name or contact. Empty string if not specified.
is_dark: booltrue for dark themes, false for light themes.
primary: StyleThe primary style for normal text and other elements.
secondary: StyleA secondary style, for sidebars or other secondary elements.
muted: StyleA muted style for disabled/deselected elements.
border: StyleA style for borders and other decorative elements.
border_muted: StyleA style for disabled borders and other decorative elements.
selection: StyleA style for selected text or elements.
cursor: StyleA cursor style
cursor_muted: StyleA disabled cursor style
error: StyleA style for errors
warning: StyleA style for warnings
info: StyleA style for informative text or elements such as spinners
success: StyleIt works!
highlight: StyleA style for highlighted information or elements
link: StyleURLs or other links
Implementations§
Source§impl StyleSet
impl StyleSet
Sourcepub fn from_name(name: &str) -> Self
pub fn from_name(name: &str) -> Self
Create a StyleSet from a theme name, with reasonable fallbacks.
Accepts any common case format: "Nord Dark", "nord-dark", "NordDark".
Sourcepub fn from_default_light_cfg() -> Self
pub fn from_default_light_cfg() -> Self
Create a light StyleSet from the user’s configured light default.
Fallback order:
- User configured light theme.
- Built-in default light theme.
Sourcepub fn insert_custom(&mut self, key: impl Into<String>, style: Style)
pub fn insert_custom(&mut self, key: impl Into<String>, style: Style)
Add a custom style by name
Sourcepub fn get_custom(&self, key: &str) -> Option<&Style>
pub fn get_custom(&self, key: &str) -> Option<&Style>
Get a custom style by name
Trait Implementations§
Source§impl Default for StyleSet
Available on crate feature fs only.Returns the user’s configured default theme as a StyleSet, falling back to the built-in default.
impl Default for StyleSet
fs only.Returns the user’s configured default theme as a StyleSet, falling back to the built-in default.
Reads $XDG_CONFIG_HOME/tca/tca.toml if the fs feature is enabled.
For a guaranteed no-I/O default, convert directly from a BuiltinTheme.
Auto Trait Implementations§
impl Freeze for StyleSet
impl RefUnwindSafe for StyleSet
impl Send for StyleSet
impl Sync for StyleSet
impl Unpin for StyleSet
impl UnsafeUnpin for StyleSet
impl UnwindSafe for StyleSet
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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