Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

image_viewer: Hide breadcrumb (#25654)

Caleb!60a96ab7990c
diff --git a/crates/image_viewer/src/image_viewer.rs b/crates/image_viewer/src/image_viewer.rs
index 75f53248cb4..81c963411b2 100644
--- a/crates/image_viewer/src/image_viewer.rs
+++ b/crates/image_viewer/src/image_viewer.rs
@@ -4,7 +4,7 @@ mod image_viewer_settings;
use std::path::PathBuf;
use anyhow::Context as _;
-use editor::items::entry_git_aware_label_color;
+use editor::{items::entry_git_aware_label_color, EditorSettings};
use file_icons::FileIcons;
use gpui::{
canvas, div, fill, img, opaque_grey, point, size, AnyElement, App, Bounds, Context, Entity,
@@ -144,8 +144,13 @@ impl Item for ImageView {
.map(Icon::from_path)
}
- fn breadcrumb_location(&self, _: &App) -> ToolbarItemLocation {
- ToolbarItemLocation::PrimaryLeft
+ fn breadcrumb_location(&self, cx: &App) -> ToolbarItemLocation {
+ let show_breadcrumb = EditorSettings::get_global(cx).toolbar.breadcrumbs;
+ if show_breadcrumb {
+ ToolbarItemLocation::PrimaryLeft
+ } else {
+ ToolbarItemLocation::Hidden
+ }
}
fn breadcrumbs(&self, _theme: &Theme, cx: &App) -> Option<Vec<BreadcrumbText>> {