mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-25 07:55:56 +00:00
project panel: Update file icon when editing filename (#12078)
Before: ![before](https://github.com/zed-industries/zed/assets/45585937/1590586d-9d42-4d44-85fc-8e79499408b3) After: ![after](https://github.com/zed-industries/zed/assets/45585937/c0fd1b2a-1ecf-4403-b74a-25c3c700f00d) Release Notes: - Update file icons during editing in project panel --------- Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
This commit is contained in:
parent
7b6f8c279d
commit
14436a75b1
1 changed files with 7 additions and 1 deletions
|
@ -1685,7 +1685,13 @@ impl ProjectPanel {
|
|||
let filename_text_color =
|
||||
entry_git_aware_label_color(details.git_status, details.is_ignored, is_selected);
|
||||
let file_name = details.filename.clone();
|
||||
let icon = details.icon.clone();
|
||||
let mut icon = details.icon.clone();
|
||||
if show_editor && details.kind.is_file() {
|
||||
let filename = self.filename_editor.read(cx).text(cx);
|
||||
if filename.len() > 2 {
|
||||
icon = FileIcons::get_icon(Path::new(&filename), cx);
|
||||
}
|
||||
}
|
||||
let depth = details.depth;
|
||||
div()
|
||||
.id(entry_id.to_proto() as usize)
|
||||
|
|
Loading…
Reference in a new issue