From b0bbb742ab0412e4a31f5dee4c066460a77ff69e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 11:14:33 -0500 Subject: [PATCH 01/32] Add return, space, tab, escape keybinding icons --- assets/icons/delete.svg | 5 +-- assets/icons/escape.svg | 1 + assets/icons/return.svg | 4 +- assets/icons/space.svg | 1 + assets/icons/tab.svg | 1 + crates/ui2/src/components/icon.rs | 60 ++++++++++++++----------- crates/ui2/src/components/keybinding.rs | 5 +++ 7 files changed, 43 insertions(+), 34 deletions(-) create mode 100644 assets/icons/escape.svg create mode 100644 assets/icons/space.svg create mode 100644 assets/icons/tab.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/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/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/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/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs index 0c618f291528f8f41bc6f22f428322ad1c67f20b..d445b3d70206b557339fe0438a0e28d237af01e7 100644 --- a/crates/ui2/src/components/icon.rs +++ b/crates/ui2/src/components/icon.rs @@ -24,10 +24,10 @@ impl IconSize { #[derive(Debug, PartialEq, Copy, Clone, EnumIter)] pub enum Icon { Ai, - ArrowLeft, - ArrowUp, ArrowDown, + ArrowLeft, ArrowRight, + ArrowUp, ArrowUpRight, AtSign, AudioOff, @@ -39,25 +39,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 +81,30 @@ pub enum Icon { MagnifyingGlass, MailOpen, Maximize, - Minimize, Menu, MessageBubbles, Mic, MicMute, + Minimize, + Option, 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,10 +112,10 @@ 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", @@ -124,25 +127,28 @@ impl Icon { 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", @@ -163,30 +169,30 @@ impl Icon { Icon::MagnifyingGlass => "icons/magnifying_glass.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::Minimize => "icons/minimize.svg", + Icon::Option => "icons/option.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::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/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index 6f6388548971baf317e1b9b287178c1dac7ebf7d..434f3aeb5e35fca5a0dd555ad6cc1c54cd770341 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -72,6 +72,11 @@ impl KeyBinding { "down" => Some(Icon::ArrowDown), "backspace" => Some(Icon::Backspace), "delete" => Some(Icon::Delete), + "enter" => Some(Icon::Return), + "escape" => Some(Icon::Escape), + "return" => Some(Icon::Return), + "space" => Some(Icon::Space), + "tab" => Some(Icon::Tab), _ => None, } } From 124604c019a1359f7445fedca2b1f3a1438386e9 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 11:28:31 -0500 Subject: [PATCH 02/32] Add pageup and pagedown icons and keybinding icons --- assets/icons/page-down.svg | 6 ++++++ assets/icons/page-up.svg | 13 +++++++++++++ crates/ui2/src/components/icon.rs | 4 ++++ crates/ui2/src/components/keybinding.rs | 10 ++++++---- 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 assets/icons/page-down.svg create mode 100644 assets/icons/page-up.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/crates/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs index d445b3d70206b557339fe0438a0e28d237af01e7..b252715aadcc08d390b3109eb8bc8832a4039dd7 100644 --- a/crates/ui2/src/components/icon.rs +++ b/crates/ui2/src/components/icon.rs @@ -87,6 +87,8 @@ pub enum Icon { MicMute, Minimize, Option, + PageDown, + PageUp, Plus, Public, Quote, @@ -175,6 +177,8 @@ impl Icon { 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", diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index 434f3aeb5e35fca5a0dd555ad6cc1c54cd770341..4c51e0f742fb914771361e3ae7bf4778ee00bba7 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -66,17 +66,19 @@ impl KeyBinding { fn icon_for_key(keystroke: &Keystroke) -> Option { match keystroke.key.as_str() { - "left" => Some(Icon::ArrowLeft), - "right" => Some(Icon::ArrowRight), - "up" => Some(Icon::ArrowUp), - "down" => Some(Icon::ArrowDown), "backspace" => Some(Icon::Backspace), "delete" => Some(Icon::Delete), + "down" => Some(Icon::ArrowDown), "enter" => Some(Icon::Return), "escape" => Some(Icon::Escape), + "left" => Some(Icon::ArrowLeft), + "pagedown" => Some(Icon::PageDown), + "pageup" => Some(Icon::PageUp), "return" => Some(Icon::Return), + "right" => Some(Icon::ArrowRight), "space" => Some(Icon::Space), "tab" => Some(Icon::Tab), + "up" => Some(Icon::ArrowUp), _ => None, } } From 127acede25906e3ba781304d79eb8c71fe94772f Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 11:37:49 -0500 Subject: [PATCH 03/32] Update keybinding rendering --- crates/ui2/src/components/keybinding.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/crates/ui2/src/components/keybinding.rs b/crates/ui2/src/components/keybinding.rs index 4c51e0f742fb914771361e3ae7bf4778ee00bba7..2ffab23bb10b1c0d2568b7fd39c70045b30231f1 100644 --- a/crates/ui2/src/components/keybinding.rs +++ b/crates/ui2/src/components/keybinding.rs @@ -23,9 +23,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)) @@ -111,7 +111,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()) } } @@ -131,9 +131,11 @@ impl RenderOnce for KeyIcon { type Output = Div; fn render(self, _cx: &mut WindowContext) -> Self::Output { - 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), + ) } } From 15fb9d91955a98765d193a938b286b08dca82e91 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 11:45:41 -0500 Subject: [PATCH 04/32] Standardize icon naming --- assets/icons/{at-sign.svg => at_sign.svg} | 2 +- assets/icons/{bell-off.svg => bell_off.svg} | 0 assets/icons/{bell-ring.svg => bell_ring.svg} | 0 .../icons/{magic-wand.svg => magic_wand.svg} | 0 assets/icons/{mail-open.svg => mail_open.svg} | 0 assets/icons/{mic-mute.svg => mic_mute.svg} | 0 assets/icons/{page-down.svg => page_down.svg} | 0 assets/icons/{page-up.svg => page_up.svg} | 0 .../icons/{select-all.svg => select_all.svg} | 0 .../{speaker-loud.svg => speaker_loud.svg} | 0 .../{speaker-off.svg => speaker_off.svg} | 0 crates/collab_ui/src/collab_titlebar_item.rs | 4 ++-- crates/ui2/src/components/icon.rs | 20 +++++++++---------- 13 files changed, 13 insertions(+), 13 deletions(-) rename assets/icons/{at-sign.svg => at_sign.svg} (85%) rename assets/icons/{bell-off.svg => bell_off.svg} (100%) rename assets/icons/{bell-ring.svg => bell_ring.svg} (100%) rename assets/icons/{magic-wand.svg => magic_wand.svg} (100%) rename assets/icons/{mail-open.svg => mail_open.svg} (100%) rename assets/icons/{mic-mute.svg => mic_mute.svg} (100%) rename assets/icons/{page-down.svg => page_down.svg} (100%) rename assets/icons/{page-up.svg => page_up.svg} (100%) rename assets/icons/{select-all.svg => select_all.svg} (100%) rename assets/icons/{speaker-loud.svg => speaker_loud.svg} (100%) rename assets/icons/{speaker-off.svg => speaker_off.svg} (100%) 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/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 similarity index 100% rename from assets/icons/page-down.svg rename to assets/icons/page_down.svg diff --git a/assets/icons/page-up.svg b/assets/icons/page_up.svg similarity index 100% rename from assets/icons/page-up.svg rename to assets/icons/page_up.svg 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/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/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index cef8faf6016d60c2df12e4ff6404dd86d9591480..3a05ee901af94235d07c7561a1dad104bc4d65d6 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -647,10 +647,10 @@ impl CollabTitlebarItem { let tooltip; let is_deafened = room.read(cx).is_deafened().unwrap_or(false); if is_deafened { - icon = "icons/speaker-off.svg"; + icon = "icons/speaker_off.svg"; tooltip = "Unmute speakers"; } else { - icon = "icons/speaker-loud.svg"; + icon = "icons/speaker_loud.svg"; tooltip = "Mute speakers"; } diff --git a/crates/ui2/src/components/icon.rs b/crates/ui2/src/components/icon.rs index b252715aadcc08d390b3109eb8bc8832a4039dd7..7354467fcf1a29b6bcb68d246db0780ff34405dd 100644 --- a/crates/ui2/src/components/icon.rs +++ b/crates/ui2/src/components/icon.rs @@ -119,13 +119,13 @@ impl Icon { Icon::ArrowRight => "icons/arrow_right.svg", Icon::ArrowUp => "icons/arrow_up.svg", Icon::ArrowUpRight => "icons/arrow_up_right.svg", - Icon::AtSign => "icons/at-sign.svg", - Icon::AudioOff => "icons/speaker-off.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", @@ -167,18 +167,18 @@ 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::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::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", @@ -187,7 +187,7 @@ impl Icon { Icon::ReplaceNext => "icons/replace_next.svg", Icon::Return => "icons/return.svg", Icon::Screen => "icons/desktop.svg", - Icon::SelectAll => "icons/select-all.svg", + Icon::SelectAll => "icons/select_all.svg", Icon::Shift => "icons/shift.svg", Icon::Snip => "icons/snip.svg", Icon::Space => "icons/space.svg", From 0932665bc9ae54bf3832d3087080a54b3a4ff62b Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 3 Jan 2024 13:55:55 -0800 Subject: [PATCH 05/32] Update Cargo.toml --- crates/zed/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index dba4f61793099d05b0163bca52a6404935082527..c858a86d1a91c54d47629468c29471802a1cd0de 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -2,7 +2,7 @@ description = "The fast, collaborative code editor." edition = "2021" name = "zed" -version = "0.120.0" +version = "0.119.0" publish = false [lib] From 46e44f98536026dd7557db3545b5a2638df8d174 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 16:55:56 -0500 Subject: [PATCH 06/32] Restore keybinding changes --- crates/ui/src/components/keybinding.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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), + ) } } From 94536ba24adab3355cbce73e38d9a534e79d46ae Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 3 Jan 2024 13:57:32 -0800 Subject: [PATCH 07/32] Update Cargo.toml --- crates/zed/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index c858a86d1a91c54d47629468c29471802a1cd0de..dba4f61793099d05b0163bca52a6404935082527 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -2,7 +2,7 @@ description = "The fast, collaborative code editor." edition = "2021" name = "zed" -version = "0.119.0" +version = "0.120.0" publish = false [lib] From 7f6770d27227db56ea80bb523aecfe811b2e66be Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 3 Jan 2024 17:00:47 -0500 Subject: [PATCH 08/32] Add empty state for project panel (#3863) This PR adds an empty state for the project panel. It will now display an "Open a project" button. Release Notes: - Added an empty state for the project panel. --- crates/project_panel/src/project_panel.rs | 15 ++++++++++++- crates/ui/src/components/button/button.rs | 27 +++++++++++++++++------ 2 files changed, 34 insertions(+), 8 deletions(-) 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/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) From a4986c397df95a2273b5d1a8093ce5bbaf9f0c4b Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 3 Jan 2024 17:09:01 -0500 Subject: [PATCH 09/32] Fix predictive text color (#3867) This PR fixes the predictive text colors, which were no longer correct after #3842. Release Notes: - Fixed predictive text colors. --- crates/theme/src/themes/andromeda.rs | 2 +- crates/theme/src/themes/atelier.rs | 40 ++++++++++----------- crates/theme/src/themes/ayu.rs | 6 ++-- crates/theme/src/themes/gruvbox.rs | 12 +++---- crates/theme/src/themes/one.rs | 4 +-- crates/theme/src/themes/rose_pine.rs | 6 ++-- crates/theme/src/themes/sandcastle.rs | 2 +- crates/theme/src/themes/solarized.rs | 4 +-- crates/theme/src/themes/summercamp.rs | 2 +- crates/theme_importer/src/zed1/converter.rs | 6 +++- 10 files changed, 44 insertions(+), 40 deletions(-) diff --git a/crates/theme/src/themes/andromeda.rs b/crates/theme/src/themes/andromeda.rs index 327c6f668f7472f659cf72e4fe2f1300c496306b..e46e9cf9d0977bb527eb34d3a3697916a81b96a1 100644 --- a/crates/theme/src/themes/andromeda.rs +++ b/crates/theme/src/themes/andromeda.rs @@ -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..75226c669bbe7aa32119d70f85fb63ccbf2e6190 100644 --- a/crates/theme/src/themes/atelier.rs +++ b/crates/theme/src/themes/atelier.rs @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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..9029a01e25f52b5814d2dacd2061d5d15a219450 100644 --- a/crates/theme/src/themes/ayu.rs +++ b/crates/theme/src/themes/ayu.rs @@ -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()), @@ -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()), @@ -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..615c29dea805eb5336532dac4793a0ea2cba6cd6 100644 --- a/crates/theme/src/themes/gruvbox.rs +++ b/crates/theme/src/themes/gruvbox.rs @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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..12fd7e9b663dbc9879a6b3110cd9e55b2a975e68 100644 --- a/crates/theme/src/themes/one.rs +++ b/crates/theme/src/themes/one.rs @@ -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()), @@ -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..966d6e5e625b5ffa5dbb9c4ae1ef5d0ff3e2aaec 100644 --- a/crates/theme/src/themes/rose_pine.rs +++ b/crates/theme/src/themes/rose_pine.rs @@ -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()), @@ -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()), @@ -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..9ca7a9dff2bb3483ec737d9b146985ae4fdaa965 100644 --- a/crates/theme/src/themes/sandcastle.rs +++ b/crates/theme/src/themes/sandcastle.rs @@ -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..945d99ed5bd5da5eaa012fabf5527a6e25b722fd 100644 --- a/crates/theme/src/themes/solarized.rs +++ b/crates/theme/src/themes/solarized.rs @@ -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()), @@ -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..963608d5db1a4a5d5fffcda73bbb1de267a27761 100644 --- a/crates/theme/src/themes/summercamp.rs +++ b/crates/theme/src/themes/summercamp.rs @@ -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/zed1/converter.rs b/crates/theme_importer/src/zed1/converter.rs index 913dfbf7bb8194c60b801b78fb9ab4dad72c7fa7..45563971d17ceabdeecdb5fbfe31d0cb46d5451a 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), From 9936b0747205ab418a4ec25c505c6d5733c1454b Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 3 Jan 2024 17:19:39 -0500 Subject: [PATCH 10/32] Bump collab version back to what it was before --- crates/collab/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index 7681a5e572a7208763082991a20ead4825bfb5bc..8011cea2f9da9a1d874ca634a6c396b4528abbef 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.32.0" publish = false [[bin]] From 5944fcb999ac088ca479a0dc814d141bdb4868d4 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 3 Jan 2024 17:20:01 -0500 Subject: [PATCH 11/32] collab 0.33.0 --- Cargo.lock | 2 +- crates/collab/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34ddf5880f03cf1b6922a1039d4994798262e8db..e09ab0fa57970268c1660e0b509baf21ed2ebd01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1446,7 +1446,7 @@ dependencies = [ [[package]] name = "collab" -version = "0.28.0" +version = "0.33.0" dependencies = [ "anyhow", "async-trait", diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.toml index 8011cea2f9da9a1d874ca634a6c396b4528abbef..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.32.0" +version = "0.33.0" publish = false [[bin]] From 2ec58c0438e0c67003bf1f707bb039fac9a6cadf Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 3 Jan 2024 17:48:46 -0500 Subject: [PATCH 12/32] Follow the project host when clicking their name in the title bar (#3868) This PR adds back the ability to follow the project host when clicking on their name in the title bar. Release Notes: - Added back following the project host when clicking their name in the title bar. --- crates/collab_ui/src/collab_titlebar_item.rs | 36 ++++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 60bb35a8d58e65bede02ba5c7305eb7be923bda4..16d8be89af78db45bdcc27b317bffcbfdf66e98e 100644 --- a/crates/collab_ui/src/collab_titlebar_item.rs +++ b/crates/collab_ui/src/collab_titlebar_item.rs @@ -303,22 +303,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(); + }) + }), ) } From 1a3c931d6197f5aeb69819a7cf6386ff232a6748 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 3 Jan 2024 17:54:53 -0500 Subject: [PATCH 13/32] Fix icon path for `Icon::AudioOn` (#3869) This PR fixes the icon path for `Icon::AudioOn` so that it points to a file that exists. Release Notes: - Fixed the loading of the deafen icon in the call controls. --- crates/ui/src/components/icon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui/src/components/icon.rs b/crates/ui/src/components/icon.rs index f1916d3dce2409101fc93383af08560892a92f74..9c0b1e58e301306bbcd7b5494bafc0ba5c1a582f 100644 --- a/crates/ui/src/components/icon.rs +++ b/crates/ui/src/components/icon.rs @@ -121,7 +121,7 @@ impl Icon { 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::AudioOn => "icons/speaker_loud.svg", Icon::Backspace => "icons/backspace.svg", Icon::Bell => "icons/bell.svg", Icon::BellOff => "icons/bell_off.svg", From 3ddba6fc714af1c9d3042a844d43c49b82188cc2 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 3 Jan 2024 18:09:55 -0500 Subject: [PATCH 14/32] Restore timestamp insertion for `journal: new journal entry` (#3870) This PR restores the insertion of the timestamp when using the `journal: new journal entry` action. Release Notes: - Restored timestamp insertion when creating new journal entries. --- crates/journal/src/journal.rs | 43 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 21 deletions(-) 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(()) }) From 1bc2e0ee5c38b4185b4d4a77bbc904607baba21e Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 3 Jan 2024 20:00:58 -0500 Subject: [PATCH 15/32] Remove zed2-related comment This was the last result when searching for `zed2` --- crates/theme_importer/src/main.rs | 2 -- 1 file changed, 2 deletions(-) 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 { From 570abe0590cf6440830816305490ca22e82c3f2f Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 3 Jan 2024 20:02:23 -0500 Subject: [PATCH 16/32] Rename notification_store --- crates/notifications/Cargo.toml | 2 +- .../src/{notification_store2.rs => notification_store.rs} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename crates/notifications/src/{notification_store2.rs => notification_store.rs} (100%) 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 From 3b90c778b999eaab7b635c92d031626ca0b67270 Mon Sep 17 00:00:00 2001 From: Mikayla Date: Wed, 3 Jan 2024 15:52:45 -0800 Subject: [PATCH 17/32] Change binary name --- crates/zed/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.toml index dba4f61793099d05b0163bca52a6404935082527..39ab5e285b77672e31d8b33555f83bd768e4be68 100644 --- a/crates/zed/Cargo.toml +++ b/crates/zed/Cargo.toml @@ -11,7 +11,7 @@ path = "src/zed.rs" doctest = false [[bin]] -name = "zed" +name = "Zed" path = "src/main.rs" [dependencies] From 073128e4f3ff1bed653bb343e92d193b68bdb610 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 3 Jan 2024 17:58:06 -0800 Subject: [PATCH 18/32] Remove wasmtime for now --- Cargo.lock | 414 +------------------------------- Cargo.toml | 5 +- crates/language/src/language.rs | 37 +-- 3 files changed, 14 insertions(+), 442 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e09ab0fa57970268c1660e0b509baf21ed2ebd01..1d0af3c00876104d2f8554ee43ed757689bce281 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -268,12 +268,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" - [[package]] name = "arrayref" version = "0.3.7" @@ -1832,105 +1826,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-bforest" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cranelift-entity", -] - -[[package]] -name = "cranelift-codegen" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "bumpalo", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-control", - "cranelift-entity", - "cranelift-isle", - "gimli", - "hashbrown 0.14.0", - "log", - "regalloc2", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" - -[[package]] -name = "cranelift-control" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "arbitrary", -] - -[[package]] -name = "cranelift-entity" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "serde", - "serde_derive", -] - -[[package]] -name = "cranelift-frontend" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon", -] - -[[package]] -name = "cranelift-isle" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" - -[[package]] -name = "cranelift-native" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cranelift-codegen", - "libc", - "target-lexicon", -] - -[[package]] -name = "cranelift-wasm" -version = "0.103.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.10.5", - "log", - "smallvec", - "wasmparser", - "wasmtime-types", -] - [[package]] name = "crc" version = "3.0.1" @@ -2526,12 +2421,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "fallible-iterator" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" - [[package]] name = "fallible-streaming-iterator" version = "0.1.9" @@ -3042,11 +2931,6 @@ name = "gimli" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" -dependencies = [ - "fallible-iterator 0.3.0", - "indexmap 2.0.0", - "stable_deref_trait", -] [[package]] name = "git" @@ -3559,7 +3443,6 @@ checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", "hashbrown 0.14.0", - "serde", ] [[package]] @@ -3925,12 +3808,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "libc" version = "0.2.148" @@ -4162,15 +4039,6 @@ dependencies = [ "url", ] -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "mach2" version = "0.4.1" @@ -4249,15 +4117,6 @@ version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.21", -] - [[package]] name = "memmap2" version = "0.2.3" @@ -4913,9 +4772,6 @@ version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ - "crc32fast", - "hashbrown 0.14.0", - "indexmap 2.0.0", "memchr", ] @@ -5770,15 +5626,6 @@ version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - [[package]] name = "ptr_meta" version = "0.1.4" @@ -6052,19 +5899,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "regalloc2" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" -dependencies = [ - "hashbrown 0.13.2", - "log", - "rustc-hash", - "slice-group-by", - "smallvec", -] - [[package]] name = "regex" version = "1.9.5" @@ -6384,7 +6218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ "bitflags 2.4.1", - "fallible-iterator 0.2.0", + "fallible-iterator", "fallible-streaming-iterator", "hashlink", "libsqlite3-sys", @@ -7209,12 +7043,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "slotmap" version = "1.0.6" @@ -7327,12 +7155,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be6c3f39c37a4283ee4b43d1311c828f2e1fb0541e76ea0cb1a2abd9ef2f5b3b" -[[package]] -name = "sptr" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" - [[package]] name = "sqlez" version = "0.1.0" @@ -7588,12 +7410,6 @@ dependencies = [ "uuid 1.4.1", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -7865,12 +7681,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.12.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" - [[package]] name = "tempdir" version = "0.3.7" @@ -8524,8 +8334,6 @@ source = "git+https://github.com/tree-sitter/tree-sitter?rev=31c40449749c4263a91 dependencies = [ "cc", "regex", - "wasmtime", - "wasmtime-c-api-impl", ] [[package]] @@ -9290,224 +9098,6 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" -[[package]] -name = "wasm-encoder" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad2b51884de9c7f4fe2fd1043fccb8dcad4b1e29558146ee57a144d15779f3f" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasmparser" -version = "0.118.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" -dependencies = [ - "indexmap 2.0.0", - "semver", -] - -[[package]] -name = "wasmtime" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "bincode", - "bumpalo", - "cfg-if 1.0.0", - "indexmap 2.0.0", - "libc", - "log", - "object", - "once_cell", - "paste", - "serde", - "serde_derive", - "serde_json", - "target-lexicon", - "wasmparser", - "wasmtime-cranelift", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "wasmtime-c-api-impl" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "log", - "once_cell", - "tracing", - "wasmtime", - "wasmtime-c-api-macros", -] - -[[package]] -name = "wasmtime-c-api-macros" -version = "0.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "wasmtime-cranelift" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "cfg-if 1.0.0", - "cranelift-codegen", - "cranelift-control", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli", - "log", - "object", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-cranelift-shared", - "wasmtime-environ", - "wasmtime-versioned-export-macros", -] - -[[package]] -name = "wasmtime-cranelift-shared" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-control", - "cranelift-native", - "gimli", - "object", - "target-lexicon", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli", - "indexmap 2.0.0", - "log", - "object", - "serde", - "serde_derive", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "bincode", - "cfg-if 1.0.0", - "gimli", - "log", - "object", - "rustix 0.38.21", - "serde", - "serde_derive", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "anyhow", - "cc", - "cfg-if 1.0.0", - "indexmap 2.0.0", - "libc", - "log", - "mach", - "memfd", - "memoffset 0.9.0", - "paste", - "psm", - "rustix 0.38.21", - "sptr", - "wasm-encoder", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-versioned-export-macros", - "wasmtime-wmemcheck", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-types" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "cranelift-entity", - "serde", - "serde_derive", - "thiserror", - "wasmparser", -] - -[[package]] -name = "wasmtime-versioned-export-macros" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", -] - -[[package]] -name = "wasmtime-wmemcheck" -version = "16.0.0" -source = "git+https://github.com/bytecodealliance/wasmtime?rev=v16.0.0#6613acd1e4817957a4a7745125ef063b43c273a7" - [[package]] name = "web-sys" version = "0.3.64" @@ -9924,7 +9514,7 @@ dependencies = [ [[package]] name = "zed" -version = "0.120.0" +version = "0.119.0" dependencies = [ "activity_indicator", "ai", diff --git a/Cargo.toml b/Cargo.toml index 5449f82b2fa3af1c08bcfc6571708fa492da03f1..9f2bc145901cdcfa4fc7c02649edcdbbbb73dc07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,12 +127,11 @@ thiserror = { version = "1.0.29" } time = { version = "0.3", features = ["serde", "serde-well-known"] } toml = { version = "0.5" } tiktoken-rs = "0.5.7" -tree-sitter = { version = "0.20", features = ["wasm"] } +tree-sitter = { version = "0.20" } unindent = { version = "0.1.7" } pretty_assertions = "1.3.0" git2 = { version = "0.15", default-features = false} uuid = { version = "1.1.2", features = ["v4"] } -wasmtime = "16" tree-sitter-bash = { git = "https://github.com/tree-sitter/tree-sitter-bash", rev = "7331995b19b8f8aba2d5e26deb51d2195c18bc94" } tree-sitter-c = "0.20.1" @@ -166,7 +165,7 @@ tree-sitter-uiua = {git = "https://github.com/shnarazk/tree-sitter-uiua", rev = [patch.crates-io] tree-sitter = { git = "https://github.com/tree-sitter/tree-sitter", rev = "31c40449749c4263a91a43593831b82229049a4c" } async-task = { git = "https://github.com/zed-industries/async-task", rev = "341b57d6de98cdfd7b418567b8de2022ca993a6e" } -wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "v16.0.0" } +# wasmtime = { git = "https://github.com/bytecodealliance/wasmtime", rev = "v16.0.0" } # TODO - Remove when a version is released with this PR: https://github.com/servo/core-foundation-rs/pull/457 cocoa = { git = "https://github.com/servo/core-foundation-rs", rev = "079665882507dd5e2ff77db3de5070c1f6c0fb85" } diff --git a/crates/language/src/language.rs b/crates/language/src/language.rs index 2a75050bb00113ffcf9e91d65b812319e83f3acd..5564481c6bdc07a41d0b3fdd91a75970de9b8e21 100644 --- a/crates/language/src/language.rs +++ b/crates/language/src/language.rs @@ -44,7 +44,7 @@ use std::{ }; use syntax_map::SyntaxSnapshot; use theme::{SyntaxTheme, Theme}; -use tree_sitter::{self, wasmtime, Query, WasmStore}; +use tree_sitter::{self, Query}; use unicase::UniCase; use util::{http::HttpClient, paths::PathExt}; use util::{post_inc, ResultExt, TryFutureExt as _, UnwrapFuture}; @@ -85,14 +85,11 @@ impl LspBinaryStatusSender { thread_local! { static PARSER: RefCell = { - let mut parser = Parser::new(); - parser.set_wasm_store(WasmStore::new(WASM_ENGINE.clone()).unwrap()).unwrap(); - RefCell::new(parser) + RefCell::new(Parser::new()) }; } lazy_static! { - pub static ref WASM_ENGINE: wasmtime::Engine = wasmtime::Engine::default(); pub static ref NEXT_GRAMMAR_ID: AtomicUsize = Default::default(); pub static ref PLAIN_TEXT: Arc = Arc::new(Language::new( LanguageConfig { @@ -641,8 +638,8 @@ enum AvailableGrammar { get_queries: fn(&str) -> LanguageQueries, }, Wasm { - grammar_name: Arc, - path: Arc, + _grammar_name: Arc, + _path: Arc, }, } @@ -742,7 +739,10 @@ impl LanguageRegistry { state.available_languages.push(AvailableLanguage { id: post_inc(&mut state.next_available_language_id), config, - grammar: AvailableGrammar::Wasm { grammar_name, path }, + grammar: AvailableGrammar::Wasm { + _grammar_name: grammar_name, + _path: path, + }, lsp_adapters: Vec::new(), loaded: false, }); @@ -876,25 +876,8 @@ impl LanguageRegistry { asset_dir, get_queries, } => (grammar, (get_queries)(asset_dir)), - AvailableGrammar::Wasm { grammar_name, path } => { - let mut wasm_path = path.join(grammar_name.as_ref()); - wasm_path.set_extension("wasm"); - let wasm_bytes = std::fs::read(&wasm_path)?; - let grammar = PARSER.with(|parser| { - let mut parser = parser.borrow_mut(); - let mut store = parser.take_wasm_store().unwrap(); - let grammar = - store.load_language(&grammar_name, &wasm_bytes); - parser.set_wasm_store(store).unwrap(); - grammar - })?; - let mut queries = LanguageQueries::default(); - if let Ok(contents) = std::fs::read_to_string( - &path.join("highlights.scm"), - ) { - queries.highlights = Some(contents.into()); - } - (grammar, queries) + AvailableGrammar::Wasm { .. } => { + Err(anyhow!("not supported"))? } }; Language::new(language.config, Some(grammar)) From f633043859be54dcb51e56efe4c399bc61caa06e Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 22:44:31 -0500 Subject: [PATCH 19/32] Update ui docs --- crates/ui/docs/todo.md | 25 ------------------------- crates/ui/src/ui.rs | 7 ------- 2 files changed, 32 deletions(-) delete mode 100644 crates/ui/docs/todo.md 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/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; From bea527d647dd6ded8bac146f77d85f574b34d52c Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Wed, 3 Jan 2024 22:56:33 -0500 Subject: [PATCH 20/32] Update version in Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1d0af3c00876104d2f8554ee43ed757689bce281..13d4be62337ae0557fbc59538db4a4bdceacd22e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9514,7 +9514,7 @@ dependencies = [ [[package]] name = "zed" -version = "0.119.0" +version = "0.120.0" dependencies = [ "activity_indicator", "ai", From e903adf016cb41ba567a244c9ee4c2cbd52c4781 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Wed, 3 Jan 2024 23:06:16 -0500 Subject: [PATCH 21/32] Use dense spacing for completion menu items (#3874) This PR updates the completion menu to use dense spacing for its items. Release Notes: - Adjusted styling of completion menu entries. --- crates/editor/src/editor.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 85a156a8eb9014728a4a2ad1598082e990f45ef7..8ca8ba073166b39f03f181bbfe2c805857e0048a 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -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(); From 710a26ce32244835891469c26484d4538844c126 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 23:07:21 -0500 Subject: [PATCH 22/32] Add "Checking" icon for diagnostics --- Cargo.lock | 2 +- assets/icons/arrow_circle.svg | 1 + crates/diagnostics/src/items.rs | 21 ++++++++++++++++----- crates/ui/src/components/icon.rs | 2 ++ 4 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 assets/icons/arrow_circle.svg diff --git a/Cargo.lock b/Cargo.lock index 1d0af3c00876104d2f8554ee43ed757689bce281..13d4be62337ae0557fbc59538db4a4bdceacd22e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9514,7 +9514,7 @@ dependencies = [ [[package]] name = "zed" -version = "0.119.0" +version = "0.120.0" dependencies = [ "activity_indicator", "ai", 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/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/ui/src/components/icon.rs b/crates/ui/src/components/icon.rs index 9c0b1e58e301306bbcd7b5494bafc0ba5c1a582f..4c6e48c0fc034dbcfbd4454c920b2d4a994b92b0 100644 --- a/crates/ui/src/components/icon.rs +++ b/crates/ui/src/components/icon.rs @@ -29,6 +29,7 @@ pub enum Icon { ArrowRight, ArrowUp, ArrowUpRight, + ArrowCircle, AtSign, AudioOff, AudioOn, @@ -119,6 +120,7 @@ impl Icon { Icon::ArrowRight => "icons/arrow_right.svg", Icon::ArrowUp => "icons/arrow_up.svg", Icon::ArrowUpRight => "icons/arrow_up_right.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", From d643d99943dfb609ffb946b5806177e19e55e162 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 23:09:24 -0500 Subject: [PATCH 23/32] Make scrollbar track transparent --- crates/theme/src/themes/andromeda.rs | 2 +- crates/theme/src/themes/atelier.rs | 40 ++++++++++----------- crates/theme/src/themes/ayu.rs | 6 ++-- crates/theme/src/themes/gruvbox.rs | 12 +++---- crates/theme/src/themes/one.rs | 4 +-- crates/theme/src/themes/rose_pine.rs | 6 ++-- crates/theme/src/themes/sandcastle.rs | 2 +- crates/theme/src/themes/solarized.rs | 4 +-- crates/theme/src/themes/summercamp.rs | 2 +- crates/theme_importer/src/zed1/converter.rs | 2 +- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/crates/theme/src/themes/andromeda.rs b/crates/theme/src/themes/andromeda.rs index e46e9cf9d0977bb527eb34d3a3697916a81b96a1..e61ac8508fef0ad46b89981efe8ad06f47c27353 100644 --- a/crates/theme/src/themes/andromeda.rs +++ b/crates/theme/src/themes/andromeda.rs @@ -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()), diff --git a/crates/theme/src/themes/atelier.rs b/crates/theme/src/themes/atelier.rs index 75226c669bbe7aa32119d70f85fb63ccbf2e6190..1bd0e2e455ddb72ecf635721daadbcf7ba445a1f 100644 --- a/crates/theme/src/themes/atelier.rs +++ b/crates/theme/src/themes/atelier.rs @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/ayu.rs b/crates/theme/src/themes/ayu.rs index 9029a01e25f52b5814d2dacd2061d5d15a219450..995990e5a3ed4d9899b14e1ccf8659eb4bd74ee3 100644 --- a/crates/theme/src/themes/ayu.rs +++ b/crates/theme/src/themes/ayu.rs @@ -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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/gruvbox.rs b/crates/theme/src/themes/gruvbox.rs index 615c29dea805eb5336532dac4793a0ea2cba6cd6..44d3defbac0ca97c499c7edc6bac6b67d09a3e17 100644 --- a/crates/theme/src/themes/gruvbox.rs +++ b/crates/theme/src/themes/gruvbox.rs @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/one.rs b/crates/theme/src/themes/one.rs index 12fd7e9b663dbc9879a6b3110cd9e55b2a975e68..247acd1ceb519e9329f92177d26bc518972fa8ed 100644 --- a/crates/theme/src/themes/one.rs +++ b/crates/theme/src/themes/one.rs @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/rose_pine.rs b/crates/theme/src/themes/rose_pine.rs index 966d6e5e625b5ffa5dbb9c4ae1ef5d0ff3e2aaec..5bdb89b8a60a758462d27341fa8b7f51bc0281cf 100644 --- a/crates/theme/src/themes/rose_pine.rs +++ b/crates/theme/src/themes/rose_pine.rs @@ -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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/sandcastle.rs b/crates/theme/src/themes/sandcastle.rs index 9ca7a9dff2bb3483ec737d9b146985ae4fdaa965..d9660ce11eb59fd1af7b4555cb091f1f4f292c12 100644 --- a/crates/theme/src/themes/sandcastle.rs +++ b/crates/theme/src/themes/sandcastle.rs @@ -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()), diff --git a/crates/theme/src/themes/solarized.rs b/crates/theme/src/themes/solarized.rs index 945d99ed5bd5da5eaa012fabf5527a6e25b722fd..acdc2b50755254fd2d39e8a0b79277969762d7af 100644 --- a/crates/theme/src/themes/solarized.rs +++ b/crates/theme/src/themes/solarized.rs @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/summercamp.rs b/crates/theme/src/themes/summercamp.rs index 963608d5db1a4a5d5fffcda73bbb1de267a27761..d4a8de6e12eabc3519d412cfe03bf123f28cd368 100644 --- a/crates/theme/src/themes/summercamp.rs +++ b/crates/theme/src/themes/summercamp.rs @@ -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()), diff --git a/crates/theme_importer/src/zed1/converter.rs b/crates/theme_importer/src/zed1/converter.rs index 45563971d17ceabdeecdb5fbfe31d0cb46d5451a..84cb760eaf42207242ff715e1bbd179167984cf5 100644 --- a/crates/theme_importer/src/zed1/converter.rs +++ b/crates/theme_importer/src/zed1/converter.rs @@ -230,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), From 20a897d511f9644324865b3857f053c6606501d1 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 23:13:26 -0500 Subject: [PATCH 24/32] Update border variant color --- crates/theme/src/themes/andromeda.rs | 2 +- crates/theme/src/themes/atelier.rs | 40 ++++++++++----------- crates/theme/src/themes/ayu.rs | 6 ++-- crates/theme/src/themes/gruvbox.rs | 12 +++---- crates/theme/src/themes/one.rs | 4 +-- crates/theme/src/themes/rose_pine.rs | 6 ++-- crates/theme/src/themes/sandcastle.rs | 2 +- crates/theme/src/themes/solarized.rs | 4 +-- crates/theme/src/themes/summercamp.rs | 2 +- crates/theme_importer/src/zed1/converter.rs | 2 +- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/crates/theme/src/themes/andromeda.rs b/crates/theme/src/themes/andromeda.rs index e61ac8508fef0ad46b89981efe8ad06f47c27353..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()), diff --git a/crates/theme/src/themes/atelier.rs b/crates/theme/src/themes/atelier.rs index 1bd0e2e455ddb72ecf635721daadbcf7ba445a1f..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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/ayu.rs b/crates/theme/src/themes/ayu.rs index 995990e5a3ed4d9899b14e1ccf8659eb4bd74ee3..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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/gruvbox.rs b/crates/theme/src/themes/gruvbox.rs index 44d3defbac0ca97c499c7edc6bac6b67d09a3e17..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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/one.rs b/crates/theme/src/themes/one.rs index 247acd1ceb519e9329f92177d26bc518972fa8ed..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()), @@ -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()), diff --git a/crates/theme/src/themes/rose_pine.rs b/crates/theme/src/themes/rose_pine.rs index 5bdb89b8a60a758462d27341fa8b7f51bc0281cf..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()), @@ -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()), @@ -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()), diff --git a/crates/theme/src/themes/sandcastle.rs b/crates/theme/src/themes/sandcastle.rs index d9660ce11eb59fd1af7b4555cb091f1f4f292c12..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()), diff --git a/crates/theme/src/themes/solarized.rs b/crates/theme/src/themes/solarized.rs index acdc2b50755254fd2d39e8a0b79277969762d7af..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()), @@ -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()), diff --git a/crates/theme/src/themes/summercamp.rs b/crates/theme/src/themes/summercamp.rs index d4a8de6e12eabc3519d412cfe03bf123f28cd368..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()), diff --git a/crates/theme_importer/src/zed1/converter.rs b/crates/theme_importer/src/zed1/converter.rs index 84cb760eaf42207242ff715e1bbd179167984cf5..86c40dfde55a29cb7bb0c6745ae433ecba6553d3 100644 --- a/crates/theme_importer/src/zed1/converter.rs +++ b/crates/theme_importer/src/zed1/converter.rs @@ -187,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()), From 77647fa088b65b01863fb9522ec56ca95f7d36df Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Wed, 3 Jan 2024 23:19:47 -0500 Subject: [PATCH 25/32] Use theme colors for muted/speaking indicators --- crates/assistant/src/assistant_panel.rs | 2 -- crates/collab_ui/src/collab_titlebar_item.rs | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 7b19ad130c4c42316f6ca65c8063be9c3842b42b..4c7b183fc02a3bb390d99da2b5af06892887b05a 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -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( diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs index 16d8be89af78db45bdcc27b317bffcbfdf66e98e..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( @@ -405,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)); @@ -413,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() }), From 2972ee8cedfcac5666ec648065639fc8d519992c Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Thu, 4 Jan 2024 01:13:21 -0500 Subject: [PATCH 26/32] Move telemetry settings check into telemetry module --- crates/assistant/src/assistant_panel.rs | 11 +--- crates/call/src/call.rs | 9 +-- crates/client/src/telemetry.rs | 62 ++++++++------------- crates/editor/src/editor.rs | 13 +---- crates/theme_selector/src/theme_selector.rs | 7 +-- crates/workspace/src/workspace.rs | 5 +- crates/zed/src/main.rs | 11 ++-- 7 files changed, 41 insertions(+), 77 deletions(-) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 4c7b183fc02a3bb390d99da2b5af06892887b05a..3625b64e32ee52d1efad6d4c043c5147b2777ffc 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::{ @@ -3527,12 +3527,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/editor/src/editor.rs b/crates/editor/src/editor.rs index 8ca8ba073166b39f03f181bbfe2c805857e0048a..1e537c7554dbd222d91d061717e455842d4eb666 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}; @@ -8864,14 +8864,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"))] @@ -8909,7 +8903,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 @@ -8919,12 +8912,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/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/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 76715f69bef9ffb5e7f4ced25d00372df897b7e5..9e3e59b309cf9a59662586ce14445e5fe70d1d96 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}; @@ -1250,10 +1250,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..21e6c8fa216f5faaac67a1eb646389e20f6ca3eb 100644 --- a/crates/zed/src/main.rs +++ b/crates/zed/src/main.rs @@ -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(), From 5a43cbacbe95c5f610ba3ee5eb59520d218c9211 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 4 Jan 2024 11:55:08 +0100 Subject: [PATCH 27/32] channels: Move name of the channel to the same line as the hash icon. --- crates/collab_ui/src/collab_panel/channel_modal.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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() From f0afa3f9e3c6b4468ececcc06c29326a7e5cf733 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 4 Jan 2024 12:39:15 +0100 Subject: [PATCH 28/32] Show scrollbar even when buffer search highlights are outside viewport --- crates/editor/src/editor.rs | 6 ++++++ crates/editor/src/element.rs | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 1e537c7554dbd222d91d061717e455842d4eb666..cf074bad415d499516c1bb693cbfc19c4482f41c 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -8448,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, 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() } From f6af7ab27c612a1c041dd3ccdf582f765c9bb557 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 4 Jan 2024 15:00:36 +0100 Subject: [PATCH 29/32] Fix quitting Zed when project was unshared --- crates/workspace/src/workspace.rs | 28 +++++++++++++----------- crates/zed/src/main.rs | 2 +- crates/zed/src/zed.rs | 36 +++++++++++++------------------ 3 files changed, 31 insertions(+), 35 deletions(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 9e3e59b309cf9a59662586ce14445e5fe70d1d96..69e30a6ccb65c215cd5a59efcb6821549233378d 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -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) + }); }); } diff --git a/crates/zed/src/main.rs b/crates/zed/src/main.rs index 21e6c8fa216f5faaac67a1eb646389e20f6ca3eb..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(); 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); From b78497bf5433ecdcb8300c0d432ccc7f9c2a56eb Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 4 Jan 2024 15:12:25 +0100 Subject: [PATCH 30/32] Clip List items that partially overflow --- crates/gpui/src/elements/list.rs | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) 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); From 3ab20626147a0bbe4739e6bdb8faf8ee78137b22 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 4 Jan 2024 16:15:32 +0100 Subject: [PATCH 31/32] Fix border rendering After implementing it a while ago, our previous interpolation scheme didn't really make sense to me and was causing borders to be rendered incorrectly. We don't really draw backgrounds and borders as part of the same draw call anymore, but it seemed reasonable to have a correct implementation in the shader anyway. This commit uses Porter-Duff compositing (i.e., `over`) to produce a color that is the result of superimposing the border on top of the background. Then, we linearly interpolate towards the background color as we slide out of the border and into the background. --- crates/gpui/src/platform/mac/shaders.metal | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) 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; +} From 5a1509ef269b608f95d7f73355f533ead852de72 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 4 Jan 2024 16:37:13 +0100 Subject: [PATCH 32/32] Re-enable key bindings for `AssistantPanel` --- crates/assistant/src/assistant_panel.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 3625b64e32ee52d1efad6d4c043c5147b2777ffc..9221d87f60fda92990997a1401bf54325a099c6b 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -1157,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);