From 60a96ab7990cd050ae1a2ce7c843fedfa8079be5 Mon Sep 17 00:00:00 2001 From: Caleb! <48127194+kaf-lamed-beyt@users.noreply.github.com> Date: Wed, 26 Feb 2025 17:24:35 +0100 Subject: [PATCH] image_viewer: Hide breadcrumb (#25654) Closes #25279 ![image](https://github.com/user-attachments/assets/15a0b092-449b-493c-8eea-10a3d9d1a912) Release Notes: - Added the ability to hide breadcrumb showing image path --- crates/image_viewer/src/image_viewer.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/image_viewer/src/image_viewer.rs b/crates/image_viewer/src/image_viewer.rs index 75f53248cb..81c963411b 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> {