Skip to main content

Theme

Struct Theme 

Source
pub struct Theme {
Show 98 fields pub bg_primary: Color, pub bg_title: Color, pub bg_input: Color, pub bg_panel: Color, pub border_title: Color, pub border_message: Color, pub border_input: Color, pub border_input_loading: Color, pub border_config: Color, pub separator: Color, pub bubble_ai: Color, pub bubble_ai_selected: Color, pub bubble_user: Color, pub bubble_user_selected: Color, pub label_ai: Color, pub label_user: Color, pub label_selected: Color, pub text_normal: Color, pub text_bold: Color, pub text_dim: Color, pub text_very_dim: Color, pub text_white: Color, pub text_system: Color, pub title_icon: Color, pub title_separator: Color, pub title_model: Color, pub title_count: Color, pub title_loading: Color, pub input_prompt: Color, pub input_prompt_loading: Color, pub cursor_fg: Color, pub cursor_bg: Color, pub hint_key_fg: Color, pub hint_key_bg: Color, pub hint_desc: Color, pub hint_separator: Color, pub toast_success_border: Color, pub toast_success_bg: Color, pub toast_success_text: Color, pub toast_error_border: Color, pub toast_error_bg: Color, pub toast_error_text: Color, pub welcome_border: Color, pub welcome_text: Color, pub welcome_hint: Color, pub model_sel_border: Color, pub model_sel_title: Color, pub model_sel_active: Color, pub model_sel_inactive: Color, pub model_sel_highlight_bg: Color, pub config_title: Color, pub config_section: Color, pub config_pointer: Color, pub config_label_selected: Color, pub config_label: Color, pub config_value: Color, pub config_edit_bg: Color, pub config_tab_active_bg: Color, pub config_tab_active_fg: Color, pub config_tab_inactive: Color, pub config_hint_key: Color, pub config_hint_desc: Color, pub config_toggle_on: Color, pub config_toggle_off: Color, pub config_dim: Color, pub config_api_key: Color, pub md_h1: Color, pub md_h2: Color, pub md_h3: Color, pub md_h4: Color, pub md_heading_sep: Color, pub md_inline_code_fg: Color, pub md_inline_code_bg: Color, pub md_list_bullet: Color, pub md_blockquote_bar: Color, pub md_blockquote_text: Color, pub md_rule: Color, pub code_border: Color, pub code_bg: Color, pub code_default: Color, pub code_keyword: Color, pub code_string: Color, pub code_comment: Color, pub code_number: Color, pub code_type: Color, pub code_primitive: Color, pub code_macro: Color, pub code_attribute: Color, pub code_lifetime: Color, pub code_shell_var: Color, pub table_border: Color, pub table_header: Color, pub table_body: Color, pub help_title: Color, pub help_key: Color, pub help_desc: Color, pub help_path: Color, pub help_bg: Color,
}
Expand description

主题配色方案 将所有 UI 颜色归类为语义化字段,方便统一管理

Fields§

§bg_primary: Color

主背景色

§bg_title: Color

标题栏背景

§bg_input: Color

输入区背景

§bg_panel: Color

帮助/配置界面背景

§border_title: Color

标题栏边框

§border_message: Color

消息区边框

§border_input: Color

输入区边框(正常)

§border_input_loading: Color

输入区边框(加载中)

§border_config: Color

配置界面边框

§separator: Color

分隔线

§bubble_ai: Color

AI 气泡背景

§bubble_ai_selected: Color

AI 气泡背景(选中时)

§bubble_user: Color

用户气泡背景

§bubble_user_selected: Color

用户气泡背景(选中时)

§label_ai: Color

AI 标签颜色

§label_user: Color

用户标签颜色

§label_selected: Color

选中标签颜色

§text_normal: Color

正文颜色

§text_bold: Color

强调色(加粗文本)

§text_dim: Color

弱化文字

§text_very_dim: Color

非常弱化的文字

§text_white: Color

白色文字(用于输入区等)

§text_system: Color

系统消息颜色

§title_icon: Color

标题栏图标色

§title_separator: Color

标题栏分隔符

§title_model: Color

模型名称颜色

§title_count: Color

消息计数颜色

§title_loading: Color

加载中文字颜色

§input_prompt: Color

输入提示符颜色

