2021-08-24 23:33:56 +00:00
|
|
|
mod theme_registry;
|
2023-05-17 21:44:55 +00:00
|
|
|
mod theme_settings;
|
|
|
|
pub mod ui;
|
2021-08-24 23:33:56 +00:00
|
|
|
|
2021-08-04 00:51:06 +00:00
|
|
|
use gpui::{
|
|
|
|
color::Color,
|
2023-06-21 02:11:32 +00:00
|
|
|
elements::{ContainerStyle, ImageStyle, LabelStyle, Shadow, SvgStyle, TooltipStyle},
|
2021-10-05 17:21:13 +00:00
|
|
|
fonts::{HighlightStyle, TextStyle},
|
2023-05-17 21:44:55 +00:00
|
|
|
platform, AppContext, AssetSource, Border, MouseState,
|
2021-08-04 00:51:06 +00:00
|
|
|
};
|
2023-06-16 19:37:56 +00:00
|
|
|
use schemars::JsonSchema;
|
2022-04-28 17:59:32 +00:00
|
|
|
use serde::{de::DeserializeOwned, Deserialize};
|
|
|
|
use serde_json::Value;
|
2023-05-17 23:14:05 +00:00
|
|
|
use settings::SettingsStore;
|
2021-10-05 17:21:13 +00:00
|
|
|
use std::{collections::HashMap, sync::Arc};
|
2023-06-21 02:11:32 +00:00
|
|
|
use ui::{ButtonStyle, CheckboxStyle, IconStyle, ModalStyle};
|
2023-03-09 01:56:39 +00:00
|
|
|
|
2021-08-24 23:33:56 +00:00
|
|
|
pub use theme_registry::*;
|
2023-05-17 22:56:32 +00:00
|
|
|
pub use theme_settings::*;
|
2023-05-17 21:44:55 +00:00
|
|
|
|
|
|
|
pub fn current(cx: &AppContext) -> Arc<Theme> {
|
2023-05-17 22:05:20 +00:00
|
|
|
settings::get::<ThemeSettings>(cx).theme.clone()
|
2023-05-17 21:44:55 +00:00
|
|
|
}
|
2021-08-04 01:42:39 +00:00
|
|
|
|
2023-05-17 21:44:55 +00:00
|
|
|
pub fn init(source: impl AssetSource, cx: &mut AppContext) {
|
|
|
|
cx.set_global(ThemeRegistry::new(source, cx.font_cache().clone()));
|
2023-05-17 22:06:11 +00:00
|
|
|
settings::register::<ThemeSettings>(cx);
|
2023-05-17 23:14:05 +00:00
|
|
|
|
|
|
|
let mut prev_buffer_font_size = settings::get::<ThemeSettings>(cx).buffer_font_size;
|
|
|
|
cx.observe_global::<SettingsStore, _>(move |cx| {
|
|
|
|
let buffer_font_size = settings::get::<ThemeSettings>(cx).buffer_font_size;
|
|
|
|
if buffer_font_size != prev_buffer_font_size {
|
|
|
|
prev_buffer_font_size = buffer_font_size;
|
|
|
|
reset_font_size(cx);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.detach();
|
2023-05-17 21:44:55 +00:00
|
|
|
}
|
2021-08-04 01:42:39 +00:00
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-08-03 20:36:58 +00:00
|
|
|
pub struct Theme {
|
2021-08-04 21:16:28 +00:00
|
|
|
#[serde(default)]
|
2022-09-08 21:11:48 +00:00
|
|
|
pub meta: ThemeMeta,
|
2021-08-20 16:44:34 +00:00
|
|
|
pub workspace: Workspace,
|
2022-05-25 12:24:53 +00:00
|
|
|
pub context_menu: ContextMenu,
|
2022-10-06 12:07:21 +00:00
|
|
|
pub contacts_popover: ContactsPopover,
|
2022-10-10 07:56:21 +00:00
|
|
|
pub contact_list: ContactList,
|
2023-06-12 19:18:01 +00:00
|
|
|
pub toolbar_dropdown_menu: DropdownMenu,
|
2023-03-23 19:49:52 +00:00
|
|
|
pub copilot: Copilot,
|
2022-05-10 13:24:14 +00:00
|
|
|
pub contact_finder: ContactFinder,
|
2021-09-24 01:14:15 +00:00
|
|
|
pub project_panel: ProjectPanel,
|
2022-04-14 23:04:32 +00:00
|
|
|
pub command_palette: CommandPalette,
|
2022-04-28 21:45:32 +00:00
|
|
|
pub picker: Picker,
|
2022-02-24 23:27:11 +00:00
|
|
|
pub editor: Editor,
|
2022-02-27 15:15:38 +00:00
|
|
|
pub search: Search,
|
2022-01-05 16:25:03 +00:00
|
|
|
pub project_diagnostics: ProjectDiagnostics,
|
2022-10-26 06:33:32 +00:00
|
|
|
pub shared_screen: ContainerStyle,
|
2022-05-11 18:39:01 +00:00
|
|
|
pub contact_notification: ContactNotification,
|
2022-06-07 00:27:16 +00:00
|
|
|
pub update_notification: UpdateNotification,
|
2022-12-04 00:03:46 +00:00
|
|
|
pub simple_message_notification: MessageNotification,
|
2022-10-04 14:55:41 +00:00
|
|
|
pub project_shared_notification: ProjectSharedNotification,
|
2022-10-10 07:56:21 +00:00
|
|
|
pub incoming_call_notification: IncomingCallNotification,
|
2022-06-02 07:12:50 +00:00
|
|
|
pub tooltip: TooltipStyle,
|
2022-06-29 00:07:18 +00:00
|
|
|
pub terminal: TerminalStyle,
|
2023-05-26 21:38:03 +00:00
|
|
|
pub assistant: AssistantStyle,
|
2023-02-06 22:41:36 +00:00
|
|
|
pub feedback: FeedbackStyle,
|
2023-02-24 22:31:59 +00:00
|
|
|
pub welcome: WelcomeStyle,
|
2023-06-27 21:27:58 +00:00
|
|
|
pub titlebar: Titlebar,
|
2021-08-03 20:36:58 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2022-09-08 21:11:48 +00:00
|
|
|
pub struct ThemeMeta {
|
2023-04-26 20:23:29 +00:00
|
|
|
#[serde(skip_deserializing)]
|
|
|
|
pub id: usize,
|
2022-09-08 21:11:48 +00:00
|
|
|
pub name: String,
|
|
|
|
pub is_light: bool,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-08-20 16:44:34 +00:00
|
|
|
pub struct Workspace {
|
2021-08-03 20:36:58 +00:00
|
|
|
pub background: Color,
|
2023-03-09 01:56:39 +00:00
|
|
|
pub blank_pane: BlankPaneStyle,
|
2022-07-22 21:28:58 +00:00
|
|
|
pub tab_bar: TabBar,
|
2021-09-07 22:04:29 +00:00
|
|
|
pub pane_divider: Border,
|
2022-03-21 22:12:15 +00:00
|
|
|
pub leader_border_opacity: f32,
|
2022-03-22 18:43:30 +00:00
|
|
|
pub leader_border_width: f32,
|
2023-05-05 22:04:36 +00:00
|
|
|
pub dock: Dock,
|
2021-11-03 16:27:51 +00:00
|
|
|
pub status_bar: StatusBar,
|
2022-01-31 10:00:29 +00:00
|
|
|
pub toolbar: Toolbar,
|
2023-03-29 19:42:39 +00:00
|
|
|
pub breadcrumb_height: f32,
|
|
|
|
pub breadcrumbs: Interactive<ContainedText>,
|
2022-03-04 16:28:18 +00:00
|
|
|
pub disconnected_overlay: ContainedText,
|
2022-04-22 16:54:09 +00:00
|
|
|
pub modal: ContainerStyle,
|
2023-05-30 23:23:16 +00:00
|
|
|
pub zoomed_panel_foreground: ContainerStyle,
|
|
|
|
pub zoomed_pane_foreground: ContainerStyle,
|
2023-05-13 20:34:09 +00:00
|
|
|
pub zoomed_background: ContainerStyle,
|
2022-05-10 23:46:46 +00:00
|
|
|
pub notification: ContainerStyle,
|
|
|
|
pub notifications: Notifications,
|
2022-05-16 22:52:31 +00:00
|
|
|
pub joining_project_avatar: ImageStyle,
|
2022-05-16 15:45:50 +00:00
|
|
|
pub joining_project_message: ContainedText,
|
2022-10-05 12:27:59 +00:00
|
|
|
pub external_location_message: ContainedText,
|
2022-10-22 02:14:24 +00:00
|
|
|
pub drop_target_overlay_color: Color,
|
2021-08-03 20:36:58 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-03-09 01:56:39 +00:00
|
|
|
pub struct BlankPaneStyle {
|
2023-03-27 21:25:11 +00:00
|
|
|
pub logo: SvgStyle,
|
|
|
|
pub logo_shadow: SvgStyle,
|
2023-03-10 01:18:29 +00:00
|
|
|
pub logo_container: ContainerStyle,
|
2023-03-09 01:56:39 +00:00
|
|
|
pub keyboard_hints: ContainerStyle,
|
|
|
|
pub keyboard_hint: Interactive<ContainedText>,
|
|
|
|
pub keyboard_hint_width: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2021-09-14 16:53:41 +00:00
|
|
|
pub struct Titlebar {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2021-11-28 19:41:46 +00:00
|
|
|
pub height: f32,
|
2023-07-05 16:50:56 +00:00
|
|
|
pub project_menu_button: Toggleable<Interactive<ContainedText>>,
|
2023-06-30 18:09:30 +00:00
|
|
|
pub project_name_divider: ContainedText,
|
2023-07-05 16:50:56 +00:00
|
|
|
pub git_menu_button: Toggleable<Interactive<ContainedText>>,
|
2023-02-22 19:13:29 +00:00
|
|
|
pub item_spacing: f32,
|
|
|
|
pub face_pile_spacing: f32,
|
2021-11-28 20:25:05 +00:00
|
|
|
pub avatar_ribbon: AvatarRibbon,
|
2023-02-21 07:20:22 +00:00
|
|
|
pub follower_avatar_overlap: f32,
|
2023-02-22 18:36:06 +00:00
|
|
|
pub leader_selection: ContainerStyle,
|
2021-09-14 23:47:43 +00:00
|
|
|
pub offline_icon: OfflineIcon,
|
2023-02-23 20:59:37 +00:00
|
|
|
pub leader_avatar: AvatarStyle,
|
2023-02-21 07:20:22 +00:00
|
|
|
pub follower_avatar: AvatarStyle,
|
2023-02-23 20:59:37 +00:00
|
|
|
pub inactive_avatar_grayscale: bool,
|
2023-06-27 20:20:45 +00:00
|
|
|
pub sign_in_button: Toggleable<Interactive<ContainedText>>,
|
2021-09-23 13:36:32 +00:00
|
|
|
pub outdated_warning: ContainedText,
|
2023-06-15 14:24:05 +00:00
|
|
|
pub share_button: Toggleable<Interactive<ContainedText>>,
|
2023-06-28 15:41:31 +00:00
|
|
|
pub muted: Color,
|
|
|
|
pub speaking: Color,
|
2023-06-27 16:56:41 +00:00
|
|
|
pub screen_share_button: Toggleable<Interactive<IconButton>>,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub toggle_contacts_button: Toggleable<Interactive<IconButton>>,
|
2023-06-23 09:52:06 +00:00
|
|
|
pub toggle_microphone_button: Toggleable<Interactive<IconButton>>,
|
|
|
|
pub toggle_speakers_button: Toggleable<Interactive<IconButton>>,
|
2023-06-23 11:30:40 +00:00
|
|
|
pub leave_call_button: Interactive<IconButton>,
|
2022-10-06 12:00:14 +00:00
|
|
|
pub toggle_contacts_badge: ContainerStyle,
|
2023-06-27 21:27:58 +00:00
|
|
|
pub user_menu: UserMenu,
|
2022-09-27 12:27:06 +00:00
|
|
|
}
|
|
|
|
|
2023-06-27 13:40:43 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-06-26 16:56:30 +00:00
|
|
|
pub struct UserMenu {
|
2023-06-27 20:32:42 +00:00
|
|
|
pub user_menu_button_online: UserMenuButton,
|
|
|
|
pub user_menu_button_offline: UserMenuButton,
|
2023-06-26 16:56:30 +00:00
|
|
|
}
|
2023-06-28 15:41:31 +00:00
|
|
|
|
2023-06-27 13:40:43 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-06-26 16:56:30 +00:00
|
|
|
pub struct UserMenuButton {
|
|
|
|
pub user_menu: Toggleable<Interactive<Icon>>,
|
|
|
|
pub avatar: AvatarStyle,
|
|
|
|
pub icon: Icon,
|
2022-09-27 12:27:06 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Copy, Clone, Deserialize, Default, JsonSchema)]
|
2023-02-21 07:20:22 +00:00
|
|
|
pub struct AvatarStyle {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub image: ImageStyle,
|
2023-02-21 22:14:32 +00:00
|
|
|
pub outer_width: f32,
|
|
|
|
pub outer_corner_radius: f32,
|
2023-02-21 07:20:22 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2023-03-23 19:49:52 +00:00
|
|
|
pub struct Copilot {
|
2023-03-30 04:31:33 +00:00
|
|
|
pub out_link_icon: Interactive<IconStyle>,
|
2023-03-28 06:16:30 +00:00
|
|
|
pub modal: ModalStyle,
|
2023-03-27 21:25:11 +00:00
|
|
|
pub auth: CopilotAuth,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2023-03-27 21:25:11 +00:00
|
|
|
pub struct CopilotAuth {
|
2023-03-28 06:16:30 +00:00
|
|
|
pub content_width: f32,
|
2023-03-30 23:50:33 +00:00
|
|
|
pub prompting: CopilotAuthPrompting,
|
|
|
|
pub not_authorized: CopilotAuthNotAuthorized,
|
|
|
|
pub authorized: CopilotAuthAuthorized,
|
|
|
|
pub cta_button: ButtonStyle,
|
|
|
|
pub header: IconStyle,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2023-03-30 23:50:33 +00:00
|
|
|
pub struct CopilotAuthPrompting {
|
|
|
|
pub subheading: ContainedText,
|
2023-03-29 01:00:09 +00:00
|
|
|
pub hint: ContainedText,
|
2023-03-30 23:50:33 +00:00
|
|
|
pub device_code: DeviceCode,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2023-03-30 23:50:33 +00:00
|
|
|
pub struct DeviceCode {
|
|
|
|
pub text: TextStyle,
|
|
|
|
pub cta: ButtonStyle,
|
|
|
|
pub left: f32,
|
|
|
|
pub left_container: ContainerStyle,
|
|
|
|
pub right: f32,
|
|
|
|
pub right_container: Interactive<ContainerStyle>,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2023-03-30 23:50:33 +00:00
|
|
|
pub struct CopilotAuthNotAuthorized {
|
|
|
|
pub subheading: ContainedText,
|
2023-03-29 01:00:09 +00:00
|
|
|
pub warning: ContainedText,
|
2023-03-23 19:49:52 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, JsonSchema)]
|
2023-03-30 23:50:33 +00:00
|
|
|
pub struct CopilotAuthAuthorized {
|
|
|
|
pub subheading: ContainedText,
|
|
|
|
pub hint: ContainedText,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-10-06 12:07:21 +00:00
|
|
|
pub struct ContactsPopover {
|
2022-09-27 12:27:06 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub height: f32,
|
|
|
|
pub width: f32,
|
2022-10-10 07:56:21 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-10-10 07:56:21 +00:00
|
|
|
pub struct ContactList {
|
2022-10-06 12:07:21 +00:00
|
|
|
pub user_query_editor: FieldEditor,
|
|
|
|
pub user_query_editor_height: f32,
|
|
|
|
pub add_contact_button: IconButton,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub header_row: Toggleable<Interactive<ContainedText>>,
|
2022-10-10 08:30:51 +00:00
|
|
|
pub leave_call: Interactive<ContainedText>,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub contact_row: Toggleable<Interactive<ContainerStyle>>,
|
2022-10-06 12:07:21 +00:00
|
|
|
pub row_height: f32,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub project_row: Toggleable<Interactive<ProjectRow>>,
|
|
|
|
pub tree_branch: Toggleable<Interactive<TreeBranch>>,
|
2022-10-06 12:07:21 +00:00
|
|
|
pub contact_avatar: ImageStyle,
|
2022-10-07 11:56:28 +00:00
|
|
|
pub contact_status_free: ContainerStyle,
|
|
|
|
pub contact_status_busy: ContainerStyle,
|
2022-10-06 12:07:21 +00:00
|
|
|
pub contact_username: ContainedText,
|
|
|
|
pub contact_button: Interactive<IconButton>,
|
|
|
|
pub contact_button_spacing: f32,
|
|
|
|
pub disabled_button: IconButton,
|
|
|
|
pub section_icon_size: f32,
|
2022-10-07 15:01:48 +00:00
|
|
|
pub calling_indicator: ContainedText,
|
2021-09-14 16:53:41 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-10-11 10:23:15 +00:00
|
|
|
pub struct ProjectRow {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2022-10-24 08:47:47 +00:00
|
|
|
pub icon: Icon,
|
2022-10-11 10:23:15 +00:00
|
|
|
pub name: ContainedText,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, Clone, Copy, JsonSchema)]
|
2022-10-11 10:23:15 +00:00
|
|
|
pub struct TreeBranch {
|
|
|
|
pub width: f32,
|
|
|
|
pub color: Color,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-10-10 07:56:21 +00:00
|
|
|
pub struct ContactFinder {
|
|
|
|
pub picker: Picker,
|
|
|
|
pub row_height: f32,
|
|
|
|
pub contact_avatar: ImageStyle,
|
|
|
|
pub contact_username: ContainerStyle,
|
|
|
|
pub contact_button: IconButton,
|
|
|
|
pub disabled_contact_button: IconButton,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2023-06-12 19:18:01 +00:00
|
|
|
pub struct DropdownMenu {
|
2023-06-07 23:55:29 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2023-06-12 19:18:01 +00:00
|
|
|
pub header: Interactive<DropdownMenuItem>,
|
|
|
|
pub section_header: ContainedText,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub item: Toggleable<Interactive<DropdownMenuItem>>,
|
2023-06-08 15:58:57 +00:00
|
|
|
pub row_height: f32,
|
2023-06-07 23:55:29 +00:00
|
|
|
}
|
|
|
|
|
2023-06-22 15:58:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2023-06-12 19:18:01 +00:00
|
|
|
pub struct DropdownMenuItem {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub text: TextStyle,
|
|
|
|
pub secondary_text: Option<TextStyle>,
|
|
|
|
#[serde(default)]
|
|
|
|
pub secondary_text_spacing: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-07-22 21:28:58 +00:00
|
|
|
pub struct TabBar {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub pane_button: Toggleable<Interactive<IconButton>>,
|
2022-09-16 19:55:36 +00:00
|
|
|
pub pane_button_container: ContainerStyle,
|
2022-07-22 21:28:58 +00:00
|
|
|
pub active_pane: TabStyles,
|
|
|
|
pub inactive_pane: TabStyles,
|
2022-08-24 01:02:01 +00:00
|
|
|
pub dragged_tab: Tab,
|
2022-07-26 17:41:02 +00:00
|
|
|
pub height: f32,
|
2023-08-03 14:05:24 +00:00
|
|
|
pub nav_button: Interactive<IconButton>,
|
2022-07-22 21:28:58 +00:00
|
|
|
}
|
|
|
|
|
2022-07-26 17:04:16 +00:00
|
|
|
impl TabBar {
|
|
|
|
pub fn tab_style(&self, pane_active: bool, tab_active: bool) -> &Tab {
|
|
|
|
let tabs = if pane_active {
|
|
|
|
&self.active_pane
|
|
|
|
} else {
|
|
|
|
&self.inactive_pane
|
|
|
|
};
|
|
|
|
|
|
|
|
if tab_active {
|
|
|
|
&tabs.active_tab
|
|
|
|
} else {
|
|
|
|
&tabs.inactive_tab
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-07-22 21:28:58 +00:00
|
|
|
pub struct TabStyles {
|
2022-07-26 17:41:02 +00:00
|
|
|
pub active_tab: Tab,
|
|
|
|
pub inactive_tab: Tab,
|
2022-07-22 21:28:58 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2021-11-28 20:25:05 +00:00
|
|
|
pub struct AvatarRibbon {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub width: f32,
|
|
|
|
pub height: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2021-09-14 23:47:43 +00:00
|
|
|
pub struct OfflineIcon {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub width: f32,
|
2022-01-10 19:26:07 +00:00
|
|
|
pub color: Color,
|
2021-09-14 23:47:43 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2021-08-03 20:36:58 +00:00
|
|
|
pub struct Tab {
|
2021-09-30 20:30:24 +00:00
|
|
|
pub height: f32,
|
2021-08-03 20:36:58 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub label: LabelStyle,
|
2022-07-14 09:49:10 +00:00
|
|
|
pub description: ContainedText,
|
2021-09-07 21:28:14 +00:00
|
|
|
pub spacing: f32,
|
2023-03-01 08:18:45 +00:00
|
|
|
pub close_icon_width: f32,
|
|
|
|
pub type_icon_width: f32,
|
2021-08-03 20:36:58 +00:00
|
|
|
pub icon_close: Color,
|
2021-09-07 21:28:14 +00:00
|
|
|
pub icon_close_active: Color,
|
2021-08-03 20:36:58 +00:00
|
|
|
pub icon_dirty: Color,
|
|
|
|
pub icon_conflict: Color,
|
2023-07-17 16:48:57 +00:00
|
|
|
pub git: GitProjectStatus,
|
2021-08-03 20:36:58 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-01-31 10:00:29 +00:00
|
|
|
pub struct Toolbar {
|
2022-03-29 09:48:21 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2022-01-31 10:00:29 +00:00
|
|
|
pub height: f32,
|
2022-03-29 09:48:21 +00:00
|
|
|
pub item_spacing: f32,
|
2022-01-31 10:00:29 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-05-10 23:46:46 +00:00
|
|
|
pub struct Notifications {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub width: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-02-27 15:15:38 +00:00
|
|
|
pub struct Search {
|
2022-01-28 01:59:44 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2022-03-30 11:35:17 +00:00
|
|
|
pub editor: FindEditor,
|
2022-01-28 15:15:18 +00:00
|
|
|
pub invalid_editor: ContainerStyle,
|
2022-02-25 09:27:45 +00:00
|
|
|
pub option_button_group: ContainerStyle,
|
2023-05-09 10:55:18 +00:00
|
|
|
pub include_exclude_editor: FindEditor,
|
2023-05-09 21:06:44 +00:00
|
|
|
pub invalid_include_exclude_editor: ContainerStyle,
|
2023-05-07 19:50:54 +00:00
|
|
|
pub include_exclude_inputs: ContainedText,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub option_button: Toggleable<Interactive<ContainedText>>,
|
2023-08-16 10:35:09 +00:00
|
|
|
pub action_button: Toggleable<Interactive<ContainedText>>,
|
2022-01-27 23:19:52 +00:00
|
|
|
pub match_background: Color,
|
2022-01-29 13:38:58 +00:00
|
|
|
pub match_index: ContainedText,
|
2023-08-01 17:28:21 +00:00
|
|
|
pub major_results_status: TextStyle,
|
|
|
|
pub minor_results_status: TextStyle,
|
2023-01-02 04:50:46 +00:00
|
|
|
pub dismiss_button: Interactive<IconButton>,
|
2023-08-01 16:34:02 +00:00
|
|
|
pub editor_icon: IconStyle,
|
2023-08-02 15:23:55 +00:00
|
|
|
pub mode_button: Toggleable<Interactive<ContainedText>>,
|
2023-08-12 23:29:35 +00:00
|
|
|
pub nav_button: Toggleable<Interactive<ContainedLabel>>,
|
2023-08-11 15:02:25 +00:00
|
|
|
pub search_bar_row_height: f32,
|
2023-08-14 10:10:37 +00:00
|
|
|
pub option_button_height: f32,
|
2023-08-14 13:01:01 +00:00
|
|
|
pub modes_container: ContainerStyle,
|
2022-01-27 23:19:52 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-03-30 11:35:17 +00:00
|
|
|
pub struct FindEditor {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub input: FieldEditor,
|
2022-03-31 17:44:16 +00:00
|
|
|
pub min_width: f32,
|
2022-03-30 11:35:17 +00:00
|
|
|
pub max_width: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-11-03 16:27:51 +00:00
|
|
|
pub struct StatusBar {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub height: f32,
|
2022-01-25 23:33:49 +00:00
|
|
|
pub item_spacing: f32,
|
2021-11-03 16:27:51 +00:00
|
|
|
pub cursor_position: TextStyle,
|
2023-07-25 16:58:44 +00:00
|
|
|
pub vim_mode_indicator: ContainedText,
|
2023-03-10 16:37:45 +00:00
|
|
|
pub active_language: Interactive<ContainedText>,
|
2022-04-04 21:57:21 +00:00
|
|
|
pub auto_update_progress_message: TextStyle,
|
|
|
|
pub auto_update_done_message: TextStyle,
|
2022-04-28 17:59:32 +00:00
|
|
|
pub lsp_status: Interactive<StatusBarLspStatus>,
|
2023-05-05 22:04:36 +00:00
|
|
|
pub panel_buttons: StatusBarPanelButtons,
|
2022-04-28 19:35:20 +00:00
|
|
|
pub diagnostic_summary: Interactive<StatusBarDiagnosticSummary>,
|
|
|
|
pub diagnostic_message: Interactive<ContainedText>,
|
2022-04-27 19:14:34 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2023-05-05 22:04:36 +00:00
|
|
|
pub struct StatusBarPanelButtons {
|
2022-04-27 19:14:34 +00:00
|
|
|
pub group_left: ContainerStyle,
|
2023-05-08 16:31:08 +00:00
|
|
|
pub group_bottom: ContainerStyle,
|
2022-04-27 19:14:34 +00:00
|
|
|
pub group_right: ContainerStyle,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub button: Toggleable<Interactive<PanelButton>>,
|
2022-04-27 19:14:34 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-04-28 19:35:20 +00:00
|
|
|
pub struct StatusBarDiagnosticSummary {
|
|
|
|
pub container_ok: ContainerStyle,
|
|
|
|
pub container_warning: ContainerStyle,
|
|
|
|
pub container_error: ContainerStyle,
|
|
|
|
pub text: TextStyle,
|
2022-04-27 19:14:34 +00:00
|
|
|
pub icon_color_ok: Color,
|
|
|
|
pub icon_color_warning: Color,
|
2022-04-28 19:35:20 +00:00
|
|
|
pub icon_color_error: Color,
|
2022-04-27 19:14:34 +00:00
|
|
|
pub height: f32,
|
|
|
|
pub icon_width: f32,
|
|
|
|
pub icon_spacing: f32,
|
|
|
|
pub summary_spacing: f32,
|
2021-11-03 16:27:51 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-04-27 23:48:33 +00:00
|
|
|
pub struct StatusBarLspStatus {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub height: f32,
|
|
|
|
pub icon_spacing: f32,
|
|
|
|
pub icon_color: Color,
|
|
|
|
pub icon_width: f32,
|
|
|
|
pub message: TextStyle,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2023-05-05 22:04:36 +00:00
|
|
|
pub struct Dock {
|
2023-05-23 07:02:45 +00:00
|
|
|
pub left: ContainerStyle,
|
|
|
|
pub bottom: ContainerStyle,
|
|
|
|
pub right: ContainerStyle,
|
2022-04-27 16:38:31 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-05-05 22:13:36 +00:00
|
|
|
pub struct PanelButton {
|
2022-04-27 16:38:31 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub icon_color: Color,
|
|
|
|
pub icon_size: f32,
|
2023-03-22 14:13:58 +00:00
|
|
|
pub label: ContainedText,
|
2022-04-27 16:38:31 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-09-24 01:14:15 +00:00
|
|
|
pub struct ProjectPanel {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub entry: Toggleable<Interactive<ProjectPanelEntry>>,
|
2022-11-07 22:00:01 +00:00
|
|
|
pub dragged_entry: ProjectPanelEntry,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub ignored_entry: Toggleable<Interactive<ProjectPanelEntry>>,
|
|
|
|
pub cut_entry: Toggleable<Interactive<ProjectPanelEntry>>,
|
2022-05-02 20:19:58 +00:00
|
|
|
pub filename_editor: FieldEditor,
|
2022-04-29 18:08:25 +00:00
|
|
|
pub indent_width: f32,
|
2023-03-07 22:49:05 +00:00
|
|
|
pub open_project_button: Interactive<ContainedText>,
|
2021-09-30 17:24:47 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2021-09-30 17:24:47 +00:00
|
|
|
pub struct ProjectPanelEntry {
|
2021-09-30 20:30:24 +00:00
|
|
|
pub height: f32,
|
2021-09-30 17:24:47 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub text: TextStyle,
|
2023-07-14 03:46:24 +00:00
|
|
|
pub icon_size: f32,
|
2021-09-30 17:24:47 +00:00
|
|
|
pub icon_color: Color,
|
2023-07-14 03:46:24 +00:00
|
|
|
pub chevron_color: Color,
|
|
|
|
pub chevron_size: f32,
|
2021-09-30 17:24:47 +00:00
|
|
|
pub icon_spacing: f32,
|
2023-05-22 22:51:31 +00:00
|
|
|
pub status: EntryStatus,
|
2023-05-22 22:53:29 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2023-05-22 22:53:29 +00:00
|
|
|
pub struct EntryStatus {
|
|
|
|
pub git: GitProjectStatus,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2023-05-22 22:53:29 +00:00
|
|
|
pub struct GitProjectStatus {
|
|
|
|
pub modified: Color,
|
|
|
|
pub inserted: Color,
|
|
|
|
pub conflict: Color,
|
2021-09-24 01:14:15 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2022-05-25 00:30:04 +00:00
|
|
|
pub struct ContextMenu {
|
2022-05-25 01:59:08 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub item: Toggleable<Interactive<ContextMenuItem>>,
|
2022-07-13 10:15:36 +00:00
|
|
|
pub keystroke_margin: f32,
|
2022-05-25 08:23:43 +00:00
|
|
|
pub separator: ContainerStyle,
|
2022-05-25 01:59:08 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2022-05-25 01:59:08 +00:00
|
|
|
pub struct ContextMenuItem {
|
2022-05-25 00:30:04 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub label: TextStyle,
|
2022-05-25 13:24:44 +00:00
|
|
|
pub keystroke: ContainedText,
|
2022-08-03 23:47:41 +00:00
|
|
|
pub icon_width: f32,
|
|
|
|
pub icon_spacing: f32,
|
2022-05-25 00:30:04 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Debug, Deserialize, Default, JsonSchema)]
|
2022-04-14 23:04:32 +00:00
|
|
|
pub struct CommandPalette {
|
2023-06-16 12:30:16 +00:00
|
|
|
pub key: Toggleable<ContainedLabel>,
|
2022-04-14 23:04:32 +00:00
|
|
|
pub keystroke_spacing: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-05-19 23:57:46 +00:00
|
|
|
pub struct InviteLink {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub label: LabelStyle,
|
|
|
|
pub icon: Icon,
|
2022-05-11 23:50:51 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Clone, Copy, Default, JsonSchema)]
|
2022-05-19 23:57:46 +00:00
|
|
|
pub struct Icon {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub color: Color,
|
|
|
|
pub width: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Clone, Copy, Default, JsonSchema)]
|
2022-05-10 16:25:47 +00:00
|
|
|
pub struct IconButton {
|
2022-05-10 10:09:24 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub color: Color,
|
2022-05-10 16:25:47 +00:00
|
|
|
pub icon_width: f32,
|
|
|
|
pub button_width: f32,
|
2022-05-10 10:09:24 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-08-24 23:46:23 +00:00
|
|
|
pub struct ChatMessage {
|
2021-09-01 23:14:51 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2021-08-25 14:42:35 +00:00
|
|
|
pub body: TextStyle,
|
2021-08-31 00:59:13 +00:00
|
|
|
pub sender: ContainedText,
|
|
|
|
pub timestamp: ContainedText,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-08-31 00:59:13 +00:00
|
|
|
pub struct ChannelSelect {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub header: ChannelName,
|
|
|
|
pub item: ChannelName,
|
|
|
|
pub active_item: ChannelName,
|
|
|
|
pub hovered_item: ChannelName,
|
|
|
|
pub hovered_active_item: ChannelName,
|
|
|
|
pub menu: ContainerStyle,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2021-08-31 00:59:13 +00:00
|
|
|
pub struct ChannelName {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub hash: ContainedText,
|
|
|
|
pub name: TextStyle,
|
2021-08-24 23:46:23 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-04-28 21:45:32 +00:00
|
|
|
pub struct Picker {
|
2021-08-03 20:36:58 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2022-11-03 14:23:35 +00:00
|
|
|
pub empty_container: ContainerStyle,
|
2022-02-24 23:27:11 +00:00
|
|
|
pub input_editor: FieldEditor,
|
2022-11-03 14:23:35 +00:00
|
|
|
pub empty_input_editor: FieldEditor,
|
|
|
|
pub no_matches: ContainedLabel,
|
2023-06-14 12:02:32 +00:00
|
|
|
pub item: Toggleable<Interactive<ContainedLabel>>,
|
2023-06-30 14:38:38 +00:00
|
|
|
pub header: ContainedLabel,
|
2023-07-10 14:51:18 +00:00
|
|
|
pub footer: Interactive<ContainedLabel>,
|
2021-08-03 20:36:58 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2021-08-31 00:59:13 +00:00
|
|
|
pub struct ContainedText {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub text: TextStyle,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Debug, Deserialize, Default, JsonSchema)]
|
2021-08-25 22:22:14 +00:00
|
|
|
pub struct ContainedLabel {
|
2021-08-03 20:36:58 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub label: LabelStyle,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-01-05 16:25:03 +00:00
|
|
|
pub struct ProjectDiagnostics {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub empty_message: TextStyle,
|
2022-01-12 01:23:11 +00:00
|
|
|
pub tab_icon_width: f32,
|
|
|
|
pub tab_icon_spacing: f32,
|
|
|
|
pub tab_summary_spacing: f32,
|
2022-01-05 16:25:03 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-05-11 18:39:01 +00:00
|
|
|
pub struct ContactNotification {
|
2022-05-11 13:13:37 +00:00
|
|
|
pub header_avatar: ImageStyle,
|
|
|
|
pub header_message: ContainedText,
|
|
|
|
pub header_height: f32,
|
|
|
|
pub body_message: ContainedText,
|
2022-05-11 21:20:05 +00:00
|
|
|
pub button: Interactive<ContainedText>,
|
|
|
|
pub dismiss_button: Interactive<IconButton>,
|
2022-05-11 13:13:37 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-06-07 00:27:16 +00:00
|
|
|
pub struct UpdateNotification {
|
|
|
|
pub message: ContainedText,
|
|
|
|
pub action_message: Interactive<ContainedText>,
|
|
|
|
pub dismiss_button: Interactive<IconButton>,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-12-04 00:03:46 +00:00
|
|
|
pub struct MessageNotification {
|
|
|
|
pub message: ContainedText,
|
|
|
|
pub action_message: Interactive<ContainedText>,
|
|
|
|
pub dismiss_button: Interactive<IconButton>,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-10-04 14:55:41 +00:00
|
|
|
pub struct ProjectSharedNotification {
|
2022-10-10 23:56:03 +00:00
|
|
|
pub window_height: f32,
|
|
|
|
pub window_width: f32,
|
2022-10-10 12:37:51 +00:00
|
|
|
#[serde(default)]
|
|
|
|
pub background: Color,
|
|
|
|
pub owner_container: ContainerStyle,
|
2022-10-04 14:55:41 +00:00
|
|
|
pub owner_avatar: ImageStyle,
|
2022-10-10 12:37:51 +00:00
|
|
|
pub owner_metadata: ContainerStyle,
|
|
|
|
pub owner_username: ContainedText,
|
2022-10-04 14:55:41 +00:00
|
|
|
pub message: ContainedText,
|
2022-10-10 23:56:03 +00:00
|
|
|
pub worktree_roots: ContainedText,
|
2022-10-10 12:37:51 +00:00
|
|
|
pub button_width: f32,
|
2022-10-11 00:12:00 +00:00
|
|
|
pub open_button: ContainedText,
|
2022-10-04 14:55:41 +00:00
|
|
|
pub dismiss_button: ContainedText,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Deserialize, Default, JsonSchema)]
|
2022-10-10 07:56:21 +00:00
|
|
|
pub struct IncomingCallNotification {
|
2022-10-11 08:59:36 +00:00
|
|
|
pub window_height: f32,
|
|
|
|
pub window_width: f32,
|
2022-10-10 09:36:39 +00:00
|
|
|
#[serde(default)]
|
|
|
|
pub background: Color,
|
|
|
|
pub caller_container: ContainerStyle,
|
2022-10-10 07:56:21 +00:00
|
|
|
pub caller_avatar: ImageStyle,
|
2022-10-10 09:36:39 +00:00
|
|
|
pub caller_metadata: ContainerStyle,
|
2022-10-10 07:56:21 +00:00
|
|
|
pub caller_username: ContainedText,
|
2022-10-10 09:36:39 +00:00
|
|
|
pub caller_message: ContainedText,
|
2022-10-11 08:59:36 +00:00
|
|
|
pub worktree_roots: ContainedText,
|
2022-10-10 09:36:39 +00:00
|
|
|
pub button_width: f32,
|
2022-10-10 07:56:21 +00:00
|
|
|
pub accept_button: ContainedText,
|
|
|
|
pub decline_button: ContainedText,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-02-24 23:27:11 +00:00
|
|
|
pub struct Editor {
|
|
|
|
pub text_color: Color,
|
2021-10-05 17:21:13 +00:00
|
|
|
#[serde(default)]
|
|
|
|
pub background: Color,
|
|
|
|
pub selection: SelectionStyle,
|
|
|
|
pub gutter_background: Color,
|
2022-01-25 19:40:53 +00:00
|
|
|
pub gutter_padding_factor: f32,
|
2021-10-05 17:21:13 +00:00
|
|
|
pub active_line_background: Color,
|
2021-11-24 22:23:45 +00:00
|
|
|
pub highlighted_line_background: Color,
|
2022-03-10 21:55:31 +00:00
|
|
|
pub rename_fade: f32,
|
2022-02-23 01:05:55 +00:00
|
|
|
pub document_highlight_read_background: Color,
|
|
|
|
pub document_highlight_write_background: Color,
|
2022-10-03 00:56:09 +00:00
|
|
|
pub diff: DiffStyle,
|
2023-07-20 23:39:13 +00:00
|
|
|
pub wrap_guide: Color,
|
|
|
|
pub active_wrap_guide: Color,
|
2021-10-05 17:21:13 +00:00
|
|
|
pub line_number: Color,
|
|
|
|
pub line_number_active: Color,
|
|
|
|
pub guest_selections: Vec<SelectionStyle>,
|
|
|
|
pub syntax: Arc<SyntaxTheme>,
|
2023-06-26 16:48:22 +00:00
|
|
|
pub hint: HighlightStyle,
|
2023-03-27 09:54:33 +00:00
|
|
|
pub suggestion: HighlightStyle,
|
2022-01-25 11:23:24 +00:00
|
|
|
pub diagnostic_path_header: DiagnosticPathHeader,
|
|
|
|
pub diagnostic_header: DiagnosticHeader,
|
2021-11-19 13:35:00 +00:00
|
|
|
pub error_diagnostic: DiagnosticStyle,
|
|
|
|
pub invalid_error_diagnostic: DiagnosticStyle,
|
|
|
|
pub warning_diagnostic: DiagnosticStyle,
|
|
|
|
pub invalid_warning_diagnostic: DiagnosticStyle,
|
|
|
|
pub information_diagnostic: DiagnosticStyle,
|
|
|
|
pub invalid_information_diagnostic: DiagnosticStyle,
|
|
|
|
pub hint_diagnostic: DiagnosticStyle,
|
|
|
|
pub invalid_hint_diagnostic: DiagnosticStyle,
|
2022-01-31 21:01:20 +00:00
|
|
|
pub autocomplete: AutocompleteStyle,
|
2022-09-01 03:37:04 +00:00
|
|
|
pub code_actions: CodeActions,
|
2023-02-26 04:10:20 +00:00
|
|
|
pub folds: Folds,
|
2022-03-15 14:51:59 +00:00
|
|
|
pub unnecessary_code_fade: f32,
|
2022-06-03 21:56:21 +00:00
|
|
|
pub hover_popover: HoverPopover,
|
2022-06-24 22:02:18 +00:00
|
|
|
pub link_definition: HighlightStyle,
|
2022-07-20 23:45:27 +00:00
|
|
|
pub composition_mark: HighlightStyle,
|
2022-06-08 13:31:29 +00:00
|
|
|
pub jump_icon: Interactive<IconButton>,
|
2022-10-10 23:12:42 +00:00
|
|
|
pub scrollbar: Scrollbar,
|
2023-05-05 14:37:29 +00:00
|
|
|
pub whitespace: Color,
|
2022-10-10 23:12:42 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-10-10 23:12:42 +00:00
|
|
|
pub struct Scrollbar {
|
|
|
|
pub track: ContainerStyle,
|
|
|
|
pub thumb: ContainerStyle,
|
|
|
|
pub width: f32,
|
2022-10-11 20:18:33 +00:00
|
|
|
pub min_height_factor: f32,
|
2023-07-17 19:17:04 +00:00
|
|
|
pub git: BufferGitDiffColors,
|
2023-06-05 13:48:36 +00:00
|
|
|
pub selections: Color,
|
2023-05-22 22:51:31 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-07-17 19:17:04 +00:00
|
|
|
pub struct BufferGitDiffColors {
|
2023-05-22 22:51:31 +00:00
|
|
|
pub inserted: Color,
|
|
|
|
pub modified: Color,
|
|
|
|
pub deleted: Color,
|
2021-11-19 02:16:35 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-01-25 11:23:24 +00:00
|
|
|
pub struct DiagnosticPathHeader {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub filename: ContainedText,
|
|
|
|
pub path: ContainedText,
|
2022-01-25 20:10:11 +00:00
|
|
|
pub text_scale_factor: f32,
|
2022-01-25 11:23:24 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-01-25 11:23:24 +00:00
|
|
|
pub struct DiagnosticHeader {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2023-05-01 20:48:27 +00:00
|
|
|
pub source: ContainedLabel,
|
2022-01-25 14:46:33 +00:00
|
|
|
pub message: ContainedLabel,
|
2022-01-25 14:23:58 +00:00
|
|
|
pub code: ContainedText,
|
2022-01-25 20:10:11 +00:00
|
|
|
pub text_scale_factor: f32,
|
2022-01-25 19:40:53 +00:00
|
|
|
pub icon_width_factor: f32,
|
2022-01-25 11:23:24 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2021-11-19 02:16:35 +00:00
|
|
|
pub struct DiagnosticStyle {
|
2022-01-25 16:07:12 +00:00
|
|
|
pub message: LabelStyle,
|
2022-01-07 01:55:56 +00:00
|
|
|
#[serde(default)]
|
|
|
|
pub header: ContainerStyle,
|
2022-01-25 20:10:11 +00:00
|
|
|
pub text_scale_factor: f32,
|
2021-10-05 17:21:13 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-01-31 21:01:20 +00:00
|
|
|
pub struct AutocompleteStyle {
|
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
|
|
|
pub item: ContainerStyle,
|
2022-01-31 21:25:46 +00:00
|
|
|
pub selected_item: ContainerStyle,
|
2022-02-03 10:39:19 +00:00
|
|
|
pub hovered_item: ContainerStyle,
|
2022-02-01 14:11:20 +00:00
|
|
|
pub match_highlight: HighlightStyle,
|
2022-01-31 21:01:20 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Copy, Default, Deserialize, JsonSchema)]
|
2021-10-05 17:21:13 +00:00
|
|
|
pub struct SelectionStyle {
|
|
|
|
pub cursor: Color,
|
|
|
|
pub selection: Color,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-02-24 23:27:11 +00:00
|
|
|
pub struct FieldEditor {
|
2021-09-07 21:42:19 +00:00
|
|
|
#[serde(flatten)]
|
|
|
|
pub container: ContainerStyle,
|
2021-09-16 20:12:38 +00:00
|
|
|
pub text: TextStyle,
|
2021-09-16 19:23:42 +00:00
|
|
|
#[serde(default)]
|
2021-09-16 20:12:38 +00:00
|
|
|
pub placeholder_text: Option<TextStyle>,
|
2021-09-02 18:20:30 +00:00
|
|
|
pub selection: SelectionStyle,
|
2021-08-24 23:39:56 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-03-03 20:26:29 +00:00
|
|
|
pub struct InteractiveColor {
|
|
|
|
pub color: Color,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-01 03:37:04 +00:00
|
|
|
pub struct CodeActions {
|
|
|
|
#[serde(default)]
|
2023-06-14 12:02:32 +00:00
|
|
|
pub indicator: Toggleable<Interactive<InteractiveColor>>,
|
2022-09-01 03:37:04 +00:00
|
|
|
pub vertical_scale: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-02-26 04:10:20 +00:00
|
|
|
pub struct Folds {
|
2023-06-14 12:02:32 +00:00
|
|
|
pub indicator: Toggleable<Interactive<InteractiveColor>>,
|
2023-03-03 20:26:29 +00:00
|
|
|
pub ellipses: FoldEllipses,
|
2023-02-26 04:10:20 +00:00
|
|
|
pub fold_background: Color,
|
2023-03-14 07:42:15 +00:00
|
|
|
pub icon_margin_scale: f32,
|
2023-02-27 22:46:25 +00:00
|
|
|
pub folded_icon: String,
|
|
|
|
pub foldable_icon: String,
|
2023-02-26 04:10:20 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-03-03 20:26:29 +00:00
|
|
|
pub struct FoldEllipses {
|
|
|
|
pub text_color: Color,
|
|
|
|
pub background: Interactive<InteractiveColor>,
|
|
|
|
pub corner_radius_factor: f32,
|
2023-02-27 03:20:16 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-10-03 00:56:09 +00:00
|
|
|
pub struct DiffStyle {
|
|
|
|
pub inserted: Color,
|
|
|
|
pub modified: Color,
|
|
|
|
pub deleted: Color,
|
|
|
|
pub removed_width_em: f32,
|
|
|
|
pub width_em: f32,
|
|
|
|
pub corner_radius: f32,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Debug, Default, Clone, Copy, JsonSchema)]
|
2022-04-28 17:59:32 +00:00
|
|
|
pub struct Interactive<T> {
|
|
|
|
pub default: T,
|
2023-06-16 12:30:16 +00:00
|
|
|
pub hovered: Option<T>,
|
2022-09-13 22:17:27 +00:00
|
|
|
pub clicked: Option<T>,
|
2022-07-06 22:43:42 +00:00
|
|
|
pub disabled: Option<T>,
|
2022-04-28 17:59:32 +00:00
|
|
|
}
|
|
|
|
|
2023-06-22 15:58:56 +00:00
|
|
|
#[derive(Clone, Copy, Debug, Default, Deserialize, JsonSchema)]
|
2023-06-14 12:02:32 +00:00
|
|
|
pub struct Toggleable<T> {
|
2023-06-14 13:12:38 +00:00
|
|
|
active: T,
|
|
|
|
inactive: T,
|
2023-06-14 12:02:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Toggleable<T> {
|
2023-06-14 13:12:38 +00:00
|
|
|
pub fn new(active: T, inactive: T) -> Self {
|
|
|
|
Self { active, inactive }
|
2023-06-14 12:02:32 +00:00
|
|
|
}
|
2023-06-20 22:46:30 +00:00
|
|
|
pub fn in_state(&self, active: bool) -> &T {
|
2022-04-28 22:17:56 +00:00
|
|
|
if active {
|
2023-06-20 22:46:30 +00:00
|
|
|
&self.active
|
2023-06-20 22:54:58 +00:00
|
|
|
} else {
|
|
|
|
&self.inactive
|
2023-06-14 12:02:32 +00:00
|
|
|
}
|
|
|
|
}
|
2023-06-14 13:12:38 +00:00
|
|
|
pub fn active_state(&self) -> &T {
|
2023-06-20 22:46:30 +00:00
|
|
|
self.in_state(true)
|
2023-06-14 12:02:32 +00:00
|
|
|
}
|
2023-06-14 13:12:38 +00:00
|
|
|
pub fn inactive_state(&self) -> &T {
|
2023-06-20 22:46:30 +00:00
|
|
|
self.in_state(false)
|
2023-06-14 12:02:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-28 17:59:32 +00:00
|
|
|
impl<T> Interactive<T> {
|
2023-06-14 12:02:32 +00:00
|
|
|
pub fn style_for(&self, state: &mut MouseState) -> &T {
|
|
|
|
if state.clicked() == Some(platform::MouseButton::Left) && self.clicked.is_some() {
|
2022-09-13 22:17:27 +00:00
|
|
|
self.clicked.as_ref().unwrap()
|
2022-10-15 00:09:15 +00:00
|
|
|
} else if state.hovered() {
|
2023-06-16 12:30:16 +00:00
|
|
|
self.hovered.as_ref().unwrap_or(&self.default)
|
2022-04-28 22:17:56 +00:00
|
|
|
} else {
|
2022-07-06 22:43:42 +00:00
|
|
|
&self.default
|
2022-04-28 22:17:56 +00:00
|
|
|
}
|
2022-04-28 19:08:15 +00:00
|
|
|
}
|
2022-07-06 22:43:42 +00:00
|
|
|
pub fn disabled_style(&self) -> &T {
|
|
|
|
self.disabled.as_ref().unwrap_or(&self.default)
|
|
|
|
}
|
2022-04-28 17:59:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'de, T: DeserializeOwned> Deserialize<'de> for Interactive<T> {
|
|
|
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
|
|
|
where
|
|
|
|
D: serde::Deserializer<'de>,
|
|
|
|
{
|
|
|
|
#[derive(Deserialize)]
|
|
|
|
struct Helper {
|
|
|
|
default: Value,
|
2023-06-16 12:30:16 +00:00
|
|
|
hovered: Option<Value>,
|
2022-09-13 22:17:27 +00:00
|
|
|
clicked: Option<Value>,
|
2022-07-06 22:43:42 +00:00
|
|
|
disabled: Option<Value>,
|
2022-04-28 17:59:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
let json = Helper::deserialize(deserializer)?;
|
|
|
|
|
2022-04-28 19:08:15 +00:00
|
|
|
let deserialize_state = |state_json: Option<Value>| -> Result<Option<T>, D::Error> {
|
|
|
|
if let Some(mut state_json) = state_json {
|
|
|
|
if let Value::Object(state_json) = &mut state_json {
|
|
|
|
if let Value::Object(default) = &json.default {
|
|
|
|
for (key, value) in default {
|
|
|
|
if !state_json.contains_key(key) {
|
|
|
|
state_json.insert(key.clone(), value.clone());
|
|
|
|
}
|
2022-04-28 17:59:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-28 19:08:15 +00:00
|
|
|
Ok(Some(
|
|
|
|
serde_json::from_value::<T>(state_json).map_err(serde::de::Error::custom)?,
|
|
|
|
))
|
|
|
|
} else {
|
|
|
|
Ok(None)
|
2022-04-28 17:59:32 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-06-16 12:30:16 +00:00
|
|
|
let hovered = deserialize_state(json.hovered)?;
|
2022-09-13 22:17:27 +00:00
|
|
|
let clicked = deserialize_state(json.clicked)?;
|
2022-07-06 22:43:42 +00:00
|
|
|
let disabled = deserialize_state(json.disabled)?;
|
2022-04-28 17:59:32 +00:00
|
|
|
let default = serde_json::from_value(json.default).map_err(serde::de::Error::custom)?;
|
|
|
|
|
|
|
|
Ok(Interactive {
|
|
|
|
default,
|
2023-06-16 12:30:16 +00:00
|
|
|
hovered,
|
2022-09-13 22:17:27 +00:00
|
|
|
clicked,
|
2022-07-06 22:43:42 +00:00
|
|
|
disabled,
|
2022-04-28 17:59:32 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-24 23:27:11 +00:00
|
|
|
impl Editor {
|
2021-11-28 20:25:05 +00:00
|
|
|
pub fn replica_selection_style(&self, replica_id: u16) -> &SelectionStyle {
|
|
|
|
let style_ix = replica_id as usize % (self.guest_selections.len() + 1);
|
|
|
|
if style_ix == 0 {
|
|
|
|
&self.selection
|
|
|
|
} else {
|
|
|
|
&self.guest_selections[style_ix - 1]
|
|
|
|
}
|
|
|
|
}
|
2021-10-05 17:21:13 +00:00
|
|
|
}
|
|
|
|
|
2023-06-19 18:31:17 +00:00
|
|
|
#[derive(Default, JsonSchema)]
|
2021-10-05 17:21:13 +00:00
|
|
|
pub struct SyntaxTheme {
|
|
|
|
pub highlights: Vec<(String, HighlightStyle)>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl SyntaxTheme {
|
|
|
|
pub fn new(highlights: Vec<(String, HighlightStyle)>) -> Self {
|
|
|
|
Self { highlights }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'de> Deserialize<'de> for SyntaxTheme {
|
|
|
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
|
|
|
where
|
|
|
|
D: serde::Deserializer<'de>,
|
|
|
|
{
|
|
|
|
let syntax_data: HashMap<String, HighlightStyle> = Deserialize::deserialize(deserializer)?;
|
|
|
|
|
|
|
|
let mut result = Self::new(Vec::new());
|
|
|
|
for (key, style) in syntax_data {
|
|
|
|
match result
|
|
|
|
.highlights
|
|
|
|
.binary_search_by(|(needle, _)| needle.cmp(&key))
|
|
|
|
{
|
|
|
|
Ok(i) | Err(i) => {
|
|
|
|
result.highlights.insert(i, (key, style));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(result)
|
|
|
|
}
|
|
|
|
}
|
2022-06-03 21:56:21 +00:00
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-06-03 21:56:21 +00:00
|
|
|
pub struct HoverPopover {
|
|
|
|
pub container: ContainerStyle,
|
2022-07-16 02:39:52 +00:00
|
|
|
pub info_container: ContainerStyle,
|
|
|
|
pub warning_container: ContainerStyle,
|
|
|
|
pub error_container: ContainerStyle,
|
2022-06-03 21:56:21 +00:00
|
|
|
pub block_style: ContainerStyle,
|
|
|
|
pub prose: TextStyle,
|
2023-04-26 17:21:19 +00:00
|
|
|
pub diagnostic_source_highlight: HighlightStyle,
|
2022-06-07 18:47:17 +00:00
|
|
|
pub highlight: Color,
|
2022-06-03 21:56:21 +00:00
|
|
|
}
|
2022-06-29 00:07:18 +00:00
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-06-29 00:07:18 +00:00
|
|
|
pub struct TerminalStyle {
|
|
|
|
pub black: Color,
|
|
|
|
pub red: Color,
|
|
|
|
pub green: Color,
|
|
|
|
pub yellow: Color,
|
|
|
|
pub blue: Color,
|
|
|
|
pub magenta: Color,
|
|
|
|
pub cyan: Color,
|
|
|
|
pub white: Color,
|
|
|
|
pub bright_black: Color,
|
|
|
|
pub bright_red: Color,
|
|
|
|
pub bright_green: Color,
|
|
|
|
pub bright_yellow: Color,
|
|
|
|
pub bright_blue: Color,
|
|
|
|
pub bright_magenta: Color,
|
|
|
|
pub bright_cyan: Color,
|
|
|
|
pub bright_white: Color,
|
|
|
|
pub foreground: Color,
|
|
|
|
pub background: Color,
|
2022-07-06 20:20:54 +00:00
|
|
|
pub modal_background: Color,
|
2022-06-29 00:07:18 +00:00
|
|
|
pub cursor: Color,
|
|
|
|
pub dim_black: Color,
|
|
|
|
pub dim_red: Color,
|
|
|
|
pub dim_green: Color,
|
|
|
|
pub dim_yellow: Color,
|
|
|
|
pub dim_blue: Color,
|
|
|
|
pub dim_magenta: Color,
|
|
|
|
pub dim_cyan: Color,
|
|
|
|
pub dim_white: Color,
|
|
|
|
pub bright_foreground: Color,
|
|
|
|
pub dim_foreground: Color,
|
|
|
|
}
|
2022-09-21 22:57:39 +00:00
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-05-26 21:38:03 +00:00
|
|
|
pub struct AssistantStyle {
|
|
|
|
pub container: ContainerStyle,
|
2023-06-26 15:48:43 +00:00
|
|
|
pub hamburger_button: Interactive<IconStyle>,
|
|
|
|
pub split_button: Interactive<IconStyle>,
|
|
|
|
pub assist_button: Interactive<IconStyle>,
|
|
|
|
pub quote_button: Interactive<IconStyle>,
|
|
|
|
pub zoom_in_button: Interactive<IconStyle>,
|
|
|
|
pub zoom_out_button: Interactive<IconStyle>,
|
|
|
|
pub plus_button: Interactive<IconStyle>,
|
2023-06-21 15:54:49 +00:00
|
|
|
pub title: ContainedText,
|
2023-06-21 02:11:32 +00:00
|
|
|
pub message_header: ContainerStyle,
|
2023-05-29 14:23:16 +00:00
|
|
|
pub sent_at: ContainedText,
|
2023-06-06 16:45:08 +00:00
|
|
|
pub user_sender: Interactive<ContainedText>,
|
|
|
|
pub assistant_sender: Interactive<ContainedText>,
|
|
|
|
pub system_sender: Interactive<ContainedText>,
|
2023-06-06 11:04:52 +00:00
|
|
|
pub model: Interactive<ContainedText>,
|
2023-06-02 15:21:18 +00:00
|
|
|
pub remaining_tokens: ContainedText,
|
2023-06-29 21:44:47 +00:00
|
|
|
pub low_remaining_tokens: ContainedText,
|
2023-06-02 15:21:18 +00:00
|
|
|
pub no_remaining_tokens: ContainedText,
|
2023-06-06 14:53:56 +00:00
|
|
|
pub error_icon: Icon,
|
2023-06-02 09:38:02 +00:00
|
|
|
pub api_key_editor: FieldEditor,
|
|
|
|
pub api_key_prompt: ContainedText,
|
2023-06-21 09:44:32 +00:00
|
|
|
pub saved_conversation: SavedConversation,
|
|
|
|
}
|
|
|
|
|
2023-06-23 07:09:42 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-06-21 09:44:32 +00:00
|
|
|
pub struct SavedConversation {
|
|
|
|
pub container: Interactive<ContainerStyle>,
|
|
|
|
pub saved_at: ContainedText,
|
|
|
|
pub title: ContainedText,
|
2023-05-26 21:38:03 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-02-06 22:41:36 +00:00
|
|
|
pub struct FeedbackStyle {
|
|
|
|
pub submit_button: Interactive<ContainedText>,
|
|
|
|
pub button_margin: f32,
|
2023-02-24 13:46:28 +00:00
|
|
|
pub info_text_default: ContainedText,
|
|
|
|
pub link_text_default: ContainedText,
|
|
|
|
pub link_text_hover: ContainedText,
|
2023-02-06 22:41:36 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2023-02-24 22:31:59 +00:00
|
|
|
pub struct WelcomeStyle {
|
2023-03-07 00:28:23 +00:00
|
|
|
pub page_width: f32,
|
2023-03-27 21:25:11 +00:00
|
|
|
pub logo: SvgStyle,
|
2023-03-07 00:28:23 +00:00
|
|
|
pub logo_subheading: ContainedText,
|
2023-03-09 02:47:52 +00:00
|
|
|
pub usage_note: ContainedText,
|
2023-02-24 22:31:59 +00:00
|
|
|
pub checkbox: CheckboxStyle,
|
2023-03-09 01:56:39 +00:00
|
|
|
pub checkbox_container: ContainerStyle,
|
2023-03-06 17:58:07 +00:00
|
|
|
pub button: Interactive<ContainedText>,
|
2023-03-08 21:34:27 +00:00
|
|
|
pub button_group: ContainerStyle,
|
|
|
|
pub heading_group: ContainerStyle,
|
|
|
|
pub checkbox_group: ContainerStyle,
|
2023-02-24 22:31:59 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-21 22:57:39 +00:00
|
|
|
pub struct ColorScheme {
|
|
|
|
pub name: String,
|
|
|
|
pub is_light: bool,
|
|
|
|
pub ramps: RampSet,
|
2022-10-19 20:02:51 +00:00
|
|
|
pub lowest: Layer,
|
2022-09-21 22:57:39 +00:00
|
|
|
pub middle: Layer,
|
2022-10-19 20:02:51 +00:00
|
|
|
pub highest: Layer,
|
|
|
|
|
|
|
|
pub popover_shadow: Shadow,
|
|
|
|
pub modal_shadow: Shadow,
|
2022-09-21 22:57:39 +00:00
|
|
|
|
2022-10-19 20:02:51 +00:00
|
|
|
pub players: Vec<Player>,
|
2022-09-21 22:57:39 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-21 22:57:39 +00:00
|
|
|
pub struct Player {
|
|
|
|
pub cursor: Color,
|
|
|
|
pub selection: Color,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-21 22:57:39 +00:00
|
|
|
pub struct RampSet {
|
|
|
|
pub neutral: Vec<Color>,
|
|
|
|
pub red: Vec<Color>,
|
|
|
|
pub orange: Vec<Color>,
|
|
|
|
pub yellow: Vec<Color>,
|
|
|
|
pub green: Vec<Color>,
|
|
|
|
pub cyan: Vec<Color>,
|
|
|
|
pub blue: Vec<Color>,
|
|
|
|
pub violet: Vec<Color>,
|
|
|
|
pub magenta: Vec<Color>,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-21 22:57:39 +00:00
|
|
|
pub struct Layer {
|
|
|
|
pub base: StyleSet,
|
2022-09-22 20:29:19 +00:00
|
|
|
pub variant: StyleSet,
|
2022-09-21 22:57:39 +00:00
|
|
|
pub on: StyleSet,
|
2022-10-11 21:38:28 +00:00
|
|
|
pub accent: StyleSet,
|
2022-09-21 22:57:39 +00:00
|
|
|
pub positive: StyleSet,
|
|
|
|
pub warning: StyleSet,
|
|
|
|
pub negative: StyleSet,
|
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-21 22:57:39 +00:00
|
|
|
pub struct StyleSet {
|
|
|
|
pub default: Style,
|
|
|
|
pub active: Style,
|
|
|
|
pub disabled: Style,
|
|
|
|
pub hovered: Style,
|
|
|
|
pub pressed: Style,
|
2022-10-11 21:38:28 +00:00
|
|
|
pub inverted: Style,
|
2022-09-21 22:57:39 +00:00
|
|
|
}
|
|
|
|
|
2023-06-16 19:37:56 +00:00
|
|
|
#[derive(Clone, Deserialize, Default, JsonSchema)]
|
2022-09-21 22:57:39 +00:00
|
|
|
pub struct Style {
|
|
|
|
pub background: Color,
|
|
|
|
pub border: Color,
|
|
|
|
pub foreground: Color,
|
|
|
|
}
|