Properly color file labels in project panel (#3794)
Also fixes an error with mouse listeners placement in https://github.com/zed-industries/zed/pull/3792 Release Notes: - N/A
This commit is contained in:
commit
e1d8e2001b
3 changed files with 10 additions and 15 deletions
|
@ -2840,17 +2840,13 @@ impl Element for EditorElement {
|
||||||
}
|
}
|
||||||
self.paint_text(text_bounds, &mut layout, cx);
|
self.paint_text(text_bounds, &mut layout, cx);
|
||||||
|
|
||||||
|
cx.with_z_index(0, |cx| {
|
||||||
|
self.paint_mouse_listeners(bounds, gutter_bounds, text_bounds, &layout, cx);
|
||||||
|
});
|
||||||
if !layout.blocks.is_empty() {
|
if !layout.blocks.is_empty() {
|
||||||
cx.with_z_index(0, |cx| {
|
cx.with_z_index(0, |cx| {
|
||||||
cx.with_element_id(Some("editor_blocks"), |cx| {
|
cx.with_element_id(Some("editor_blocks"), |cx| {
|
||||||
self.paint_blocks(bounds, &mut layout, cx);
|
self.paint_blocks(bounds, &mut layout, cx);
|
||||||
self.paint_mouse_listeners(
|
|
||||||
bounds,
|
|
||||||
gutter_bounds,
|
|
||||||
text_bounds,
|
|
||||||
&layout,
|
|
||||||
cx,
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1364,16 +1364,15 @@ impl ProjectPanel {
|
||||||
.map_or(false, |selection| selection.entry_id == entry_id);
|
.map_or(false, |selection| selection.entry_id == entry_id);
|
||||||
let width = self.width.unwrap_or(px(0.));
|
let width = self.width.unwrap_or(px(0.));
|
||||||
|
|
||||||
let theme = cx.theme();
|
|
||||||
let filename_text_color = details
|
let filename_text_color = details
|
||||||
.git_status
|
.git_status
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|status| match status {
|
.map(|status| match status {
|
||||||
GitFileStatus::Added => theme.status().created,
|
GitFileStatus::Added => Color::Created,
|
||||||
GitFileStatus::Modified => theme.status().modified,
|
GitFileStatus::Modified => Color::Modified,
|
||||||
GitFileStatus::Conflict => theme.status().conflict,
|
GitFileStatus::Conflict => Color::Conflict,
|
||||||
})
|
})
|
||||||
.unwrap_or(theme.status().info);
|
.unwrap_or(Color::Default);
|
||||||
|
|
||||||
let file_name = details.filename.clone();
|
let file_name = details.filename.clone();
|
||||||
let icon = details.icon.clone();
|
let icon = details.icon.clone();
|
||||||
|
@ -1407,9 +1406,7 @@ impl ProjectPanel {
|
||||||
if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) {
|
if let (Some(editor), true) = (Some(&self.filename_editor), show_editor) {
|
||||||
div().h_full().w_full().child(editor.clone())
|
div().h_full().w_full().child(editor.clone())
|
||||||
} else {
|
} else {
|
||||||
div()
|
div().child(Label::new(file_name).color(filename_text_color))
|
||||||
.text_color(filename_text_color)
|
|
||||||
.child(Label::new(file_name))
|
|
||||||
}
|
}
|
||||||
.ml_1(),
|
.ml_1(),
|
||||||
)
|
)
|
||||||
|
|
|
@ -13,6 +13,7 @@ pub enum Color {
|
||||||
Hidden,
|
Hidden,
|
||||||
Info,
|
Info,
|
||||||
Modified,
|
Modified,
|
||||||
|
Conflict,
|
||||||
Muted,
|
Muted,
|
||||||
Placeholder,
|
Placeholder,
|
||||||
Player(u32),
|
Player(u32),
|
||||||
|
@ -28,6 +29,7 @@ impl Color {
|
||||||
Color::Muted => cx.theme().colors().text_muted,
|
Color::Muted => cx.theme().colors().text_muted,
|
||||||
Color::Created => cx.theme().status().created,
|
Color::Created => cx.theme().status().created,
|
||||||
Color::Modified => cx.theme().status().modified,
|
Color::Modified => cx.theme().status().modified,
|
||||||
|
Color::Conflict => cx.theme().status().conflict,
|
||||||
Color::Deleted => cx.theme().status().deleted,
|
Color::Deleted => cx.theme().status().deleted,
|
||||||
Color::Disabled => cx.theme().colors().text_disabled,
|
Color::Disabled => cx.theme().colors().text_disabled,
|
||||||
Color::Hidden => cx.theme().status().hidden,
|
Color::Hidden => cx.theme().status().hidden,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue