Adjust image viewer tab title font (#9903)
Fix #9895 Release notes: - Changed the tab title of the image preview to be the same as the other tabs ([#9895](https://github.com/zed-industries/zed/issues/9895)). --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This commit is contained in:
parent
403b912767
commit
659ea7054a
1 changed files with 10 additions and 3 deletions
|
@ -73,14 +73,21 @@ impl Item for ImageView {
|
||||||
fn tab_content(
|
fn tab_content(
|
||||||
&self,
|
&self,
|
||||||
_detail: Option<usize>,
|
_detail: Option<usize>,
|
||||||
_selected: bool,
|
selected: bool,
|
||||||
_cx: &WindowContext,
|
_cx: &WindowContext,
|
||||||
) -> AnyElement {
|
) -> AnyElement {
|
||||||
self.path
|
let title = self
|
||||||
|
.path
|
||||||
.file_name()
|
.file_name()
|
||||||
.unwrap_or_else(|| self.path.as_os_str())
|
.unwrap_or_else(|| self.path.as_os_str())
|
||||||
.to_string_lossy()
|
.to_string_lossy()
|
||||||
.to_string()
|
.to_string();
|
||||||
|
Label::new(title)
|
||||||
|
.color(if selected {
|
||||||
|
Color::Default
|
||||||
|
} else {
|
||||||
|
Color::Muted
|
||||||
|
})
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue