File finder UI enhancement (#7364)

File finder looks and feels a little bulky now. It duplicates file names
and consumes too much space for each file.

This PR makes it more compact:
- File name is trimmed from the path, removing duplication
- Path is placed to the right of the file name, improving space usage
- Path is muted and printed in small size to not distract attention from
the main information (file names)

It makes search results easier to look through, consistent with the
editor tabs, and closer in terms of usage to mature editors.

Release Notes:

- File finder UI enhancement
This commit is contained in:
Andrew Lygin 2024-02-05 21:12:47 +03:00 committed by GitHub
parent 91303a5021
commit 2ed45d72d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 7 deletions

View file

@ -79,6 +79,8 @@ impl RenderOnce for HighlightedLabel {
let mut text_style = cx.text_style().clone();
text_style.color = self.base.color.color(cx);
LabelLike::new().child(StyledText::new(self.label).with_highlights(&text_style, highlights))
LabelLike::new()
.size(self.base.size)
.child(StyledText::new(self.label).with_highlights(&text_style, highlights))
}
}

View file

@ -36,7 +36,7 @@ pub trait LabelCommon {
#[derive(IntoElement)]
pub struct LabelLike {
size: LabelSize,
pub(crate) size: LabelSize,
line_height_style: LineHeightStyle,
pub(crate) color: Color,
strikethrough: bool,