image_viewer: Hide breadcrumb (#25654)
Closes #25279  Release Notes: - Added the ability to hide breadcrumb showing image path
This commit is contained in:
parent
1f80f58104
commit
60a96ab799
1 changed files with 8 additions and 3 deletions
|
@ -4,7 +4,7 @@ mod image_viewer_settings;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use anyhow::Context as _;
|
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 file_icons::FileIcons;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
canvas, div, fill, img, opaque_grey, point, size, AnyElement, App, Bounds, Context, Entity,
|
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)
|
.map(Icon::from_path)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn breadcrumb_location(&self, _: &App) -> ToolbarItemLocation {
|
fn breadcrumb_location(&self, cx: &App) -> ToolbarItemLocation {
|
||||||
ToolbarItemLocation::PrimaryLeft
|
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>> {
|
fn breadcrumbs(&self, _theme: &Theme, cx: &App) -> Option<Vec<BreadcrumbText>> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue