diff --git a/Cargo.lock b/Cargo.lock index 5afa2c6225badf4ff2b4158fbc0f1cb0e75c2b50..1d0af3c00876104d2f8554ee43ed757689bce281 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1440,7 +1440,7 @@ dependencies = [ [[package]] name = "collab" -version = "0.28.0" +version = "0.33.0" dependencies = [ "anyhow", "async-trait", diff --git a/assets/icons/arrow_circle.svg b/assets/icons/arrow_circle.svg new file mode 100644 index 0000000000000000000000000000000000000000..750e349e2b8c73ef0c78b9974ea100f70ae37abe --- /dev/null +++ b/assets/icons/arrow_circle.svg @@ -0,0 +1 @@ + diff --git a/assets/icons/at-sign.svg b/assets/icons/at_sign.svg similarity index 85% rename from assets/icons/at-sign.svg rename to assets/icons/at_sign.svg index 5adac38f62fb661e11d0f2e8f4ea17c94683aa5f..4cf8cd468f17e5cbcd012c6225543f6c4b027969 100644 --- a/assets/icons/at-sign.svg +++ b/assets/icons/at_sign.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/assets/icons/bell-off.svg b/assets/icons/bell_off.svg similarity index 100% rename from assets/icons/bell-off.svg rename to assets/icons/bell_off.svg diff --git a/assets/icons/bell-ring.svg b/assets/icons/bell_ring.svg similarity index 100% rename from assets/icons/bell-ring.svg rename to assets/icons/bell_ring.svg diff --git a/assets/icons/delete.svg b/assets/icons/delete.svg index 1068cb65f29a02cdf9b5f418239ed3069e4d1a3e..a7edbb615871745c0277b242b189a7e39135a4ed 100644 --- a/assets/icons/delete.svg +++ b/assets/icons/delete.svg @@ -1,4 +1 @@ - - - - + diff --git a/assets/icons/escape.svg b/assets/icons/escape.svg new file mode 100644 index 0000000000000000000000000000000000000000..00c772a2adfea0b43c10c5635c05649a00756de3 --- /dev/null +++ b/assets/icons/escape.svg @@ -0,0 +1 @@ + diff --git a/assets/icons/magic-wand.svg b/assets/icons/magic_wand.svg similarity index 100% rename from assets/icons/magic-wand.svg rename to assets/icons/magic_wand.svg diff --git a/assets/icons/mail-open.svg b/assets/icons/mail_open.svg similarity index 100% rename from assets/icons/mail-open.svg rename to assets/icons/mail_open.svg diff --git a/assets/icons/mic-mute.svg b/assets/icons/mic_mute.svg similarity index 100% rename from assets/icons/mic-mute.svg rename to assets/icons/mic_mute.svg diff --git a/assets/icons/page_down.svg b/assets/icons/page_down.svg new file mode 100644 index 0000000000000000000000000000000000000000..765f36b26a6f85669157f65d45128a604f8c695a --- /dev/null +++ b/assets/icons/page_down.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/icons/page_up.svg b/assets/icons/page_up.svg new file mode 100644 index 0000000000000000000000000000000000000000..f555165d2db9e85f8f2920fb7de258e7e64fb579 --- /dev/null +++ b/assets/icons/page_up.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/icons/return.svg b/assets/icons/return.svg index 683519c3066fef61cb256a103dcd219fe59ff9f1..16cfeeda2e3ad0e2acee6d7a594916e796fd2405 100644 --- a/assets/icons/return.svg +++ b/assets/icons/return.svg @@ -1,3 +1 @@ - - - + diff --git a/assets/icons/select-all.svg b/assets/icons/select_all.svg similarity index 100% rename from assets/icons/select-all.svg rename to assets/icons/select_all.svg diff --git a/assets/icons/space.svg b/assets/icons/space.svg new file mode 100644 index 0000000000000000000000000000000000000000..63718fb4aa1e1300621d29ca5bddd4e130c4796e --- /dev/null +++ b/assets/icons/space.svg @@ -0,0 +1 @@ + diff --git a/assets/icons/speaker-loud.svg b/assets/icons/speaker_loud.svg similarity index 100% rename from assets/icons/speaker-loud.svg rename to assets/icons/speaker_loud.svg diff --git a/assets/icons/speaker-off.svg b/assets/icons/speaker_off.svg similarity index 100% rename from assets/icons/speaker-off.svg rename to assets/icons/speaker_off.svg diff --git a/assets/icons/tab.svg b/assets/icons/tab.svg new file mode 100644 index 0000000000000000000000000000000000000000..49a3536bedd51ee70dd914710801bc9dbaf51616 --- /dev/null +++ b/assets/icons/tab.svg @@ -0,0 +1 @@ + diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 7b19ad130c4c42316f6ca65c8063be9c3842b42b..9221d87f60fda92990997a1401bf54325a099c6b 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -16,7 +16,7 @@ use ai::{ use ai::prompts::repository_context::PromptCodeSnippet; use anyhow::{anyhow, Result}; use chrono::{DateTime, Local}; -use client::{telemetry::AssistantKind, TelemetrySettings}; +use client::telemetry::AssistantKind; use collections::{hash_map, HashMap, HashSet, VecDeque}; use editor::{ display_map::{ @@ -1125,8 +1125,6 @@ impl Render for AssistantPanel { .child(Label::new( "Click on the Z button in the status bar to close this panel." )) - .border() - .border_color(gpui::red()) } else { let header = TabBar::new("assistant_header") .start_child( @@ -1159,6 +1157,7 @@ impl Render for AssistantPanel { }); v_stack() + .key_context("AssistantPanel") .size_full() .on_action(cx.listener(|this, _: &workspace::NewFile, cx| { this.new_conversation(cx); @@ -3529,12 +3528,5 @@ fn report_assistant_event( .default_open_ai_model .clone(); - let telemetry_settings = TelemetrySettings::get_global(cx).clone(); - - telemetry.report_assistant_event( - telemetry_settings, - conversation_id, - assistant_kind, - model.full_name(), - ) + telemetry.report_assistant_event(conversation_id, assistant_kind, model.full_name(), cx) } diff --git a/crates/call/src/call.rs b/crates/call/src/call.rs index bc8a0809cae179cd1faac96d90664c9ea41a30e6..c419043a722b35fb34f33a224502057e53f3a16b 100644 --- a/crates/call/src/call.rs +++ b/crates/call/src/call.rs @@ -5,7 +5,7 @@ pub mod room; use anyhow::{anyhow, Result}; use audio::Audio; use call_settings::CallSettings; -use client::{proto, Client, TelemetrySettings, TypedEnvelope, User, UserStore, ZED_ALWAYS_ACTIVE}; +use client::{proto, Client, TypedEnvelope, User, UserStore, ZED_ALWAYS_ACTIVE}; use collections::HashSet; use futures::{channel::oneshot, future::Shared, Future, FutureExt}; use gpui::{ @@ -480,9 +480,8 @@ pub fn report_call_event_for_room( cx: &mut AppContext, ) { let telemetry = client.telemetry(); - let telemetry_settings = *TelemetrySettings::get_global(cx); - telemetry.report_call_event(telemetry_settings, operation, Some(room_id), channel_id) + telemetry.report_call_event(operation, Some(room_id), channel_id, cx) } pub fn report_call_event_for_channel( @@ -495,13 +494,11 @@ pub fn report_call_event_for_channel( let telemetry = client.telemetry(); - let telemetry_settings = *TelemetrySettings::get_global(cx); - telemetry.report_call_event( - telemetry_settings, operation, room.map(|r| r.read(cx).id()), Some(channel_id), + cx, ) } diff --git a/crates/client/src/telemetry.rs b/crates/client/src/telemetry.rs index 789b627fb0641c4bfb3c99e70db8d96738b8c099..2391c5f3b55a0c96133ed82ae964ecd969cc68e2 100644 --- a/crates/client/src/telemetry.rs +++ b/crates/client/src/telemetry.rs @@ -177,8 +177,7 @@ impl Telemetry { // TestAppContext ends up calling this function on shutdown and it panics when trying to find the TelemetrySettings #[cfg(not(any(test, feature = "test-support")))] fn shutdown_telemetry(self: &Arc, cx: &mut AppContext) -> impl Future { - let telemetry_settings = TelemetrySettings::get_global(cx).clone(); - self.report_app_event(telemetry_settings, "close", true); + self.report_app_event("close", true, cx); Task::ready(()) } @@ -227,24 +226,11 @@ impl Telemetry { return; }; - let telemetry_settings = if let Ok(telemetry_settings) = - cx.update(|cx| *TelemetrySettings::get_global(cx)) - { - telemetry_settings - } else { - break; - }; - - this.report_memory_event( - telemetry_settings, - process.memory(), - process.virtual_memory(), - ); - this.report_cpu_event( - telemetry_settings, - process.cpu_usage(), - system.cpus().len() as u32, - ); + cx.update(|cx| { + this.report_memory_event(process.memory(), process.virtual_memory(), cx); + this.report_cpu_event(process.cpu_usage(), system.cpus().len() as u32, cx); + }) + .ok(); } }) .detach(); @@ -269,12 +255,12 @@ impl Telemetry { pub fn report_editor_event( self: &Arc, - telemetry_settings: TelemetrySettings, file_extension: Option, vim_mode: bool, operation: &'static str, copilot_enabled: bool, copilot_enabled_for_language: bool, + cx: &AppContext, ) { let event = ClickhouseEvent::Editor { file_extension, @@ -285,15 +271,15 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } pub fn report_copilot_event( self: &Arc, - telemetry_settings: TelemetrySettings, suggestion_id: Option, suggestion_accepted: bool, file_extension: Option, + cx: &AppContext, ) { let event = ClickhouseEvent::Copilot { suggestion_id, @@ -302,15 +288,15 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } pub fn report_assistant_event( self: &Arc, - telemetry_settings: TelemetrySettings, conversation_id: Option, kind: AssistantKind, model: &'static str, + cx: &AppContext, ) { let event = ClickhouseEvent::Assistant { conversation_id, @@ -319,15 +305,15 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } pub fn report_call_event( self: &Arc, - telemetry_settings: TelemetrySettings, operation: &'static str, room_id: Option, channel_id: Option, + cx: &AppContext, ) { let event = ClickhouseEvent::Call { operation, @@ -336,14 +322,14 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } pub fn report_cpu_event( self: &Arc, - telemetry_settings: TelemetrySettings, usage_as_percentage: f32, core_count: u32, + cx: &AppContext, ) { let event = ClickhouseEvent::Cpu { usage_as_percentage, @@ -351,14 +337,14 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } pub fn report_memory_event( self: &Arc, - telemetry_settings: TelemetrySettings, memory_in_bytes: u64, virtual_memory_in_bytes: u64, + cx: &AppContext, ) { let event = ClickhouseEvent::Memory { memory_in_bytes, @@ -366,28 +352,28 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } pub fn report_app_event( self: &Arc, - telemetry_settings: TelemetrySettings, operation: &'static str, immediate_flush: bool, + cx: &AppContext, ) { let event = ClickhouseEvent::App { operation, milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, immediate_flush) + self.report_clickhouse_event(event, immediate_flush, cx) } pub fn report_setting_event( self: &Arc, - telemetry_settings: TelemetrySettings, setting: &'static str, value: String, + cx: &AppContext, ) { let event = ClickhouseEvent::Setting { setting, @@ -395,7 +381,7 @@ impl Telemetry { milliseconds_since_first_event: self.milliseconds_since_first_event(), }; - self.report_clickhouse_event(event, telemetry_settings, false) + self.report_clickhouse_event(event, false, cx) } fn milliseconds_since_first_event(&self) -> i64 { @@ -415,10 +401,10 @@ impl Telemetry { fn report_clickhouse_event( self: &Arc, event: ClickhouseEvent, - telemetry_settings: TelemetrySettings, immediate_flush: bool, + cx: &AppContext, ) { - if !telemetry_settings.metrics { + if !TelemetrySettings::get_global(cx).metrics { return; } diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index 7681a5e572a7208763082991a20ead4825bfb5bc..49a4a2e693ae2af509d0f71796cf495b8640c1ee 100644 --- a/crates/collab/Cargo.toml +++ b/crates/collab/Cargo.toml @@ -3,7 +3,7 @@ authors = ["Nathan Sobo "] default-run = "collab" edition = "2021" name = "collab" -version = "0.28.0" +version = "0.33.0" publish = false [[bin]] diff --git a/crates/collab_ui/src/collab_panel/channel_modal.rs b/crates/collab_ui/src/collab_panel/channel_modal.rs index 114e89f1c4df54930b49c18235ead6f6fbec0af1..4955d01af26a61fcf9b89870b9a1a65a983026ce 100644 --- a/crates/collab_ui/src/collab_panel/channel_modal.rs +++ b/crates/collab_ui/src/collab_panel/channel_modal.rs @@ -164,8 +164,14 @@ impl Render for ChannelModal { .py_1() .rounded_t(px(8.)) .bg(cx.theme().colors().element_background) - .child(IconElement::new(Icon::Hash).size(IconSize::Medium)) - .child(Label::new(channel_name)) + .child( + h_stack() + .w_px() + .flex_1() + .gap_1() + .child(IconElement::new(Icon::Hash).size(IconSize::Medium)) + .child(Label::new(channel_name)), + ) .child( h_stack() .w_full() diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 60bb35a8d58e65bede02ba5c7305eb7be923bda4..8150fe1e4ddf19bb422697d17cf0edf4ade0aed5 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -110,6 +110,7 @@ impl Render for CollabTitlebarItem { &room, project_id, ¤t_user, + cx, )) .children( remote_participants.iter().filter_map(|collaborator| { @@ -127,6 +128,7 @@ impl Render for CollabTitlebarItem { &room, project_id, ¤t_user, + cx, )?; Some( @@ -303,22 +305,38 @@ impl CollabTitlebarItem { // resolve if you are in a room -> render_project_owner // render_project_owner -> resolve if you are in a room -> Option - pub fn render_project_host(&self, cx: &mut ViewContext) -> Option { + pub fn render_project_host(&self, cx: &mut ViewContext) -> Option { let host = self.project.read(cx).host()?; - let host = self.user_store.read(cx).get_cached_user(host.user_id)?; + let host_user = self.user_store.read(cx).get_cached_user(host.user_id)?; let participant_index = self .user_store .read(cx) .participant_indices() - .get(&host.id)?; + .get(&host_user.id)?; Some( - div().border().border_color(gpui::red()).child( - Button::new("project_owner_trigger", host.github_login.clone()) - .color(Color::Player(participant_index.0)) - .style(ButtonStyle::Subtle) - .label_size(LabelSize::Small) - .tooltip(move |cx| Tooltip::text("Toggle following", cx)), - ), + Button::new("project_owner_trigger", host_user.github_login.clone()) + .color(Color::Player(participant_index.0)) + .style(ButtonStyle::Subtle) + .label_size(LabelSize::Small) + .tooltip(move |cx| { + Tooltip::text( + format!( + "{} is sharing this project. Click to follow.", + host_user.github_login.clone() + ), + cx, + ) + }) + .on_click({ + let host_peer_id = host.peer_id.clone(); + cx.listener(move |this, _, cx| { + this.workspace + .update(cx, |workspace, cx| { + workspace.follow(host_peer_id, cx); + }) + .log_err(); + }) + }), ) } @@ -389,6 +407,7 @@ impl CollabTitlebarItem { room: &Room, project_id: Option, current_user: &Arc, + cx: &ViewContext, ) -> Option { let followers = project_id.map_or(&[] as &[_], |id| room.followers_for(peer_id, id)); @@ -397,9 +416,9 @@ impl CollabTitlebarItem { Avatar::new(user.avatar_uri.clone()) .grayscale(!is_present) .border_color(if is_speaking { - gpui::blue() + cx.theme().status().info_border } else if is_muted { - gpui::red() + cx.theme().status().error_border } else { Hsla::default() }), diff --git a/crates/diagnostics/src/items.rs b/crates/diagnostics/src/items.rs index 9f7be0c04f2ca27413953cd5a133139cba4e10ea..da1f77b9afb0f1c4308362f42f479dc30890e77b 100644 --- a/crates/diagnostics/src/items.rs +++ b/crates/diagnostics/src/items.rs @@ -23,11 +23,21 @@ pub struct DiagnosticIndicator { impl Render for DiagnosticIndicator { fn render(&mut self, cx: &mut ViewContext) -> impl IntoElement { let diagnostic_indicator = match (self.summary.error_count, self.summary.warning_count) { - (0, 0) => h_stack().child( - IconElement::new(Icon::Check) - .size(IconSize::Small) - .color(Color::Success), - ), + (0, 0) => h_stack().map(|this| { + if !self.in_progress_checks.is_empty() { + this.child( + IconElement::new(Icon::ArrowCircle) + .size(IconSize::Small) + .color(Color::Muted), + ) + } else { + this.child( + IconElement::new(Icon::Check) + .size(IconSize::Small) + .color(Color::Default), + ) + } + }), (0, warning_count) => h_stack() .gap_1() .child( @@ -64,6 +74,7 @@ impl Render for DiagnosticIndicator { Some( Label::new("Checking…") .size(LabelSize::Small) + .color(Color::Muted) .into_any_element(), ) } else if let Some(diagnostic) = &self.current_diagnostic { diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 85a156a8eb9014728a4a2ad1598082e990f45ef7..cf074bad415d499516c1bb693cbfc19c4482f41c 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -24,7 +24,7 @@ use ::git::diff::DiffHunk; use aho_corasick::AhoCorasick; use anyhow::{anyhow, Context as _, Result}; use blink_manager::BlinkManager; -use client::{Client, Collaborator, ParticipantIndex, TelemetrySettings}; +use client::{Client, Collaborator, ParticipantIndex}; use clock::ReplicaId; use collections::{BTreeMap, Bound, HashMap, HashSet, VecDeque}; use convert_case::{Case, Casing}; @@ -99,9 +99,9 @@ use sum_tree::TreeMap; use text::{OffsetUtf16, Rope}; use theme::{ActiveTheme, PlayerColor, StatusColors, SyntaxTheme, ThemeColors, ThemeSettings}; use ui::{ - h_stack, ButtonSize, ButtonStyle, Icon, IconButton, ListItem, ListItemSpacing, Popover, Tooltip, + h_stack, prelude::*, ButtonSize, ButtonStyle, Icon, IconButton, IconSize, ListItem, Popover, + Tooltip, }; -use ui::{prelude::*, IconSize}; use util::{post_inc, RangeExt, ResultExt, TryFutureExt}; use workspace::{searchable::SearchEvent, ItemNavHistory, Pane, SplitDirection, ViewId, Workspace}; @@ -1259,7 +1259,6 @@ impl CompletionsMenu { div().min_w(px(220.)).max_w(px(540.)).child( ListItem::new(mat.candidate_id) .inset(true) - .spacing(ListItemSpacing::Sparse) .selected(item_ix == selected_item) .on_click(cx.listener(move |editor, _event, cx| { cx.stop_propagation(); @@ -8449,6 +8448,12 @@ impl Editor { }) } + pub fn has_background_highlights(&self) -> bool { + self.background_highlights + .get(&TypeId::of::()) + .map_or(false, |(_, highlights)| !highlights.is_empty()) + } + pub fn background_highlights_in_range( &self, search_range: Range, @@ -8865,14 +8870,8 @@ impl Editor { .map(|a| a.to_string()); let telemetry = project.read(cx).client().telemetry().clone(); - let telemetry_settings = *TelemetrySettings::get_global(cx); - telemetry.report_copilot_event( - telemetry_settings, - suggestion_id, - suggestion_accepted, - file_extension, - ) + telemetry.report_copilot_event(suggestion_id, suggestion_accepted, file_extension, cx) } #[cfg(any(test, feature = "test-support"))] @@ -8910,7 +8909,6 @@ impl Editor { .raw_user_settings() .get("vim_mode") == Some(&serde_json::Value::Bool(true)); - let telemetry_settings = *TelemetrySettings::get_global(cx); let copilot_enabled = all_language_settings(file, cx).copilot_enabled(None, None); let copilot_enabled_for_language = self .buffer @@ -8920,12 +8918,12 @@ impl Editor { let telemetry = project.read(cx).client().telemetry().clone(); telemetry.report_editor_event( - telemetry_settings, file_extension, vim_mode, operation, copilot_enabled, copilot_enabled_for_language, + cx, ) } diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index 2b5c97bac5b1e067db5ff1640752c0bc8a9a489d..ab29f6c8b290de894b4528c50dd5f20bf5d748bf 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -8,6 +8,7 @@ use crate::{ hover_popover::{ self, hover_at, HOVER_POPOVER_GAP, MIN_POPOVER_CHARACTER_WIDTH, MIN_POPOVER_LINE_HEIGHT, }, + items::BufferSearchHighlights, link_go_to_definition::{ go_to_fetched_definition, go_to_fetched_type_definition, show_link_definition, update_go_to_definition_link, update_inlay_link_and_hover_points, GoToDefinitionTrigger, @@ -1275,7 +1276,7 @@ impl EditorElement { let background_ranges = self .editor .read(cx) - .background_highlight_row_ranges::( + .background_highlight_row_ranges::( start_anchor..end_anchor, &layout.position_map.snapshot, 50000, @@ -1966,7 +1967,7 @@ impl EditorElement { (is_singleton && scrollbar_settings.git_diff && snapshot.buffer_snapshot.has_git_diffs()) || // Selections - (is_singleton && scrollbar_settings.selections && !highlighted_ranges.is_empty()) + (is_singleton && scrollbar_settings.selections && editor.has_background_highlights::()) // Scrollmanager || editor.scroll_manager.scrollbars_visible() } diff --git a/crates/gpui/src/elements/list.rs b/crates/gpui/src/elements/list.rs index 364b610eee761f8cd076c39aa1206c6d97016b0b..2a47a16741cf67c0cefb8a094d2f9e506cacbdf4 100644 --- a/crates/gpui/src/elements/list.rs +++ b/crates/gpui/src/elements/list.rs @@ -1,7 +1,7 @@ use crate::{ - point, px, AnyElement, AvailableSpace, BorrowAppContext, Bounds, DispatchPhase, Element, - IntoElement, Pixels, Point, ScrollWheelEvent, Size, Style, StyleRefinement, Styled, - WindowContext, + point, px, AnyElement, AvailableSpace, BorrowAppContext, BorrowWindow, Bounds, ContentMask, + DispatchPhase, Element, IntoElement, Pixels, Point, ScrollWheelEvent, Size, Style, + StyleRefinement, Styled, WindowContext, }; use collections::VecDeque; use refineable::Refineable as _; @@ -317,7 +317,7 @@ impl Element for List { fn paint( &mut self, - bounds: crate::Bounds, + bounds: Bounds, _state: &mut Self::State, cx: &mut crate::WindowContext, ) { @@ -444,13 +444,15 @@ impl Element for List { new_items.append(cursor.suffix(&()), &()); // Paint the visible items - let mut item_origin = bounds.origin; - item_origin.y -= scroll_top.offset_in_item; - for item_element in &mut item_elements { - let item_height = item_element.measure(available_item_space, cx).height; - item_element.draw(item_origin, available_item_space, cx); - item_origin.y += item_height; - } + cx.with_content_mask(Some(ContentMask { bounds }), |cx| { + let mut item_origin = bounds.origin; + item_origin.y -= scroll_top.offset_in_item; + for item_element in &mut item_elements { + let item_height = item_element.measure(available_item_space, cx).height; + item_element.draw(item_origin, available_item_space, cx); + item_origin.y += item_height; + } + }); state.items = new_items; state.last_layout_bounds = Some(bounds); diff --git a/crates/gpui/src/platform/mac/shaders.metal b/crates/gpui/src/platform/mac/shaders.metal index aba01b9d5b059da1c1df55c0a01120d8be10775b..264fa55134bb39db7c45541434a4126afac87116 100644 --- a/crates/gpui/src/platform/mac/shaders.metal +++ b/crates/gpui/src/platform/mac/shaders.metal @@ -16,6 +16,7 @@ float gaussian(float x, float sigma); float2 erf(float2 x); float blur_along_x(float x, float y, float sigma, float corner, float2 half_size); +float4 over(float4 below, float4 above); struct QuadVertexOutput { float4 position [[position]]; @@ -108,21 +109,11 @@ fragment float4 quad_fragment(QuadFragmentInput input [[stage_in]], color = input.background_color; } else { float inset_distance = distance + border_width; - - // Decrease border's opacity as we move inside the background. - input.border_color.a *= 1. - saturate(0.5 - inset_distance); - - // Alpha-blend the border and the background. - float output_alpha = input.border_color.a + - input.background_color.a * (1. - input.border_color.a); - float3 premultiplied_border_rgb = - input.border_color.rgb * input.border_color.a; - float3 premultiplied_background_rgb = - input.background_color.rgb * input.background_color.a; - float3 premultiplied_output_rgb = - premultiplied_border_rgb + - premultiplied_background_rgb * (1. - input.border_color.a); - color = float4(premultiplied_output_rgb, output_alpha); + // Blend the border on top of the background and then linearly interpolate + // between the two as we slide inside the background. + float4 blended_border = over(input.background_color, input.border_color); + color = mix(blended_border, input.background_color, + saturate(0.5 - inset_distance)); } return color * float4(1., 1., 1., saturate(0.5 - distance)); @@ -653,3 +644,12 @@ float4 distance_from_clip_rect(float2 unit_vertex, Bounds_ScaledPixels bounds, position.y - clip_bounds.origin.y, clip_bounds.origin.y + clip_bounds.size.height - position.y); } + +float4 over(float4 below, float4 above) { + float4 result; + float alpha = above.a + below.a * (1.0 - above.a); + result.rgb = + (above.rgb * above.a + below.rgb * below.a * (1.0 - above.a)) / alpha; + result.a = alpha; + return result; +} diff --git a/crates/journal/src/journal.rs b/crates/journal/src/journal.rs index 4ed8da34b496a90412e859f7bd71e236cd578ccf..a1236297ed1e3f0af70ddc557994087304493c7c 100644 --- a/crates/journal/src/journal.rs +++ b/crates/journal/src/journal.rs @@ -1,6 +1,8 @@ use anyhow::Result; use chrono::{Datelike, Local, NaiveTime, Timelike}; -use gpui::{actions, AppContext, ViewContext}; +use editor::scroll::autoscroll::Autoscroll; +use editor::Editor; +use gpui::{actions, AppContext, ViewContext, WindowContext}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use settings::Settings; @@ -63,7 +65,7 @@ pub fn init(_: Arc, cx: &mut AppContext) { .detach(); } -pub fn new_journal_entry(app_state: Arc, cx: &mut AppContext) { +pub fn new_journal_entry(app_state: Arc, cx: &mut WindowContext) { let settings = JournalSettings::get_global(cx); let journal_dir = match journal_dir(settings.path.as_ref().unwrap()) { Some(journal_dir) => journal_dir, @@ -79,7 +81,7 @@ pub fn new_journal_entry(app_state: Arc, cx: &mut AppContext) { .join(format!("{:02}", now.month())); let entry_path = month_dir.join(format!("{:02}.md", now.day())); let now = now.time(); - let _entry_heading = heading_entry(now, &settings.hour_format); + let entry_heading = heading_entry(now, &settings.hour_format); let create_entry = cx.background_executor().spawn(async move { std::fs::create_dir_all(month_dir)?; @@ -93,31 +95,30 @@ pub fn new_journal_entry(app_state: Arc, cx: &mut AppContext) { cx.spawn(|mut cx| async move { let (journal_dir, entry_path) = create_entry.await?; let (workspace, _) = cx - .update(|cx| workspace::open_paths(&[journal_dir], &app_state, None, cx))? + .update(|_, cx| workspace::open_paths(&[journal_dir], &app_state, None, cx))? .await?; - let _opened = workspace + let opened = workspace .update(&mut cx, |workspace, cx| { workspace.open_paths(vec![entry_path], true, cx) })? .await; - // todo!("editor") - // if let Some(Some(Ok(item))) = opened.first() { - // if let Some(editor) = item.downcast::().map(|editor| editor.downgrade()) { - // editor.update(&mut cx, |editor, cx| { - // let len = editor.buffer().read(cx).len(cx); - // editor.change_selections(Some(Autoscroll::center()), cx, |s| { - // s.select_ranges([len..len]) - // }); - // if len > 0 { - // editor.insert("\n\n", cx); - // } - // editor.insert(&entry_heading, cx); - // editor.insert("\n\n", cx); - // })?; - // } - // } + if let Some(Some(Ok(item))) = opened.first() { + if let Some(editor) = item.downcast::().map(|editor| editor.downgrade()) { + editor.update(&mut cx, |editor, cx| { + let len = editor.buffer().read(cx).len(cx); + editor.change_selections(Some(Autoscroll::center()), cx, |s| { + s.select_ranges([len..len]) + }); + if len > 0 { + editor.insert("\n\n", cx); + } + editor.insert(&entry_heading, cx); + editor.insert("\n\n", cx); + })?; + } + } anyhow::Ok(()) }) diff --git a/crates/notifications/Cargo.toml b/crates/notifications/Cargo.toml index b04f30835c6750a575b8a6bb874140c3dea913f7..1425e079d6fcbb53cf45ab57850fefe19a495741 100644 --- a/crates/notifications/Cargo.toml +++ b/crates/notifications/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" publish = false [lib] -path = "src/notification_store2.rs" +path = "src/notification_store.rs" doctest = false [features] diff --git a/crates/notifications/src/notification_store2.rs b/crates/notifications/src/notification_store.rs similarity index 100% rename from crates/notifications/src/notification_store2.rs rename to crates/notifications/src/notification_store.rs diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index 8ab364e0c1ec78df405bbf43a8c8263206cd18cf..6f438098b718a72602e69b81339129e00fa8a3ba 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -30,7 +30,7 @@ use std::{ sync::Arc, }; use theme::ThemeSettings; -use ui::{prelude::*, v_stack, ContextMenu, IconElement, Label, ListItem}; +use ui::{prelude::*, v_stack, ContextMenu, IconElement, KeyBinding, Label, ListItem}; use unicase::UniCase; use util::{maybe, ResultExt, TryFutureExt}; use workspace::{ @@ -1540,7 +1540,20 @@ impl Render for ProjectPanel { } else { v_stack() .id("empty-project_panel") + .size_full() + .p_4() .track_focus(&self.focus_handle) + .child( + Button::new("open_project", "Open a project") + .style(ButtonStyle::Filled) + .full_width() + .key_binding(KeyBinding::for_action(&workspace::Open, cx)) + .on_click(cx.listener(|this, _, cx| { + this.workspace + .update(cx, |workspace, cx| workspace.open(&workspace::Open, cx)) + .log_err(); + })), + ) } } } diff --git a/crates/theme/src/themes/andromeda.rs b/crates/theme/src/themes/andromeda.rs index 327c6f668f7472f659cf72e4fe2f1300c496306b..effdfb85f97a0c9baa1d4b9881b6c89de9ec1245 100644 --- a/crates/theme/src/themes/andromeda.rs +++ b/crates/theme/src/themes/andromeda.rs @@ -20,7 +20,7 @@ pub fn andromeda() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x2b2f39ff).into()), - border_variant: Some(rgba(0x2b2f39ff).into()), + border_variant: Some(rgba(0x252931ff).into()), border_focused: Some(rgba(0x183a34ff).into()), border_selected: Some(rgba(0x183a34ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -59,7 +59,7 @@ pub fn andromeda() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf7f7f84c).into()), scrollbar_thumb_hover_background: Some(rgba(0x252931ff).into()), scrollbar_thumb_border: Some(rgba(0x252931ff).into()), - scrollbar_track_background: Some(rgba(0x1e2025ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x21232aff).into()), editor_foreground: Some(rgba(0xf7f7f8ff).into()), editor_background: Some(rgba(0x1e2025ff).into()), @@ -122,7 +122,7 @@ pub fn andromeda() -> UserThemeFamily { modified: Some(rgba(0xfee56dff).into()), modified_background: Some(rgba(0x5c5015ff).into()), modified_border: Some(rgba(0x796b26ff).into()), - predictive: Some(rgba(0x96df72ff).into()), + predictive: Some(rgba(0x315f70ff).into()), predictive_background: Some(rgba(0x194618ff).into()), predictive_border: Some(rgba(0x306129ff).into()), renamed: Some(rgba(0x11a793ff).into()), diff --git a/crates/theme/src/themes/atelier.rs b/crates/theme/src/themes/atelier.rs index 42756a8d3f4962f3861e3b1b8cd2e7702207b66b..2d05a6b65be1daa7353ef6bb4775725d864b5dca 100644 --- a/crates/theme/src/themes/atelier.rs +++ b/crates/theme/src/themes/atelier.rs @@ -21,7 +21,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x969585ff).into()), - border_variant: Some(rgba(0x969585ff).into()), + border_variant: Some(rgba(0xd1d0c6ff).into()), border_focused: Some(rgba(0xbbddc6ff).into()), border_selected: Some(rgba(0xbbddc6ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -60,7 +60,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x22221b4c).into()), scrollbar_thumb_hover_background: Some(rgba(0xd1d0c6ff).into()), scrollbar_thumb_border: Some(rgba(0xd1d0c6ff).into()), - scrollbar_track_background: Some(rgba(0xf4f3ecff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xedece5ff).into()), editor_foreground: Some(rgba(0x302f27ff).into()), editor_background: Some(rgba(0xf4f3ecff).into()), @@ -123,7 +123,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa59810ff).into()), modified_background: Some(rgba(0xf0e9d1ff).into()), modified_border: Some(rgba(0xe3d8adff).into()), - predictive: Some(rgba(0x7d9728ff).into()), + predictive: Some(rgba(0x879a72ff).into()), predictive_background: Some(rgba(0xe6e9d3ff).into()), predictive_border: Some(rgba(0xd2d8b1ff).into()), renamed: Some(rgba(0x38a166ff).into()), @@ -486,7 +486,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x665f5cff).into()), - border_variant: Some(rgba(0x665f5cff).into()), + border_variant: Some(rgba(0x3b3431ff).into()), border_focused: Some(rgba(0x192e5bff).into()), border_selected: Some(rgba(0x192e5bff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -525,7 +525,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf1efee4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x3b3431ff).into()), scrollbar_thumb_border: Some(rgba(0x3b3431ff).into()), - scrollbar_track_background: Some(rgba(0x1b1918ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x251f1dff).into()), editor_foreground: Some(rgba(0xe6e2e0ff).into()), editor_background: Some(rgba(0x1b1918ff).into()), @@ -588,7 +588,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xc38419ff).into()), modified_background: Some(rgba(0x371d0dff).into()), modified_border: Some(rgba(0x4f2f12ff).into()), - predictive: Some(rgba(0x7b9727ff).into()), + predictive: Some(rgba(0x8f5b71ff).into()), predictive_background: Some(rgba(0x1d2110ff).into()), predictive_border: Some(rgba(0x2e3516ff).into()), renamed: Some(rgba(0x417ee6ff).into()), @@ -951,7 +951,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x8b968eff).into()), - border_variant: Some(rgba(0x8b968eff).into()), + border_variant: Some(rgba(0xc8d1cbff).into()), border_focused: Some(rgba(0xbed4d6ff).into()), border_selected: Some(rgba(0xbed4d6ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -990,7 +990,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x171c194c).into()), scrollbar_thumb_hover_background: Some(rgba(0xc8d1cbff).into()), scrollbar_thumb_border: Some(rgba(0xc8d1cbff).into()), - scrollbar_track_background: Some(rgba(0xecf4eeff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xe5ede7ff).into()), editor_foreground: Some(rgba(0x232a25ff).into()), editor_background: Some(rgba(0xecf4eeff).into()), @@ -1053,7 +1053,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa07e3cff).into()), modified_background: Some(rgba(0xeee4d5ff).into()), modified_border: Some(rgba(0xdfcfb6ff).into()), - predictive: Some(rgba(0x499963ff).into()), + predictive: Some(rgba(0x76958cff).into()), predictive_background: Some(rgba(0xdaeadeff).into()), predictive_border: Some(rgba(0xbedac5ff).into()), renamed: Some(rgba(0x488c90ff).into()), @@ -1416,7 +1416,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x56505eff).into()), - border_variant: Some(rgba(0x56505eff).into()), + border_variant: Some(rgba(0x332f38ff).into()), border_focused: Some(rgba(0x222953ff).into()), border_selected: Some(rgba(0x222953ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -1455,7 +1455,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xefecf44c).into()), scrollbar_thumb_hover_background: Some(rgba(0x332f38ff).into()), scrollbar_thumb_border: Some(rgba(0x332f38ff).into()), - scrollbar_track_background: Some(rgba(0x19171cff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x201e24ff).into()), editor_foreground: Some(rgba(0xe2dfe7ff).into()), editor_background: Some(rgba(0x19171cff).into()), @@ -1518,7 +1518,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa06e3bff).into()), modified_background: Some(rgba(0x231a12ff).into()), modified_border: Some(rgba(0x392a1aff).into()), - predictive: Some(rgba(0x2c9292ff).into()), + predictive: Some(rgba(0x625887ff).into()), predictive_background: Some(rgba(0x132020ff).into()), predictive_border: Some(rgba(0x1a3434ff).into()), renamed: Some(rgba(0x576ddaff).into()), @@ -1881,7 +1881,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x5d5c4cff).into()), - border_variant: Some(rgba(0x5d5c4cff).into()), + border_variant: Some(rgba(0x3c3b31ff).into()), border_focused: Some(rgba(0x1c3927ff).into()), border_selected: Some(rgba(0x1c3927ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -1920,7 +1920,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf4f3ec4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x3c3b31ff).into()), scrollbar_thumb_border: Some(rgba(0x3c3b31ff).into()), - scrollbar_track_background: Some(rgba(0x22221bff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x2a2922ff).into()), editor_foreground: Some(rgba(0xe7e6dfff).into()), editor_background: Some(rgba(0x22221bff).into()), @@ -1983,7 +1983,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa59810ff).into()), modified_background: Some(rgba(0x25210dff).into()), modified_border: Some(rgba(0x3b3612ff).into()), - predictive: Some(rgba(0x7d9727ff).into()), + predictive: Some(rgba(0x5f724cff).into()), predictive_background: Some(rgba(0x1e2110ff).into()), predictive_border: Some(rgba(0x2f3516ff).into()), renamed: Some(rgba(0x37a166ff).into()), @@ -2346,7 +2346,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x5c6485ff).into()), - border_variant: Some(rgba(0x5c6485ff).into()), + border_variant: Some(rgba(0x363f62ff).into()), border_focused: Some(rgba(0x203348ff).into()), border_selected: Some(rgba(0x203348ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -2385,7 +2385,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf5f7ff4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x363f62ff).into()), scrollbar_thumb_border: Some(rgba(0x363f62ff).into()), - scrollbar_track_background: Some(rgba(0x202746ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x252d4fff).into()), editor_foreground: Some(rgba(0xdfe2f1ff).into()), editor_background: Some(rgba(0x202746ff).into()), @@ -2448,7 +2448,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xc08b31ff).into()), modified_background: Some(rgba(0x311e11ff).into()), modified_border: Some(rgba(0x4b3218ff).into()), - predictive: Some(rgba(0xac973aff).into()), + predictive: Some(rgba(0x58709aff).into()), predictive_background: Some(rgba(0x252113ff).into()), predictive_border: Some(rgba(0x3d351bff).into()), renamed: Some(rgba(0x3e8fd0ff).into()), @@ -2811,7 +2811,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x9a9fb6ff).into()), - border_variant: Some(rgba(0x9a9fb6ff).into()), + border_variant: Some(rgba(0xccd0e1ff).into()), border_focused: Some(rgba(0xc2d5efff).into()), border_selected: Some(rgba(0xc2d5efff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -2850,7 +2850,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x2027464c).into()), scrollbar_thumb_hover_background: Some(rgba(0xccd0e1ff).into()), scrollbar_thumb_border: Some(rgba(0xccd0e1ff).into()), - scrollbar_track_background: Some(rgba(0xf5f7ffff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xe9ebf7ff).into()), editor_foreground: Some(rgba(0x293256ff).into()), editor_background: Some(rgba(0xf5f7ffff).into()), @@ -2913,7 +2913,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xc08b31ff).into()), modified_background: Some(rgba(0xf6e6d4ff).into()), modified_border: Some(rgba(0xeed4b3ff).into()), - predictive: Some(rgba(0xac973aff).into()), + predictive: Some(rgba(0x8599beff).into()), predictive_background: Some(rgba(0xf1e9d6ff).into()), predictive_border: Some(rgba(0xe4d8b7ff).into()), renamed: Some(rgba(0x3f8fd0ff).into()), @@ -3276,7 +3276,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x6c695cff).into()), - border_variant: Some(rgba(0x6c695cff).into()), + border_variant: Some(rgba(0x3b3933ff).into()), border_focused: Some(rgba(0x263056ff).into()), border_selected: Some(rgba(0x263056ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -3315,7 +3315,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xfefbec4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x3b3933ff).into()), scrollbar_thumb_border: Some(rgba(0x3b3933ff).into()), - scrollbar_track_background: Some(rgba(0x20201dff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x252521ff).into()), editor_foreground: Some(rgba(0xe8e4cfff).into()), editor_background: Some(rgba(0x20201dff).into()), @@ -3378,7 +3378,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xae9515ff).into()), modified_background: Some(rgba(0x2a200eff).into()), modified_border: Some(rgba(0x413513ff).into()), - predictive: Some(rgba(0x60ac3aff).into()), + predictive: Some(rgba(0x9c6262ff).into()), predictive_background: Some(rgba(0x1a2413ff).into()), predictive_border: Some(rgba(0x273c1bff).into()), renamed: Some(rgba(0x6684e0ff).into()), @@ -3741,7 +3741,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x5c6c5cff).into()), - border_variant: Some(rgba(0x5c6c5cff).into()), + border_variant: Some(rgba(0x333b33ff).into()), border_focused: Some(rgba(0x102668ff).into()), border_selected: Some(rgba(0x102668ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -3780,7 +3780,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf4fbf44c).into()), scrollbar_thumb_hover_background: Some(rgba(0x333b33ff).into()), scrollbar_thumb_border: Some(rgba(0x333b33ff).into()), - scrollbar_track_background: Some(rgba(0x131513ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x1d201dff).into()), editor_foreground: Some(rgba(0xcfe8cfff).into()), editor_background: Some(rgba(0x131513ff).into()), @@ -3843,7 +3843,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0x98981cff).into()), modified_background: Some(rgba(0x22210fff).into()), modified_border: Some(rgba(0x373614ff).into()), - predictive: Some(rgba(0x2ba32aff).into()), + predictive: Some(rgba(0x00788bff).into()), predictive_background: Some(rgba(0x142310ff).into()), predictive_border: Some(rgba(0x1b3917ff).into()), renamed: Some(rgba(0x3e62f4ff).into()), @@ -4206,7 +4206,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x8f8b96ff).into()), - border_variant: Some(rgba(0x8f8b96ff).into()), + border_variant: Some(rgba(0xcbc8d1ff).into()), border_focused: Some(rgba(0xc9c8f3ff).into()), border_selected: Some(rgba(0xc9c8f3ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -4245,7 +4245,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x19171c4c).into()), scrollbar_thumb_hover_background: Some(rgba(0xcbc8d1ff).into()), scrollbar_thumb_border: Some(rgba(0xcbc8d1ff).into()), - scrollbar_track_background: Some(rgba(0xefecf4ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xe8e5edff).into()), editor_foreground: Some(rgba(0x26232aff).into()), editor_background: Some(rgba(0xefecf4ff).into()), @@ -4308,7 +4308,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa06e3cff).into()), modified_background: Some(rgba(0xeee0d5ff).into()), modified_border: Some(rgba(0xe0c9b5ff).into()), - predictive: Some(rgba(0x2c9292ff).into()), + predictive: Some(rgba(0x887fafff).into()), predictive_background: Some(rgba(0xd7e9e8ff).into()), predictive_border: Some(rgba(0xb9d7d6ff).into()), renamed: Some(rgba(0x586ddaff).into()), @@ -4671,7 +4671,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x564e4eff).into()), - border_variant: Some(rgba(0x564e4eff).into()), + border_variant: Some(rgba(0x352f2fff).into()), border_focused: Some(rgba(0x2c2b45ff).into()), border_selected: Some(rgba(0x2c2b45ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -4710,7 +4710,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf4ecec4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x352f2fff).into()), scrollbar_thumb_border: Some(rgba(0x352f2fff).into()), - scrollbar_track_background: Some(rgba(0x1b1818ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x231f1fff).into()), editor_foreground: Some(rgba(0xe7dfdfff).into()), editor_background: Some(rgba(0x1b1818ff).into()), @@ -4773,7 +4773,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa06e3bff).into()), modified_background: Some(rgba(0x231a12ff).into()), modified_border: Some(rgba(0x392a1aff).into()), - predictive: Some(rgba(0x4b8b8bff).into()), + predictive: Some(rgba(0x795369ff).into()), predictive_background: Some(rgba(0x161f1fff).into()), predictive_border: Some(rgba(0x203232ff).into()), renamed: Some(rgba(0x7272caff).into()), @@ -5136,7 +5136,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x675b67ff).into()), - border_variant: Some(rgba(0x675b67ff).into()), + border_variant: Some(rgba(0x393239ff).into()), border_focused: Some(rgba(0x1a2961ff).into()), border_selected: Some(rgba(0x1a2961ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -5175,7 +5175,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf7f3f74c).into()), scrollbar_thumb_hover_background: Some(rgba(0x393239ff).into()), scrollbar_thumb_border: Some(rgba(0x393239ff).into()), - scrollbar_track_background: Some(rgba(0x1b181bff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x231e23ff).into()), editor_foreground: Some(rgba(0xd8cad8ff).into()), editor_background: Some(rgba(0x1b181bff).into()), @@ -5238,7 +5238,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xbb8a36ff).into()), modified_background: Some(rgba(0x2d1e12ff).into()), modified_border: Some(rgba(0x463219ff).into()), - predictive: Some(rgba(0x918b3bff).into()), + predictive: Some(rgba(0x765990ff).into()), predictive_background: Some(rgba(0x211f12ff).into()), predictive_border: Some(rgba(0x34321bff).into()), renamed: Some(rgba(0x526aebff).into()), @@ -5601,7 +5601,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x4f6b78ff).into()), - border_variant: Some(rgba(0x4f6b78ff).into()), + border_variant: Some(rgba(0x2c3b42ff).into()), border_focused: Some(rgba(0x1a2f3cff).into()), border_selected: Some(rgba(0x1a2f3cff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -5640,7 +5640,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xebf8ff4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x2c3b42ff).into()), scrollbar_thumb_border: Some(rgba(0x2c3b42ff).into()), - scrollbar_track_background: Some(rgba(0x161b1dff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x1b2327ff).into()), editor_foreground: Some(rgba(0xc1e4f6ff).into()), editor_background: Some(rgba(0x161b1dff).into()), @@ -5703,7 +5703,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0x8a8a11ff).into()), modified_background: Some(rgba(0x201f0cff).into()), modified_border: Some(rgba(0x333211ff).into()), - predictive: Some(rgba(0x568c3bff).into()), + predictive: Some(rgba(0x427088ff).into()), predictive_background: Some(rgba(0x171f12ff).into()), predictive_border: Some(rgba(0x23321bff).into()), renamed: Some(rgba(0x277fadff).into()), @@ -6066,7 +6066,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xaaa3a1ff).into()), - border_variant: Some(rgba(0xaaa3a1ff).into()), + border_variant: Some(rgba(0xd6d1cfff).into()), border_focused: Some(rgba(0xc6cef7ff).into()), border_selected: Some(rgba(0xc6cef7ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -6105,7 +6105,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x1b19184c).into()), scrollbar_thumb_hover_background: Some(rgba(0xd6d1cfff).into()), scrollbar_thumb_border: Some(rgba(0xd6d1cfff).into()), - scrollbar_track_background: Some(rgba(0xf1efeeff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xebe8e6ff).into()), editor_foreground: Some(rgba(0x2c2421ff).into()), editor_background: Some(rgba(0xf1efeeff).into()), @@ -6168,7 +6168,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xc3841aff).into()), modified_background: Some(rgba(0xf8e5d1ff).into()), modified_border: Some(rgba(0xf0d1adff).into()), - predictive: Some(rgba(0x7b9728ff).into()), + predictive: Some(rgba(0xbe899eff).into()), predictive_background: Some(rgba(0xe5e9d3ff).into()), predictive_border: Some(rgba(0xd1d8b1ff).into()), renamed: Some(rgba(0x417ee6ff).into()), @@ -6531,7 +6531,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xa8a48eff).into()), - border_variant: Some(rgba(0xa8a48eff).into()), + border_variant: Some(rgba(0xd7d3beff).into()), border_focused: Some(rgba(0xcdd1f5ff).into()), border_selected: Some(rgba(0xcdd1f5ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -6570,7 +6570,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x20201d4c).into()), scrollbar_thumb_hover_background: Some(rgba(0xd7d3beff).into()), scrollbar_thumb_border: Some(rgba(0xd7d3beff).into()), - scrollbar_track_background: Some(rgba(0xfefbecff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xf2eedcff).into()), editor_foreground: Some(rgba(0x292824ff).into()), editor_background: Some(rgba(0xfefbecff).into()), @@ -6633,7 +6633,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xae9515ff).into()), modified_background: Some(rgba(0xf2e8d1ff).into()), modified_border: Some(rgba(0xe7d7aeff).into()), - predictive: Some(rgba(0x61ac3aff).into()), + predictive: Some(rgba(0xc88a8aff).into()), predictive_background: Some(rgba(0xe0eed6ff).into()), predictive_border: Some(rgba(0xc9e1b7ff).into()), renamed: Some(rgba(0x6784e0ff).into()), @@ -6996,7 +6996,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x8e8989ff).into()), - border_variant: Some(rgba(0x8e8989ff).into()), + border_variant: Some(rgba(0xcfc7c7ff).into()), border_focused: Some(rgba(0xcecaecff).into()), border_selected: Some(rgba(0xcecaecff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -7035,7 +7035,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x1b18184c).into()), scrollbar_thumb_hover_background: Some(rgba(0xcfc7c7ff).into()), scrollbar_thumb_border: Some(rgba(0xcfc7c7ff).into()), - scrollbar_track_background: Some(rgba(0xf4ececff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xede5e5ff).into()), editor_foreground: Some(rgba(0x292424ff).into()), editor_background: Some(rgba(0xf4ececff).into()), @@ -7098,7 +7098,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa06e3cff).into()), modified_background: Some(rgba(0xeee0d5ff).into()), modified_border: Some(rgba(0xe0c9b5ff).into()), - predictive: Some(rgba(0x4c8b8bff).into()), + predictive: Some(rgba(0xa27a91ff).into()), predictive_background: Some(rgba(0xdae7e7ff).into()), predictive_border: Some(rgba(0xbfd4d4ff).into()), renamed: Some(rgba(0x7372caff).into()), @@ -7461,7 +7461,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x8ea88eff).into()), - border_variant: Some(rgba(0x8ea88eff).into()), + border_variant: Some(rgba(0xbed7beff).into()), border_focused: Some(rgba(0xc9c4fdff).into()), border_selected: Some(rgba(0xc9c4fdff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -7500,7 +7500,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x1315134c).into()), scrollbar_thumb_hover_background: Some(rgba(0xbed7beff).into()), scrollbar_thumb_border: Some(rgba(0xbed7beff).into()), - scrollbar_track_background: Some(rgba(0xf4fbf4ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xdff0dfff).into()), editor_foreground: Some(rgba(0x242924ff).into()), editor_background: Some(rgba(0xf4fbf4ff).into()), @@ -7563,7 +7563,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0x98981dff).into()), modified_background: Some(rgba(0xede9d2ff).into()), modified_border: Some(rgba(0xddd8afff).into()), - predictive: Some(rgba(0x2ba32bff).into()), + predictive: Some(rgba(0x00a2b5ff).into()), predictive_background: Some(rgba(0xd9edd4ff).into()), predictive_border: Some(rgba(0xbbdeb2ff).into()), renamed: Some(rgba(0x3f62f4ff).into()), @@ -7926,7 +7926,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x505e55ff).into()), - border_variant: Some(rgba(0x505e55ff).into()), + border_variant: Some(rgba(0x2f3832ff).into()), border_focused: Some(rgba(0x1f3233ff).into()), border_selected: Some(rgba(0x1f3233ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -7965,7 +7965,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xecf4ee4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x2f3832ff).into()), scrollbar_thumb_border: Some(rgba(0x2f3832ff).into()), - scrollbar_track_background: Some(rgba(0x171c19ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x1e2420ff).into()), editor_foreground: Some(rgba(0xdfe7e2ff).into()), editor_background: Some(rgba(0x171c19ff).into()), @@ -8028,7 +8028,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xa07e3bff).into()), modified_background: Some(rgba(0x231d12ff).into()), modified_border: Some(rgba(0x392e1aff).into()), - predictive: Some(rgba(0x489963ff).into()), + predictive: Some(rgba(0x506d66ff).into()), predictive_background: Some(rgba(0x162119ff).into()), predictive_border: Some(rgba(0x203626ff).into()), renamed: Some(rgba(0x478c90ff).into()), @@ -8391,7 +8391,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xad9dadff).into()), - border_variant: Some(rgba(0xad9dadff).into()), + border_variant: Some(rgba(0xcdbecdff).into()), border_focused: Some(rgba(0xcac7faff).into()), border_selected: Some(rgba(0xcac7faff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -8430,7 +8430,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x1b181b4c).into()), scrollbar_thumb_hover_background: Some(rgba(0xcdbecdff).into()), scrollbar_thumb_border: Some(rgba(0xcdbecdff).into()), - scrollbar_track_background: Some(rgba(0xf7f3f7ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xe5dce5ff).into()), editor_foreground: Some(rgba(0x292329ff).into()), editor_background: Some(rgba(0xf7f3f7ff).into()), @@ -8493,7 +8493,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0xbb8a36ff).into()), modified_background: Some(rgba(0xf5e6d5ff).into()), modified_border: Some(rgba(0xebd3b5ff).into()), - predictive: Some(rgba(0x918b3cff).into()), + predictive: Some(rgba(0xa587bfff).into()), predictive_background: Some(rgba(0xeae6d6ff).into()), predictive_border: Some(rgba(0xd9d4b6ff).into()), renamed: Some(rgba(0x526aebff).into()), @@ -8856,7 +8856,7 @@ pub fn atelier() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x80a4b6ff).into()), - border_variant: Some(rgba(0x80a4b6ff).into()), + border_variant: Some(rgba(0xb0d3e5ff).into()), border_focused: Some(rgba(0xbacfe1ff).into()), border_selected: Some(rgba(0xbacfe1ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -8895,7 +8895,7 @@ pub fn atelier() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x161b1d4c).into()), scrollbar_thumb_hover_background: Some(rgba(0xb0d3e5ff).into()), scrollbar_thumb_border: Some(rgba(0xb0d3e5ff).into()), - scrollbar_track_background: Some(rgba(0xebf8ffff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xd3edfaff).into()), editor_foreground: Some(rgba(0x1f292eff).into()), editor_background: Some(rgba(0xebf8ffff).into()), @@ -8958,7 +8958,7 @@ pub fn atelier() -> UserThemeFamily { modified: Some(rgba(0x8a8a11ff).into()), modified_background: Some(rgba(0xeae6d0ff).into()), modified_border: Some(rgba(0xd8d3abff).into()), - predictive: Some(rgba(0x578c3cff).into()), + predictive: Some(rgba(0x6a97b2ff).into()), predictive_background: Some(rgba(0xdde7d5ff).into()), predictive_border: Some(rgba(0xc2d5b6ff).into()), renamed: Some(rgba(0x277fadff).into()), diff --git a/crates/theme/src/themes/ayu.rs b/crates/theme/src/themes/ayu.rs index 63d8711d5702ef06647d46f0f927c1ab42477422..a0402825c1a1eaf5e6f91986c47505c68772c743 100644 --- a/crates/theme/src/themes/ayu.rs +++ b/crates/theme/src/themes/ayu.rs @@ -21,7 +21,7 @@ pub fn ayu() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x3f4043ff).into()), - border_variant: Some(rgba(0x3f4043ff).into()), + border_variant: Some(rgba(0x2d2f34ff).into()), border_focused: Some(rgba(0x1b4a6eff).into()), border_selected: Some(rgba(0x1b4a6eff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -60,7 +60,7 @@ pub fn ayu() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xbfbdb64c).into()), scrollbar_thumb_hover_background: Some(rgba(0x2d2f34ff).into()), scrollbar_thumb_border: Some(rgba(0x2d2f34ff).into()), - scrollbar_track_background: Some(rgba(0x0d1017ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x1b1e24ff).into()), editor_foreground: Some(rgba(0xbfbdb6ff).into()), editor_background: Some(rgba(0x0d1017ff).into()), @@ -123,7 +123,7 @@ pub fn ayu() -> UserThemeFamily { modified: Some(rgba(0xfeb454ff).into()), modified_background: Some(rgba(0x572916ff).into()), modified_border: Some(rgba(0x754221ff).into()), - predictive: Some(rgba(0xaad84cff).into()), + predictive: Some(rgba(0x5b728cff).into()), predictive_background: Some(rgba(0x294113ff).into()), predictive_border: Some(rgba(0x405c1dff).into()), renamed: Some(rgba(0x5ac2feff).into()), @@ -465,7 +465,7 @@ pub fn ayu() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xcfd1d2ff).into()), - border_variant: Some(rgba(0xcfd1d2ff).into()), + border_variant: Some(rgba(0xdfe0e1ff).into()), border_focused: Some(rgba(0xc4daf6ff).into()), border_selected: Some(rgba(0xc4daf6ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -504,7 +504,7 @@ pub fn ayu() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x5c61664c).into()), scrollbar_thumb_hover_background: Some(rgba(0xdfe0e1ff).into()), scrollbar_thumb_border: Some(rgba(0xdfe0e1ff).into()), - scrollbar_track_background: Some(rgba(0xfcfcfcff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xefeff0ff).into()), editor_foreground: Some(rgba(0x5c6166ff).into()), editor_background: Some(rgba(0xfcfcfcff).into()), @@ -567,7 +567,7 @@ pub fn ayu() -> UserThemeFamily { modified: Some(rgba(0xf1ae4aff).into()), modified_background: Some(rgba(0xffeedaff).into()), modified_border: Some(rgba(0xffe1beff).into()), - predictive: Some(rgba(0x86b305ff).into()), + predictive: Some(rgba(0x9eb9d3ff).into()), predictive_background: Some(rgba(0xe9efd2ff).into()), predictive_border: Some(rgba(0xd7e3aeff).into()), renamed: Some(rgba(0x3b9ee5ff).into()), @@ -909,7 +909,7 @@ pub fn ayu() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x53565dff).into()), - border_variant: Some(rgba(0x53565dff).into()), + border_variant: Some(rgba(0x43464fff).into()), border_focused: Some(rgba(0x24556fff).into()), border_selected: Some(rgba(0x24556fff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -948,7 +948,7 @@ pub fn ayu() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xcccac24c).into()), scrollbar_thumb_hover_background: Some(rgba(0x43464fff).into()), scrollbar_thumb_border: Some(rgba(0x43464fff).into()), - scrollbar_track_background: Some(rgba(0x242936ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x323641ff).into()), editor_foreground: Some(rgba(0xcccac2ff).into()), editor_background: Some(rgba(0x242936ff).into()), @@ -1011,7 +1011,7 @@ pub fn ayu() -> UserThemeFamily { modified: Some(rgba(0xfed073ff).into()), modified_background: Some(rgba(0x584018ff).into()), modified_border: Some(rgba(0x765a29ff).into()), - predictive: Some(rgba(0xd5fe80ff).into()), + predictive: Some(rgba(0x6d839bff).into()), predictive_background: Some(rgba(0x426118ff).into()), predictive_border: Some(rgba(0x5d7e2cff).into()), renamed: Some(rgba(0x73cffeff).into()), diff --git a/crates/theme/src/themes/gruvbox.rs b/crates/theme/src/themes/gruvbox.rs index 7bc8ef806492d3d8432337556cb068e13e92097a..b6b76bf47207918e289470471f715d2cfbfc1725 100644 --- a/crates/theme/src/themes/gruvbox.rs +++ b/crates/theme/src/themes/gruvbox.rs @@ -21,7 +21,7 @@ pub fn gruvbox() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xc9b99aff).into()), - border_variant: Some(rgba(0xc9b99aff).into()), + border_variant: Some(rgba(0xddcca7ff).into()), border_focused: Some(rgba(0xaec6cdff).into()), border_selected: Some(rgba(0xaec6cdff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -60,7 +60,7 @@ pub fn gruvbox() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x2828284c).into()), scrollbar_thumb_hover_background: Some(rgba(0xddcca7ff).into()), scrollbar_thumb_border: Some(rgba(0xddcca7ff).into()), - scrollbar_track_background: Some(rgba(0xf9f5d7ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xefe2bcff).into()), editor_foreground: Some(rgba(0x282828ff).into()), editor_background: Some(rgba(0xf9f5d7ff).into()), @@ -123,7 +123,7 @@ pub fn gruvbox() -> UserThemeFamily { modified: Some(rgba(0xb57616ff).into()), modified_background: Some(rgba(0xf5e2d0ff).into()), modified_border: Some(rgba(0xebccabff).into()), - predictive: Some(rgba(0x797410ff).into()), + predictive: Some(rgba(0x7d9881ff).into()), predictive_background: Some(rgba(0xe5e1ceff).into()), predictive_border: Some(rgba(0xd1cba8ff).into()), renamed: Some(rgba(0x0b6678ff).into()), @@ -472,7 +472,7 @@ pub fn gruvbox() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x5b534dff).into()), - border_variant: Some(rgba(0x5b534dff).into()), + border_variant: Some(rgba(0x494340ff).into()), border_focused: Some(rgba(0x303a36ff).into()), border_selected: Some(rgba(0x303a36ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -511,7 +511,7 @@ pub fn gruvbox() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xfbf1c74c).into()), scrollbar_thumb_hover_background: Some(rgba(0x494340ff).into()), scrollbar_thumb_border: Some(rgba(0x494340ff).into()), - scrollbar_track_background: Some(rgba(0x32302fff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x393634ff).into()), editor_foreground: Some(rgba(0xebdbb2ff).into()), editor_background: Some(rgba(0x32302fff).into()), @@ -574,7 +574,7 @@ pub fn gruvbox() -> UserThemeFamily { modified: Some(rgba(0xf9bd30ff).into()), modified_background: Some(rgba(0x582f10ff).into()), modified_border: Some(rgba(0x754916ff).into()), - predictive: Some(rgba(0xb8bb27ff).into()), + predictive: Some(rgba(0x717363ff).into()), predictive_background: Some(rgba(0x332b11ff).into()), predictive_border: Some(rgba(0x4a4516ff).into()), renamed: Some(rgba(0x83a598ff).into()), @@ -923,7 +923,7 @@ pub fn gruvbox() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xc9b99aff).into()), - border_variant: Some(rgba(0xc9b99aff).into()), + border_variant: Some(rgba(0xddcca7ff).into()), border_focused: Some(rgba(0xaec6cdff).into()), border_selected: Some(rgba(0xaec6cdff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -962,7 +962,7 @@ pub fn gruvbox() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x2828284c).into()), scrollbar_thumb_hover_background: Some(rgba(0xddcca7ff).into()), scrollbar_thumb_border: Some(rgba(0xddcca7ff).into()), - scrollbar_track_background: Some(rgba(0xfbf1c7ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xefe1b8ff).into()), editor_foreground: Some(rgba(0x282828ff).into()), editor_background: Some(rgba(0xfbf1c7ff).into()), @@ -1025,7 +1025,7 @@ pub fn gruvbox() -> UserThemeFamily { modified: Some(rgba(0xb57616ff).into()), modified_background: Some(rgba(0xf5e2d0ff).into()), modified_border: Some(rgba(0xebccabff).into()), - predictive: Some(rgba(0x797410ff).into()), + predictive: Some(rgba(0x7d9881ff).into()), predictive_background: Some(rgba(0xe5e1ceff).into()), predictive_border: Some(rgba(0xd1cba8ff).into()), renamed: Some(rgba(0x0b6678ff).into()), @@ -1374,7 +1374,7 @@ pub fn gruvbox() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x5b534dff).into()), - border_variant: Some(rgba(0x5b534dff).into()), + border_variant: Some(rgba(0x494340ff).into()), border_focused: Some(rgba(0x303a36ff).into()), border_selected: Some(rgba(0x303a36ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -1413,7 +1413,7 @@ pub fn gruvbox() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xfbf1c74c).into()), scrollbar_thumb_hover_background: Some(rgba(0x494340ff).into()), scrollbar_thumb_border: Some(rgba(0x494340ff).into()), - scrollbar_track_background: Some(rgba(0x282828ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x373432ff).into()), editor_foreground: Some(rgba(0xebdbb2ff).into()), editor_background: Some(rgba(0x282828ff).into()), @@ -1476,7 +1476,7 @@ pub fn gruvbox() -> UserThemeFamily { modified: Some(rgba(0xf9bd30ff).into()), modified_background: Some(rgba(0x582f10ff).into()), modified_border: Some(rgba(0x754916ff).into()), - predictive: Some(rgba(0xb8bb27ff).into()), + predictive: Some(rgba(0x717363ff).into()), predictive_background: Some(rgba(0x332b11ff).into()), predictive_border: Some(rgba(0x4a4516ff).into()), renamed: Some(rgba(0x83a598ff).into()), @@ -1825,7 +1825,7 @@ pub fn gruvbox() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xc9b99aff).into()), - border_variant: Some(rgba(0xc9b99aff).into()), + border_variant: Some(rgba(0xddcca7ff).into()), border_focused: Some(rgba(0xaec6cdff).into()), border_selected: Some(rgba(0xaec6cdff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -1864,7 +1864,7 @@ pub fn gruvbox() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x2828284c).into()), scrollbar_thumb_hover_background: Some(rgba(0xddcca7ff).into()), scrollbar_thumb_border: Some(rgba(0xddcca7ff).into()), - scrollbar_track_background: Some(rgba(0xf2e5bcff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xeddeb5ff).into()), editor_foreground: Some(rgba(0x282828ff).into()), editor_background: Some(rgba(0xf2e5bcff).into()), @@ -1927,7 +1927,7 @@ pub fn gruvbox() -> UserThemeFamily { modified: Some(rgba(0xb57616ff).into()), modified_background: Some(rgba(0xf5e2d0ff).into()), modified_border: Some(rgba(0xebccabff).into()), - predictive: Some(rgba(0x797410ff).into()), + predictive: Some(rgba(0x7d9881ff).into()), predictive_background: Some(rgba(0xe5e1ceff).into()), predictive_border: Some(rgba(0xd1cba8ff).into()), renamed: Some(rgba(0x0b6678ff).into()), @@ -2276,7 +2276,7 @@ pub fn gruvbox() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x5b534dff).into()), - border_variant: Some(rgba(0x5b534dff).into()), + border_variant: Some(rgba(0x494340ff).into()), border_focused: Some(rgba(0x303a36ff).into()), border_selected: Some(rgba(0x303a36ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -2315,7 +2315,7 @@ pub fn gruvbox() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xfbf1c74c).into()), scrollbar_thumb_hover_background: Some(rgba(0x494340ff).into()), scrollbar_thumb_border: Some(rgba(0x494340ff).into()), - scrollbar_track_background: Some(rgba(0x1d2021ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x343130ff).into()), editor_foreground: Some(rgba(0xebdbb2ff).into()), editor_background: Some(rgba(0x1d2021ff).into()), @@ -2378,7 +2378,7 @@ pub fn gruvbox() -> UserThemeFamily { modified: Some(rgba(0xf9bd30ff).into()), modified_background: Some(rgba(0x582f10ff).into()), modified_border: Some(rgba(0x754916ff).into()), - predictive: Some(rgba(0xb8bb27ff).into()), + predictive: Some(rgba(0x717363ff).into()), predictive_background: Some(rgba(0x332b11ff).into()), predictive_border: Some(rgba(0x4a4516ff).into()), renamed: Some(rgba(0x83a598ff).into()), diff --git a/crates/theme/src/themes/one.rs b/crates/theme/src/themes/one.rs index 0447306a2cb0f1d873655c333dda3a3032269eeb..c941fb294ddb32fd5638ee1ff92fe7a080121d4b 100644 --- a/crates/theme/src/themes/one.rs +++ b/crates/theme/src/themes/one.rs @@ -21,7 +21,7 @@ pub fn one() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xc9c9caff).into()), - border_variant: Some(rgba(0xc9c9caff).into()), + border_variant: Some(rgba(0xdfdfe0ff).into()), border_focused: Some(rgba(0xcbcdf6ff).into()), border_selected: Some(rgba(0xcbcdf6ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -60,7 +60,7 @@ pub fn one() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x383a414c).into()), scrollbar_thumb_hover_background: Some(rgba(0xdfdfe0ff).into()), scrollbar_thumb_border: Some(rgba(0xdfdfe0ff).into()), - scrollbar_track_background: Some(rgba(0xfafafaff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xeeeeeeff).into()), editor_foreground: Some(rgba(0x383a41ff).into()), editor_background: Some(rgba(0xfafafaff).into()), @@ -123,7 +123,7 @@ pub fn one() -> UserThemeFamily { modified: Some(rgba(0xdec184ff).into()), modified_background: Some(rgba(0xfaf2e6ff).into()), modified_border: Some(rgba(0xf5e8d2ff).into()), - predictive: Some(rgba(0x669f59ff).into()), + predictive: Some(rgba(0x9c9fc7ff).into()), predictive_background: Some(rgba(0xe0ebdcff).into()), predictive_border: Some(rgba(0xc8dcc1ff).into()), renamed: Some(rgba(0x5c79e2ff).into()), @@ -472,7 +472,7 @@ pub fn one() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x464b57ff).into()), - border_variant: Some(rgba(0x464b57ff).into()), + border_variant: Some(rgba(0x363c46ff).into()), border_focused: Some(rgba(0x293c5bff).into()), border_selected: Some(rgba(0x293c5bff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -511,7 +511,7 @@ pub fn one() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xc8ccd44c).into()), scrollbar_thumb_hover_background: Some(rgba(0x363c46ff).into()), scrollbar_thumb_border: Some(rgba(0x363c46ff).into()), - scrollbar_track_background: Some(rgba(0x282c34ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x2e333cff).into()), editor_foreground: Some(rgba(0xacb2beff).into()), editor_background: Some(rgba(0x282c34ff).into()), @@ -574,7 +574,7 @@ pub fn one() -> UserThemeFamily { modified: Some(rgba(0xdec184ff).into()), modified_background: Some(rgba(0x41331dff).into()), modified_border: Some(rgba(0x5d4c2fff).into()), - predictive: Some(rgba(0xa1c181ff).into()), + predictive: Some(rgba(0x5b6b88ff).into()), predictive_background: Some(rgba(0x222e1dff).into()), predictive_border: Some(rgba(0x38482fff).into()), renamed: Some(rgba(0x74ade8ff).into()), diff --git a/crates/theme/src/themes/rose_pine.rs b/crates/theme/src/themes/rose_pine.rs index c5c57342ec0104db28ec9fc7007170176c7ea9d0..59b8a924377b6f105e8610717935391f1f2c0682 100644 --- a/crates/theme/src/themes/rose_pine.rs +++ b/crates/theme/src/themes/rose_pine.rs @@ -21,7 +21,7 @@ pub fn rose_pine() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0xdcd6d5ff).into()), - border_variant: Some(rgba(0xdcd6d5ff).into()), + border_variant: Some(rgba(0xe5e0dfff).into()), border_focused: Some(rgba(0xc3d7dbff).into()), border_selected: Some(rgba(0xc3d7dbff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -60,7 +60,7 @@ pub fn rose_pine() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x5752794c).into()), scrollbar_thumb_hover_background: Some(rgba(0xe5e0dfff).into()), scrollbar_thumb_border: Some(rgba(0xe5e0dfff).into()), - scrollbar_track_background: Some(rgba(0xfaf4edff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xfdf8f1ff).into()), editor_foreground: Some(rgba(0x575279ff).into()), editor_background: Some(rgba(0xfaf4edff).into()), @@ -123,7 +123,7 @@ pub fn rose_pine() -> UserThemeFamily { modified: Some(rgba(0xe99d35ff).into()), modified_background: Some(rgba(0xffebd6ff).into()), modified_border: Some(rgba(0xffdab7ff).into()), - predictive: Some(rgba(0x3eaa8eff).into()), + predictive: Some(rgba(0xa2acbeff).into()), predictive_background: Some(rgba(0xdbeee7ff).into()), predictive_border: Some(rgba(0xbee0d5ff).into()), renamed: Some(rgba(0x57949fff).into()), @@ -479,7 +479,7 @@ pub fn rose_pine() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x504c68ff).into()), - border_variant: Some(rgba(0x504c68ff).into()), + border_variant: Some(rgba(0x322f48ff).into()), border_focused: Some(rgba(0x435255ff).into()), border_selected: Some(rgba(0x435255ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -518,7 +518,7 @@ pub fn rose_pine() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xe0def44c).into()), scrollbar_thumb_hover_background: Some(rgba(0x322f48ff).into()), scrollbar_thumb_border: Some(rgba(0x322f48ff).into()), - scrollbar_track_background: Some(rgba(0x232136ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x27243bff).into()), editor_foreground: Some(rgba(0xe0def4ff).into()), editor_background: Some(rgba(0x232136ff).into()), @@ -581,7 +581,7 @@ pub fn rose_pine() -> UserThemeFamily { modified: Some(rgba(0xf5c177ff).into()), modified_background: Some(rgba(0x50341aff).into()), modified_border: Some(rgba(0x6d4d2bff).into()), - predictive: Some(rgba(0x5dc2a3ff).into()), + predictive: Some(rgba(0x516b83ff).into()), predictive_background: Some(rgba(0x182e23ff).into()), predictive_border: Some(rgba(0x254839ff).into()), renamed: Some(rgba(0x9cced7ff).into()), @@ -937,7 +937,7 @@ pub fn rose_pine() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x423f55ff).into()), - border_variant: Some(rgba(0x423f55ff).into()), + border_variant: Some(rgba(0x232132ff).into()), border_focused: Some(rgba(0x435255ff).into()), border_selected: Some(rgba(0x435255ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -976,7 +976,7 @@ pub fn rose_pine() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xe0def44c).into()), scrollbar_thumb_hover_background: Some(rgba(0x232132ff).into()), scrollbar_thumb_border: Some(rgba(0x232132ff).into()), - scrollbar_track_background: Some(rgba(0x191724ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x1c1a29ff).into()), editor_foreground: Some(rgba(0xe0def4ff).into()), editor_background: Some(rgba(0x191724ff).into()), @@ -1039,7 +1039,7 @@ pub fn rose_pine() -> UserThemeFamily { modified: Some(rgba(0xf5c177ff).into()), modified_background: Some(rgba(0x50341aff).into()), modified_border: Some(rgba(0x6d4d2bff).into()), - predictive: Some(rgba(0x5dc2a3ff).into()), + predictive: Some(rgba(0x556b81ff).into()), predictive_background: Some(rgba(0x182e23ff).into()), predictive_border: Some(rgba(0x254839ff).into()), renamed: Some(rgba(0x9cced7ff).into()), diff --git a/crates/theme/src/themes/sandcastle.rs b/crates/theme/src/themes/sandcastle.rs index 68bff2840f5cd074560305ddcac2ef51b99b33e0..bace9e936f8c26364cc57151b8bbc81c5cd21cc4 100644 --- a/crates/theme/src/themes/sandcastle.rs +++ b/crates/theme/src/themes/sandcastle.rs @@ -20,7 +20,7 @@ pub fn sandcastle() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x3d4350ff).into()), - border_variant: Some(rgba(0x3d4350ff).into()), + border_variant: Some(rgba(0x313741ff).into()), border_focused: Some(rgba(0x223232ff).into()), border_selected: Some(rgba(0x223232ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -59,7 +59,7 @@ pub fn sandcastle() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xfdf4c14c).into()), scrollbar_thumb_hover_background: Some(rgba(0x313741ff).into()), scrollbar_thumb_border: Some(rgba(0x313741ff).into()), - scrollbar_track_background: Some(rgba(0x282c34ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x2a2f38ff).into()), editor_foreground: Some(rgba(0xfdf4c1ff).into()), editor_background: Some(rgba(0x282c34ff).into()), @@ -122,7 +122,7 @@ pub fn sandcastle() -> UserThemeFamily { modified: Some(rgba(0xa07e3bff).into()), modified_background: Some(rgba(0x231d12ff).into()), modified_border: Some(rgba(0x392e1aff).into()), - predictive: Some(rgba(0x83a598ff).into()), + predictive: Some(rgba(0x5c6152ff).into()), predictive_background: Some(rgba(0x1e2321ff).into()), predictive_border: Some(rgba(0x303a36ff).into()), renamed: Some(rgba(0x528b8bff).into()), diff --git a/crates/theme/src/themes/solarized.rs b/crates/theme/src/themes/solarized.rs index 93bda797383be5b6eaf833e1776c383409850e7c..c925785b176018f2813e396a22a35569504aca85 100644 --- a/crates/theme/src/themes/solarized.rs +++ b/crates/theme/src/themes/solarized.rs @@ -21,7 +21,7 @@ pub fn solarized() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x9faaa8ff).into()), - border_variant: Some(rgba(0x9faaa8ff).into()), + border_variant: Some(rgba(0xdcdacbff).into()), border_focused: Some(rgba(0xbfd3efff).into()), border_selected: Some(rgba(0xbfd3efff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -60,7 +60,7 @@ pub fn solarized() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0x002b364c).into()), scrollbar_thumb_hover_background: Some(rgba(0xdcdacbff).into()), scrollbar_thumb_border: Some(rgba(0xdcdacbff).into()), - scrollbar_track_background: Some(rgba(0xfdf6e3ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0xf5eedbff).into()), editor_foreground: Some(rgba(0x002b36ff).into()), editor_background: Some(rgba(0xfdf6e3ff).into()), @@ -123,7 +123,7 @@ pub fn solarized() -> UserThemeFamily { modified: Some(rgba(0xb58904ff).into()), modified_background: Some(rgba(0xf5e6d0ff).into()), modified_border: Some(rgba(0xebd3aaff).into()), - predictive: Some(rgba(0x859904ff).into()), + predictive: Some(rgba(0x679aafff).into()), predictive_background: Some(rgba(0xe9ead0ff).into()), predictive_border: Some(rgba(0xd6d9abff).into()), renamed: Some(rgba(0x298bd1ff).into()), @@ -465,7 +465,7 @@ pub fn solarized() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x2b4f58ff).into()), - border_variant: Some(rgba(0x2b4f58ff).into()), + border_variant: Some(rgba(0x063541ff).into()), border_focused: Some(rgba(0x1c3249ff).into()), border_selected: Some(rgba(0x1c3249ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -504,7 +504,7 @@ pub fn solarized() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xfdf6e34c).into()), scrollbar_thumb_hover_background: Some(rgba(0x063541ff).into()), scrollbar_thumb_border: Some(rgba(0x063541ff).into()), - scrollbar_track_background: Some(rgba(0x002b36ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x032f3bff).into()), editor_foreground: Some(rgba(0xfdf6e3ff).into()), editor_background: Some(rgba(0x002b36ff).into()), @@ -567,7 +567,7 @@ pub fn solarized() -> UserThemeFamily { modified: Some(rgba(0xb58903ff).into()), modified_background: Some(rgba(0x2f1e0cff).into()), modified_border: Some(rgba(0x473110ff).into()), - predictive: Some(rgba(0x859904ff).into()), + predictive: Some(rgba(0x40728bff).into()), predictive_background: Some(rgba(0x1f210cff).into()), predictive_border: Some(rgba(0x323610ff).into()), renamed: Some(rgba(0x288bd1ff).into()), diff --git a/crates/theme/src/themes/summercamp.rs b/crates/theme/src/themes/summercamp.rs index 0dd28f26283ca0eb6a7d595aa0bebc8399696ce6..2ee5f12394dd00328a2d2c698d44687aeeab94b6 100644 --- a/crates/theme/src/themes/summercamp.rs +++ b/crates/theme/src/themes/summercamp.rs @@ -20,7 +20,7 @@ pub fn summercamp() -> UserThemeFamily { styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { border: Some(rgba(0x312d21ff).into()), - border_variant: Some(rgba(0x312d21ff).into()), + border_variant: Some(rgba(0x29251bff).into()), border_focused: Some(rgba(0x193761ff).into()), border_selected: Some(rgba(0x193761ff).into()), border_transparent: Some(rgba(0x00000000).into()), @@ -59,7 +59,7 @@ pub fn summercamp() -> UserThemeFamily { scrollbar_thumb_background: Some(rgba(0xf8f5de4c).into()), scrollbar_thumb_hover_background: Some(rgba(0x29251bff).into()), scrollbar_thumb_border: Some(rgba(0x29251bff).into()), - scrollbar_track_background: Some(rgba(0x1c1810ff).into()), + scrollbar_track_background: Some(rgba(0x00000000).into()), scrollbar_track_border: Some(rgba(0x221e15ff).into()), editor_foreground: Some(rgba(0xf8f5deff).into()), editor_background: Some(rgba(0x1c1810ff).into()), @@ -122,7 +122,7 @@ pub fn summercamp() -> UserThemeFamily { modified: Some(rgba(0xf1fe29ff).into()), modified_background: Some(rgba(0x556305ff).into()), modified_border: Some(rgba(0x727f0aff).into()), - predictive: Some(rgba(0x5dea5aff).into()), + predictive: Some(rgba(0x79434bff).into()), predictive_background: Some(rgba(0x0a4d13ff).into()), predictive_border: Some(rgba(0x1a6a20ff).into()), renamed: Some(rgba(0x499befff).into()), diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index be8b7103d5ecee1aa70d984debeee36c1df6e16a..0cb5c22930c1ce8abafd44bcc398b4c8974ebe06 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -103,8 +103,6 @@ fn main() -> Result<()> { let mut theme_families = Vec::new(); /// Whether VS Code themes should be imported. - /// - /// For the initial release of Zed2, we will just be using the Zed1 themes ported to Zed2. const IMPORT_VS_CODE_THEMES: bool = false; if IMPORT_VS_CODE_THEMES { diff --git a/crates/theme_importer/src/zed1/converter.rs b/crates/theme_importer/src/zed1/converter.rs index 913dfbf7bb8194c60b801b78fb9ab4dad72c7fa7..86c40dfde55a29cb7bb0c6745ae433ecba6553d3 100644 --- a/crates/theme_importer/src/zed1/converter.rs +++ b/crates/theme_importer/src/zed1/converter.rs @@ -117,7 +117,11 @@ impl Zed1ThemeConverter { .or(convert(lowest.accent.default.foreground)), hint_background: convert(lowest.accent.default.background), hint_border: convert(lowest.accent.default.border), - predictive: convert(lowest.positive.default.foreground), + predictive: editor + .suggestion + .color + .map(zed1_color_to_hsla) + .or(convert(lowest.positive.default.foreground)), predictive_background: convert(lowest.positive.default.background), predictive_border: convert(lowest.positive.default.border), conflict: convert(lowest.warning.default.foreground), @@ -183,7 +187,7 @@ impl Zed1ThemeConverter { Ok(ThemeColorsRefinement { border: convert(lowest.base.default.border), - border_variant: convert(lowest.variant.default.border), + border_variant: convert(middle.variant.default.border), border_focused: convert(lowest.accent.hovered.border), border_selected: convert(lowest.accent.default.border), border_transparent: Some(gpui::transparent_black()), @@ -226,7 +230,7 @@ impl Zed1ThemeConverter { .map(|color| color_alpha(color, 0.3)), scrollbar_thumb_hover_background: convert(middle.base.hovered.background), scrollbar_thumb_border: convert(middle.base.default.border), - scrollbar_track_background: convert(highest.base.default.background), + scrollbar_track_background: Some(gpui::transparent_black()), scrollbar_track_border: convert(highest.variant.default.border), editor_foreground: convert(editor.text_color), editor_background: convert(editor.background), diff --git a/crates/theme_selector/src/theme_selector.rs b/crates/theme_selector/src/theme_selector.rs index 44f2069694c421636e0714cd2f02093f577b02f7..cfb98ccd7455fd17c81a3de65a82b55f5d4bd877 100644 --- a/crates/theme_selector/src/theme_selector.rs +++ b/crates/theme_selector/src/theme_selector.rs @@ -1,4 +1,4 @@ -use client::{telemetry::Telemetry, TelemetrySettings}; +use client::telemetry::Telemetry; use feature_flags::FeatureFlagAppExt; use fs::Fs; use fuzzy::{match_strings, StringMatch, StringMatchCandidate}; @@ -7,7 +7,7 @@ use gpui::{ VisualContext, WeakView, }; use picker::{Picker, PickerDelegate}; -use settings::{update_settings_file, Settings, SettingsStore}; +use settings::{update_settings_file, SettingsStore}; use std::sync::Arc; use theme::{Theme, ThemeMeta, ThemeRegistry, ThemeSettings}; use ui::{prelude::*, v_stack, ListItem, ListItemSpacing}; @@ -181,9 +181,8 @@ impl PickerDelegate for ThemeSelectorDelegate { let theme_name = cx.theme().name.clone(); - let telemetry_settings = TelemetrySettings::get_global(cx).clone(); self.telemetry - .report_setting_event(telemetry_settings, "theme", theme_name.to_string()); + .report_setting_event("theme", theme_name.to_string(), cx); update_settings_file::(self.fs.clone(), cx, move |settings| { settings.theme = Some(theme_name.to_string()); diff --git a/crates/ui/docs/todo.md b/crates/ui/docs/todo.md deleted file mode 100644 index e7a053ecf47d212e9527733a629482c57a2359eb..0000000000000000000000000000000000000000 --- a/crates/ui/docs/todo.md +++ /dev/null @@ -1,25 +0,0 @@ -## Documentation priorities: - -These are the priorities to get documented, in a rough stack rank order: - -- [ ] label -- [ ] button -- [ ] icon_button -- [ ] icon -- [ ] list -- [ ] avatar -- [ ] panel -- [ ] modal -- [ ] palette -- [ ] input -- [ ] facepile -- [ ] player -- [ ] stacks -- [ ] context menu -- [ ] input -- [ ] textarea/multiline input (not built - not an editor) -- [ ] indicator -- [ ] public actor -- [ ] keybinding -- [ ] tab -- [ ] toast diff --git a/crates/ui/src/components/button/button.rs b/crates/ui/src/components/button/button.rs index d46273fb916d380eda66df9a4bb41fd951661f24..958aa66ede0809ca0fde22d09e27654aff34791e 100644 --- a/crates/ui/src/components/button/button.rs +++ b/crates/ui/src/components/button/button.rs @@ -1,6 +1,6 @@ use gpui::{AnyView, DefiniteLength}; -use crate::{prelude::*, IconPosition}; +use crate::{prelude::*, IconPosition, KeyBinding}; use crate::{ ButtonCommon, ButtonLike, ButtonSize, ButtonStyle, Icon, IconSize, Label, LineHeightStyle, }; @@ -19,6 +19,7 @@ pub struct Button { icon_size: Option, icon_color: Option, selected_icon: Option, + key_binding: Option, } impl Button { @@ -34,6 +35,7 @@ impl Button { icon_size: None, icon_color: None, selected_icon: None, + key_binding: None, } } @@ -76,6 +78,11 @@ impl Button { self.selected_icon = icon.into(); self } + + pub fn key_binding(mut self, key_binding: impl Into>) -> Self { + self.key_binding = key_binding.into(); + self + } } impl Selectable for Button { @@ -157,7 +164,7 @@ impl RenderOnce for Button { self.base.child( h_stack() .gap_1() - .when(self.icon_position.is_some(), |this| { + .when(self.icon_position == Some(IconPosition::Start), |this| { this.children(self.icon.map(|icon| { ButtonIcon::new(icon) .disabled(is_disabled) @@ -168,12 +175,18 @@ impl RenderOnce for Button { })) }) .child( - Label::new(label) - .color(label_color) - .size(self.label_size.unwrap_or_default()) - .line_height_style(LineHeightStyle::UiLabel), + h_stack() + .gap_2() + .justify_between() + .child( + Label::new(label) + .color(label_color) + .size(self.label_size.unwrap_or_default()) + .line_height_style(LineHeightStyle::UiLabel), + ) + .children(self.key_binding), ) - .when(!self.icon_position.is_some(), |this| { + .when(self.icon_position != Some(IconPosition::Start), |this| { this.children(self.icon.map(|icon| { ButtonIcon::new(icon) .disabled(is_disabled) diff --git a/crates/ui/src/components/icon.rs b/crates/ui/src/components/icon.rs index df1c82bb666d2a20084387f80a5896f73266d598..4c6e48c0fc034dbcfbd4454c920b2d4a994b92b0 100644 --- a/crates/ui/src/components/icon.rs +++ b/crates/ui/src/components/icon.rs @@ -24,11 +24,12 @@ impl IconSize { #[derive(Debug, PartialEq, Copy, Clone, EnumIter)] pub enum Icon { Ai, - ArrowLeft, - ArrowUp, ArrowDown, + ArrowLeft, ArrowRight, + ArrowUp, ArrowUpRight, + ArrowCircle, AtSign, AudioOff, AudioOn, @@ -39,25 +40,28 @@ pub enum Icon { Bolt, CaseSensitive, Check, - Copy, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Close, Collab, + Command, + Control, Copilot, - CopilotInit, - CopilotError, CopilotDisabled, + CopilotError, + CopilotInit, + Copy, Dash, Delete, Disconnected, Ellipsis, Envelope, - ExternalLink, + Escape, ExclamationTriangle, Exit, + ExternalLink, File, FileDoc, FileGeneric, @@ -78,30 +82,32 @@ pub enum Icon { MagnifyingGlass, MailOpen, Maximize, - Minimize, Menu, MessageBubbles, Mic, MicMute, + Minimize, + Option, + PageDown, + PageUp, Plus, Public, Quote, Replace, ReplaceAll, ReplaceNext, + Return, Screen, SelectAll, - Split, + Shift, Snip, + Space, + Split, + Tab, Terminal, + Update, WholeWord, XCircle, - Command, - Control, - Shift, - Option, - Return, - Update, ZedXCopilot, } @@ -109,40 +115,44 @@ impl Icon { pub fn path(self) -> &'static str { match self { Icon::Ai => "icons/ai.svg", + Icon::ArrowDown => "icons/arrow_down.svg", Icon::ArrowLeft => "icons/arrow_left.svg", Icon::ArrowRight => "icons/arrow_right.svg", Icon::ArrowUp => "icons/arrow_up.svg", - Icon::ArrowDown => "icons/arrow_down.svg", Icon::ArrowUpRight => "icons/arrow_up_right.svg", - Icon::AtSign => "icons/at-sign.svg", - Icon::AudioOff => "icons/speaker-off.svg", - Icon::AudioOn => "icons/speaker-loud.svg", + Icon::ArrowCircle => "icons/arrow_circle.svg", + Icon::AtSign => "icons/at_sign.svg", + Icon::AudioOff => "icons/speaker_off.svg", + Icon::AudioOn => "icons/speaker_loud.svg", Icon::Backspace => "icons/backspace.svg", Icon::Bell => "icons/bell.svg", - Icon::BellOff => "icons/bell-off.svg", - Icon::BellRing => "icons/bell-ring.svg", + Icon::BellOff => "icons/bell_off.svg", + Icon::BellRing => "icons/bell_ring.svg", Icon::Bolt => "icons/bolt.svg", Icon::CaseSensitive => "icons/case_insensitive.svg", Icon::Check => "icons/check.svg", - Icon::Copy => "icons/copy.svg", Icon::ChevronDown => "icons/chevron_down.svg", Icon::ChevronLeft => "icons/chevron_left.svg", Icon::ChevronRight => "icons/chevron_right.svg", Icon::ChevronUp => "icons/chevron_up.svg", Icon::Close => "icons/x.svg", Icon::Collab => "icons/user_group_16.svg", + Icon::Command => "icons/command.svg", + Icon::Control => "icons/control.svg", Icon::Copilot => "icons/copilot.svg", - Icon::CopilotInit => "icons/copilot_init.svg", - Icon::CopilotError => "icons/copilot_error.svg", Icon::CopilotDisabled => "icons/copilot_disabled.svg", + Icon::CopilotError => "icons/copilot_error.svg", + Icon::CopilotInit => "icons/copilot_init.svg", + Icon::Copy => "icons/copy.svg", Icon::Dash => "icons/dash.svg", Icon::Delete => "icons/delete.svg", Icon::Disconnected => "icons/disconnected.svg", Icon::Ellipsis => "icons/ellipsis.svg", Icon::Envelope => "icons/feedback.svg", + Icon::Escape => "icons/escape.svg", Icon::ExclamationTriangle => "icons/warning.svg", - Icon::ExternalLink => "icons/external_link.svg", Icon::Exit => "icons/exit.svg", + Icon::ExternalLink => "icons/external_link.svg", Icon::File => "icons/file.svg", Icon::FileDoc => "icons/file_icons/book.svg", Icon::FileGeneric => "icons/file_icons/file.svg", @@ -159,34 +169,36 @@ impl Icon { Icon::Hash => "icons/hash.svg", Icon::InlayHint => "icons/inlay_hint.svg", Icon::Link => "icons/link.svg", - Icon::MagicWand => "icons/magic-wand.svg", + Icon::MagicWand => "icons/magic_wand.svg", Icon::MagnifyingGlass => "icons/magnifying_glass.svg", - Icon::MailOpen => "icons/mail-open.svg", + Icon::MailOpen => "icons/mail_open.svg", Icon::Maximize => "icons/maximize.svg", - Icon::Minimize => "icons/minimize.svg", Icon::Menu => "icons/menu.svg", Icon::MessageBubbles => "icons/conversations.svg", Icon::Mic => "icons/mic.svg", - Icon::MicMute => "icons/mic-mute.svg", + Icon::MicMute => "icons/mic_mute.svg", + Icon::Minimize => "icons/minimize.svg", + Icon::Option => "icons/option.svg", + Icon::PageDown => "icons/page_down.svg", + Icon::PageUp => "icons/page_up.svg", Icon::Plus => "icons/plus.svg", Icon::Public => "icons/public.svg", Icon::Quote => "icons/quote.svg", Icon::Replace => "icons/replace.svg", Icon::ReplaceAll => "icons/replace_all.svg", Icon::ReplaceNext => "icons/replace_next.svg", + Icon::Return => "icons/return.svg", Icon::Screen => "icons/desktop.svg", - Icon::SelectAll => "icons/select-all.svg", - Icon::Split => "icons/split.svg", + Icon::SelectAll => "icons/select_all.svg", + Icon::Shift => "icons/shift.svg", Icon::Snip => "icons/snip.svg", + Icon::Space => "icons/space.svg", + Icon::Split => "icons/split.svg", + Icon::Tab => "icons/tab.svg", Icon::Terminal => "icons/terminal.svg", + Icon::Update => "icons/update.svg", Icon::WholeWord => "icons/word_search.svg", Icon::XCircle => "icons/error.svg", - Icon::Command => "icons/command.svg", - Icon::Control => "icons/control.svg", - Icon::Shift => "icons/shift.svg", - Icon::Option => "icons/option.svg", - Icon::Return => "icons/return.svg", - Icon::Update => "icons/update.svg", Icon::ZedXCopilot => "icons/zed_x_copilot.svg", } } diff --git a/crates/ui/src/components/keybinding.rs b/crates/ui/src/components/keybinding.rs index a07ce1116cebc9cf5bfb2be9a0c8948196be3e02..671f9810831649f8f83dac2e25f88f2223febc40 100644 --- a/crates/ui/src/components/keybinding.rs +++ b/crates/ui/src/components/keybinding.rs @@ -21,9 +21,9 @@ impl RenderOnce for KeyBinding { h_stack() .flex_none() .gap_0p5() - .bg(cx.theme().colors().element_background) .p_0p5() .rounded_sm() + .text_color(cx.theme().colors().text_muted) .when(keystroke.modifiers.function, |el| el.child(Key::new("fn"))) .when(keystroke.modifiers.control, |el| { el.child(KeyIcon::new(Icon::Control)) @@ -70,6 +70,13 @@ impl KeyBinding { "down" => Some(Icon::ArrowDown), "backspace" => Some(Icon::Backspace), "delete" => Some(Icon::Delete), + "return" => Some(Icon::Return), + "enter" => Some(Icon::Return), + "tab" => Some(Icon::Tab), + "space" => Some(Icon::Space), + "escape" => Some(Icon::Escape), + "pagedown" => Some(Icon::PageDown), + "pageup" => Some(Icon::PageUp), _ => None, } } @@ -100,7 +107,7 @@ impl RenderOnce for Key { .h(rems(14. / 16.)) .text_ui() .line_height(relative(1.)) - .text_color(cx.theme().colors().text) + .text_color(cx.theme().colors().text_muted) .child(self.key.clone()) } } @@ -118,9 +125,11 @@ pub struct KeyIcon { impl RenderOnce for KeyIcon { fn render(self, _cx: &mut WindowContext) -> impl IntoElement { - div() - .w(rems(14. / 16.)) - .child(IconElement::new(self.icon).size(IconSize::Small)) + div().w(rems(14. / 16.)).child( + IconElement::new(self.icon) + .size(IconSize::Small) + .color(Color::Muted), + ) } } diff --git a/crates/ui/src/ui.rs b/crates/ui/src/ui.rs index b34e66dbdaaf990b6c87cfd13be0907d1b2e6cbb..b074f10dad50b9e61d0ed69ca29f39687e54973e 100644 --- a/crates/ui/src/ui.rs +++ b/crates/ui/src/ui.rs @@ -2,15 +2,8 @@ //! //! This crate provides a set of UI primitives and components that are used to build all of the elements in Zed's UI. //! -//! ## Work in Progress -//! -//! This crate is still a work in progress. The initial primitives and components are built for getting all the UI on the screen, -//! much of the state and functionality is mocked or hard codeded, and performance has not been a focus. -//! -#![doc = include_str!("../docs/hello-world.md")] #![doc = include_str!("../docs/building-ui.md")] -#![doc = include_str!("../docs/todo.md")] mod clickable; mod components; diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 76715f69bef9ffb5e7f4ced25d00372df897b7e5..69e30a6ccb65c215cd5a59efcb6821549233378d 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -15,7 +15,7 @@ use anyhow::{anyhow, Context as _, Result}; use call::ActiveCall; use client::{ proto::{self, PeerId}, - Client, Status, TelemetrySettings, TypedEnvelope, UserStore, + Client, Status, TypedEnvelope, UserStore, }; use collections::{hash_map, HashMap, HashSet}; use dock::{Dock, DockPosition, Panel, PanelButtons, PanelHandle}; @@ -1095,19 +1095,21 @@ impl Workspace { } pub fn close_global(_: &CloseWindow, cx: &mut AppContext) { - cx.windows().iter().find(|window| { - window - .update(cx, |_, window| { - if window.is_window_active() { - //This can only get called when the window's project connection has been lost - //so we don't need to prompt the user for anything and instead just close the window - window.remove_window(); - true - } else { - false - } - }) - .unwrap_or(false) + cx.defer(|cx| { + cx.windows().iter().find(|window| { + window + .update(cx, |_, window| { + if window.is_window_active() { + //This can only get called when the window's project connection has been lost + //so we don't need to prompt the user for anything and instead just close the window + window.remove_window(); + true + } else { + false + } + }) + .unwrap_or(false) + }); }); } @@ -1250,10 +1252,9 @@ impl Workspace { } pub fn open(&mut self, _: &Open, cx: &mut ViewContext) { - let telemetry_settings = TelemetrySettings::get_global(cx).clone(); self.client() .telemetry() - .report_app_event(telemetry_settings, "open project", false); + .report_app_event("open project", false, cx); let paths = cx.prompt_for_paths(PathPromptOptions { files: true, directories: true, diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 5ac850b1c6d4b1702c8b697d618bedda809f0523..e0da81edc4ae17702b55a306bae3ec8b9d7a2bfd 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -144,6 +144,7 @@ fn main() { cx.set_global(client.clone()); + zed::init(cx); theme::init(theme::LoadThemes::All, cx); project::Project::init(&client, cx); client::init(&client, cx); @@ -158,7 +159,6 @@ fn main() { cx, ); assistant::init(cx); - // component_test::init(cx); cx.spawn(|_| watch_languages(fs.clone(), languages.clone())) .detach(); @@ -172,19 +172,16 @@ fn main() { .detach(); client.telemetry().start(installation_id, session_id, cx); - let telemetry_settings = *client::TelemetrySettings::get_global(cx); - client.telemetry().report_setting_event( - telemetry_settings, - "theme", - cx.theme().name.to_string(), - ); + client + .telemetry() + .report_setting_event("theme", cx.theme().name.to_string(), cx); let event_operation = match existing_installation_id_found { Some(false) => "first open", _ => "open", }; client .telemetry() - .report_app_event(telemetry_settings, event_operation, true); + .report_app_event(event_operation, true, cx); let app_state = Arc::new(AppState { languages: languages.clone(), diff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rs index bcfdb848abba8eb60a2084a0dec571c70d83a0e6..fb85b1fc012085720dd7e11c1863cefcae84723a 100644 --- a/crates/zed/src/zed.rs +++ b/crates/zed/src/zed.rs @@ -64,6 +64,13 @@ actions!( ] ); +pub fn init(cx: &mut AppContext) { + cx.on_action(|_: &Hide, cx| cx.hide()); + cx.on_action(|_: &HideOthers, cx| cx.hide_other_apps()); + cx.on_action(|_: &ShowAll, cx| cx.unhide_other_apps()); + cx.on_action(quit); +} + pub fn build_window_options( bounds: Option, display_uuid: Option, @@ -130,7 +137,6 @@ pub fn initialize_workspace(app_state: Arc, cx: &mut AppContext) { status_bar.add_left_item(diagnostic_summary, cx); status_bar.add_left_item(activity_indicator, cx); status_bar.add_right_item(feedback_button, cx); - // status_bar.add_right_item(copilot, cx); status_bar.add_right_item(copilot, cx); status_bar.add_right_item(active_buffer_language, cx); status_bar.add_right_item(vim_mode_indicator, cx); @@ -207,15 +213,6 @@ pub fn initialize_workspace(app_state: Arc, cx: &mut AppContext) { workspace .register_action(about) - .register_action(|_, _: &Hide, cx| { - cx.hide(); - }) - .register_action(|_, _: &HideOthers, cx| { - cx.hide_other_apps(); - }) - .register_action(|_, _: &ShowAll, cx| { - cx.unhide_other_apps(); - }) .register_action(|_, _: &Minimize, cx| { cx.minimize_window(); }) @@ -225,7 +222,6 @@ pub fn initialize_workspace(app_state: Arc, cx: &mut AppContext) { .register_action(|_, _: &ToggleFullScreen, cx| { cx.toggle_full_screen(); }) - .register_action(quit) .register_action(|_, action: &OpenZedURL, cx| { cx.global::>() .open_urls(&[action.url.clone()]) @@ -451,10 +447,10 @@ fn about(_: &mut Workspace, _: &About, cx: &mut gpui::ViewContext) { .detach(); } -fn quit(_: &mut Workspace, _: &Quit, cx: &mut gpui::ViewContext) { +fn quit(_: &Quit, cx: &mut AppContext) { let should_confirm = WorkspaceSettings::get_global(cx).confirm_quit; - cx.spawn(|_, mut cx| async move { - let mut workspace_windows = cx.update(|_, cx| { + cx.spawn(|mut cx| async move { + let mut workspace_windows = cx.update(|cx| { cx.windows() .into_iter() .filter_map(|window| window.downcast::()) @@ -463,14 +459,14 @@ fn quit(_: &mut Workspace, _: &Quit, cx: &mut gpui::ViewContext) { // If multiple windows have unsaved changes, and need a save prompt, // prompt in the active window before switching to a different window. - cx.update(|_, cx| { + cx.update(|cx| { workspace_windows.sort_by_key(|window| window.is_active(&cx) == Some(false)); }) .log_err(); - if let (true, Some(_)) = (should_confirm, workspace_windows.first().copied()) { - let answer = cx - .update(|_, cx| { + if let (true, Some(workspace)) = (should_confirm, workspace_windows.first().copied()) { + let answer = workspace + .update(&mut cx, |_, cx| { cx.prompt( PromptLevel::Info, "Are you sure you want to quit?", @@ -500,9 +496,7 @@ fn quit(_: &mut Workspace, _: &Quit, cx: &mut gpui::ViewContext) { } } } - cx.update(|_, cx| { - cx.quit(); - })?; + cx.update(|cx| cx.quit())?; anyhow::Ok(()) }) .detach_and_log_err(cx);