§input_prompt_loading: Color

输入提示符(加载中)颜色

§cursor_fg: Color

光标前景

§cursor_bg: Color

光标背景

§hint_key_fg: Color

键位标签前景

§hint_key_bg: Color

键位标签背景

§hint_desc: Color

键位描述文字

§hint_separator: Color

提示栏分隔符

§toast_success_border: Color

成功 Toast 边框

§toast_success_bg: Color

成功 Toast 背景

§toast_success_text: Color

成功 Toast 文字

§toast_error_border: Color

错误 Toast 边框

§toast_error_bg: Color

错误 Toast 背景

§toast_error_text: Color

错误 Toast 文字

§welcome_border: Color

欢迎框边框

§welcome_text: Color

欢迎文字

§welcome_hint: Color

欢迎提示文字

§model_sel_border: Color

模型选择框边框

§model_sel_title: Color

模型选择框标题

§model_sel_active: Color

活跃模型颜色

§model_sel_inactive: Color

非活跃模型颜色

§model_sel_highlight_bg: Color

选中高亮背景

§config_title: Color

配置标题颜色

§config_section: Color

配置分类标题颜色

§config_pointer: Color

配置选中指针颜色

§config_label_selected: Color

配置选中标签颜色

§config_label: Color

配置普通标签颜色

§config_value: Color

配置值颜色

§config_edit_bg: Color

配置编辑背景

§config_tab_active_bg: Color

配置 tab 选中背景

§config_tab_active_fg: Color

配置 tab 选中前景

§config_tab_inactive: Color

配置 tab 非选中颜色

§config_hint_key: Color

配置键位说明颜色

§config_hint_desc: Color

配置描述颜色

§config_toggle_on: Color

配置 toggle 开启颜色

§config_toggle_off: Color

配置 toggle 关闭颜色

§config_dim: Color

配置弱化文字

§config_api_key: Color

API Key 隐藏颜色

§md_h1: Color

标题 h1 颜色

§md_h2: Color

标题 h2 颜色

§md_h3: Color

标题 h3 颜色

§md_h4: Color

标题 h4+ 颜色

§md_heading_sep: Color

标题分隔线

§md_inline_code_fg: Color

行内代码前景

§md_inline_code_bg: Color

行内代码背景

§md_list_bullet: Color

列表符号颜色

§md_blockquote_bar: Color

引用块竖线颜色

§md_blockquote_text: Color

引用块文字颜色

§md_rule: Color

分隔线颜色

§code_border: Color

代码块边框颜色

§code_bg: Color

代码块背景

§code_default: Color

代码默认文字颜色

§code_keyword: Color

关键字颜色

§code_string: Color

字符串颜色

§code_comment: Color

注释颜色

§code_number: Color

数字颜色

§code_type: Color

类型名颜色

§code_primitive: Color

原始类型颜色

§code_macro: Color

宏调用颜色

§code_attribute: Color

属性/装饰器颜色

§code_lifetime: Color

生命周期颜色

§code_shell_var: Color

Shell 变量颜色

§table_border: Color

表格边框颜色

§table_header: Color

表格表头颜色

§table_body: Color

表格内容颜色

§help_title: Color

帮助标题颜色

§help_key: Color

帮助按键颜色

§help_desc: Color

帮助描述颜色

§help_path: Color

帮助文件路径颜色

§help_bg: Color

帮助背景颜色

Implementations§

Source§

impl Theme

Source

pub fn from_name(name: &ThemeName) -> Self

根据主题名称创建对应的主题

Source

pub fn midnight() -> Self

Midnight 主题(原始深色主题 - 默认)

Source

pub fn dark() -> Self

Dark 主题(偏灰暗的深色主题,类似 VS Code Dark+)

Source

pub fn light() -> Self

Light 主题(浅色主题,类似 VS Code Light+)

Source

pub fn nord() -> Self

Nord 主题(基于 Nord 配色方案 - 极地冰蓝色调)

Source

pub fn monokai() -> Self

Monokai 主题(经典 Monokai 配色 - 暖色调高对比度)

Trait Implementations§

Source§

impl Clone for Theme

Source§

fn clone(&self) -> Theme

Returns a duplicate of the value. Read more
1.0.0 · 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

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<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. 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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,