pub struct TocConfig {Show 17 fields
pub compact_width: u16,
pub expanded_width: u16,
pub height: u16,
pub style: TocStyle,
pub text_style: Style,
pub active_style: Style,
pub hover_style: Style,
pub accent_style: Style,
pub active_accent_style: Style,
pub background_style: Style,
pub line_style: Style,
pub active_line_style: Style,
pub show_border: bool,
pub border_style: Style,
pub title_style: Style,
pub title: String,
pub line_spacing: u8,
}Expand description
Configuration for TOC appearance.
Fields§
§compact_width: u16Width of the TOC in compact mode.
expanded_width: u16Width of the TOC in expanded mode.
height: u16Height of the TOC.
style: TocStyleVisual style mode for the TOC.
text_style: StyleStyle for normal heading text.
active_style: StyleStyle for the current/active heading.
hover_style: StyleStyle for hovered heading.
accent_style: StyleStyle for the accent bar in clerk mode (left border indicator).
active_accent_style: StyleStyle for the active accent bar in clerk mode.
background_style: StyleBackground style for the TOC panel.
line_style: StyleStyle for the compact mode lines.
active_line_style: StyleStyle for the active line in compact mode.
show_border: boolWhether to show a border around the TOC (only in expanded mode).
border_style: StyleStyle for the border.
title_style: StyleStyle for the title text in the border.
title: StringTitle text to show in the border header.
line_spacing: u8Spacing between lines in compact mode (in 1/8 cell units). 1 = tightest (8 lines per row), 8 = one line per row.
Implementations§
Source§impl TocConfig
Theme application for TocConfig.
impl TocConfig
Theme application for TocConfig.
Sourcepub fn with_theme(self, theme: &AppTheme) -> TocConfig
Available on crate feature markdown-preview only.
pub fn with_theme(self, theme: &AppTheme) -> TocConfig
markdown-preview only.Creates a TocConfig with colors derived from the application theme.
This applies theme colors to:
- Text style (using markdown text color)
- Active style (using theme primary color)
- Hover style (using theme accent with background_element)
- Background style (using theme background_panel)
- Line style (using theme border color)
- Active line style (using theme text color)
- Border style (using theme border_active color)
- Title style (using theme primary color)
§Arguments
theme- The application theme to derive colors from
§Returns
Self for method chaining.
§Example
let theme = AppTheme::default();
let config = TocConfig::default().with_theme(&theme);Trait Implementations§
Auto Trait Implementations§
impl Freeze for TocConfig
impl RefUnwindSafe for TocConfig
impl Send for TocConfig
impl Sync for TocConfig
impl Unpin for TocConfig
impl UnsafeUnpin for TocConfig
impl UnwindSafe for TocConfig
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> 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