diff --git a/assets/icons/warning.svg b/assets/icons/warning.svg
index e581def0d050727647ccaf06a53406b389d57e71..c48a575a90dc224db13a4b7fda8629fb2cd464f4 100644
--- a/assets/icons/warning.svg
+++ b/assets/icons/warning.svg
@@ -1,6 +1 @@
-
+
diff --git a/crates/diagnostics2/src/diagnostics.rs b/crates/diagnostics2/src/diagnostics.rs
index 672350ad9e3ee03173da60e27e8faf78cb0458f1..623b63631908dd65b7f4ca633677a6ae8da3136f 100644
--- a/crates/diagnostics2/src/diagnostics.rs
+++ b/crates/diagnostics2/src/diagnostics.rs
@@ -34,6 +34,7 @@ use std::{
path::PathBuf,
sync::Arc,
};
+use theme::ActiveTheme;
pub use toolbar_controls::ToolbarControls;
use ui::{h_stack, HighlightedLabel, Icon, IconElement, Label, TextColor};
use util::TryFutureExt;
@@ -92,9 +93,10 @@ impl EventEmitter for ProjectDiagnosticsEditor {}
impl Render for ProjectDiagnosticsEditor {
type Element = Focusable>;
- fn render(&mut self, _: &mut ViewContext) -> Self::Element {
+ fn render(&mut self, cx: &mut ViewContext) -> Self::Element {
let child = if self.path_states.is_empty() {
div()
+ .bg(cx.theme().colors().editor_background)
.flex()
.items_center()
.justify_center()
diff --git a/crates/diagnostics2/src/items.rs b/crates/diagnostics2/src/items.rs
index 5e5a9f135e2d68c7f07895d05edcd493031560bd..dd1b7d98cf627c95d904a9483d56b6dcd55df35e 100644
--- a/crates/diagnostics2/src/items.rs
+++ b/crates/diagnostics2/src/items.rs
@@ -1,7 +1,7 @@
use collections::HashSet;
use editor::{Editor, GoToDiagnostic};
use gpui::{
- div, Div, EventEmitter, InteractiveComponent, ParentComponent, Render, Stateful,
+ rems, Div, EventEmitter, InteractiveComponent, ParentComponent, Render, Stateful,
StatefulInteractiveComponent, Styled, Subscription, View, ViewContext, WeakView,
};
use language::Diagnostic;
@@ -25,15 +25,35 @@ impl Render for DiagnosticIndicator {
type Element = Stateful>;
fn render(&mut self, cx: &mut ViewContext) -> Self::Element {
- let mut summary_row = h_stack()
+ let diagnostic_indicator = match (self.summary.error_count, self.summary.warning_count) {
+ (0, 0) => h_stack().child(IconElement::new(Icon::Check).color(TextColor::Success)),
+ (0, warning_count) => h_stack()
+ .gap_1()
+ .child(IconElement::new(Icon::ExclamationTriangle).color(TextColor::Warning))
+ .child(Label::new(warning_count.to_string())),
+ (error_count, 0) => h_stack()
+ .gap_1()
+ .child(IconElement::new(Icon::XCircle).color(TextColor::Error))
+ .child(Label::new(error_count.to_string())),
+ (error_count, warning_count) => h_stack()
+ .gap_1()
+ .child(IconElement::new(Icon::XCircle).color(TextColor::Error))
+ .child(Label::new(error_count.to_string()))
+ .child(IconElement::new(Icon::ExclamationTriangle).color(TextColor::Warning))
+ .child(Label::new(warning_count.to_string())),
+ };
+
+ h_stack()
.id(cx.entity_id())
.on_action(Self::go_to_next_diagnostic)
.rounded_md()
- .p_1()
+ .flex_none()
+ .h(rems(1.375))
+ .px_1()
.cursor_pointer()
- .bg(gpui::green())
- .hover(|style| style.bg(cx.theme().colors().element_hover))
- .active(|style| style.bg(cx.theme().colors().element_active))
+ .bg(cx.theme().colors().ghost_element_background)
+ .hover(|style| style.bg(cx.theme().colors().ghost_element_hover))
+ .active(|style| style.bg(cx.theme().colors().ghost_element_active))
.tooltip(|_, cx| Tooltip::text("Project Diagnostics", cx))
.on_click(|this, _, cx| {
if let Some(workspace) = this.workspace.upgrade() {
@@ -41,33 +61,8 @@ impl Render for DiagnosticIndicator {
ProjectDiagnosticsEditor::deploy(workspace, &Default::default(), cx)
})
}
- });
-
- if self.summary.error_count > 0 {
- summary_row = summary_row.child(
- div()
- .child(IconElement::new(Icon::XCircle).color(TextColor::Error))
- .bg(gpui::red()),
- );
- summary_row = summary_row.child(
- div()
- .child(Label::new(self.summary.error_count.to_string()))
- .bg(gpui::yellow()),
- );
- }
-
- if self.summary.warning_count > 0 {
- summary_row = summary_row
- .child(IconElement::new(Icon::ExclamationTriangle).color(TextColor::Warning));
- summary_row = summary_row.child(Label::new(self.summary.warning_count.to_string()));
- }
-
- if self.summary.error_count == 0 && self.summary.warning_count == 0 {
- summary_row =
- summary_row.child(IconElement::new(Icon::Check).color(TextColor::Success));
- }
-
- summary_row
+ })
+ .child(diagnostic_indicator)
}
}
diff --git a/crates/editor2/src/editor.rs b/crates/editor2/src/editor.rs
index ee72f318ca620e38563c8c74ae0feaf8fa75e453..beed93e91761566400b8a3d8bb0ae92dd786ed4a 100644
--- a/crates/editor2/src/editor.rs
+++ b/crates/editor2/src/editor.rs
@@ -4401,6 +4401,7 @@ impl Editor {
editor.fold_at(&FoldAt { buffer_row }, cx);
}
})
+ .color(ui::TextColor::Muted)
.render()
})
})
diff --git a/crates/ui2/src/components/icon_button.rs b/crates/ui2/src/components/icon_button.rs
index 9b8548e3f9c6cf092f08f41bbda3bfc25293bc98..23d920835e63a04a437e97f9d708264f767d5747 100644
--- a/crates/ui2/src/components/icon_button.rs
+++ b/crates/ui2/src/components/icon_button.rs
@@ -111,7 +111,10 @@ impl IconButton {
.p_1()
.bg(bg_color)
.cursor_pointer()
- .hover(|style| style.bg(bg_hover_color))
+ // Nate: Trying to figure out the right places we want to show a
+ // hover state here. I think it is a bit heavy to have it on every
+ // place we use an icon button.
+ // .hover(|style| style.bg(bg_hover_color))
.active(|style| style.bg(bg_active_color))
.child(IconElement::new(self.icon).color(icon_color));
diff --git a/crates/workspace2/src/pane.rs b/crates/workspace2/src/pane.rs
index d44d3471146c7acbf8ad4ce9546e0d9f88167342..d67422c32aa513e0c55b5cec5668b96fa5c3e303 100644
--- a/crates/workspace2/src/pane.rs
+++ b/crates/workspace2/src/pane.rs
@@ -24,6 +24,7 @@ use std::{
Arc,
},
};
+
use ui::v_stack;
use ui::{prelude::*, Icon, IconButton, IconElement, TextColor, Tooltip};
use util::truncate_and_remove_front;
@@ -1480,15 +1481,10 @@ impl Pane {
// Right Side
.child(
div()
- // We only use absolute here since we don't
- // have opacity or `hidden()` yet
- .absolute()
- .neg_top_7()
.px_1()
.flex()
.flex_none()
.gap_2()
- .group_hover("tab_bar", |this| this.top_0())
// Nav Buttons
.child(
div()
@@ -1931,9 +1927,11 @@ impl Render for Pane {
.map(|task| task.detach_and_log_err(cx));
})
.child(self.render_tab_bar(cx))
- .child(div() /* todo!(toolbar) */)
+ // .child(
+ // div()
+ // ) /* todo!(toolbar) */
.child(if let Some(item) = self.active_item() {
- div().flex_1().child(item.to_any())
+ div().flex().flex_1().child(item.to_any())
} else {
// todo!()
div().child("Empty Pane")
diff --git a/crates/workspace2/src/status_bar.rs b/crates/workspace2/src/status_bar.rs
index 327e7c09ede63c1001369af9d31a64342e574d3b..2293b7475c60821d2e1f3b19af075e750f9e8160 100644
--- a/crates/workspace2/src/status_bar.rs
+++ b/crates/workspace2/src/status_bar.rs
@@ -56,7 +56,7 @@ impl StatusBar {
fn render_left_tools(&self, cx: &mut ViewContext) -> impl Component {
h_stack()
.items_center()
- .gap_1()
+ .gap_2()
.children(self.left_items.iter().map(|item| item.to_any()))
}
diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs
index 0e88414bd5b53d3fbc1c0d408a680d1f6a5a5bc0..78499a9d227311e9110fbedffc88b2a2ad0bdb69 100644
--- a/crates/workspace2/src/workspace2.rs
+++ b/crates/workspace2/src/workspace2.rs
@@ -3666,7 +3666,7 @@ impl Render for Workspace {
&self.app_state,
cx,
))
- .child(div().flex().flex_1().child(self.bottom_dock.clone())),
+ .child(self.bottom_dock.clone()),
)
// Right Dock
.child(
@@ -3679,19 +3679,6 @@ impl Render for Workspace {
),
)
.child(self.status_bar.clone())
- .z_index(8)
- // Debug
- .child(
- div()
- .flex()
- .flex_col()
- .z_index(9)
- .absolute()
- .top_20()
- .left_1_4()
- .w_40()
- .gap_2(),
- )
}
}