From 2dcda0c798eff3487168266cd7bd2c440a0a9dac Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 3 Feb 2025 21:01:14 +0200 Subject: [PATCH] add exception for children items --- src/app/browser/window/header/bar/menu.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/browser/window/header/bar/menu.rs b/src/app/browser/window/header/bar/menu.rs index ccf351d6..07afa6d7 100644 --- a/src/app/browser/window/header/bar/menu.rs +++ b/src/app/browser/window/header/bar/menu.rs @@ -272,8 +272,12 @@ fn ellipsize(value: &str, limit: usize) -> String { /// as [MenuItem](https://docs.gtk.org/gio/class.MenuItem.html) label fn uri_to_label(uri: &Uri, is_parent: bool) -> GString { let path = uri.path(); - if path == "/" || path.is_empty() || is_parent { - uri.host().unwrap_or(uri.to_str()) + if path == "/" || path.is_empty() { + if is_parent { + uri.host().unwrap_or(uri.to_str()) + } else { + gtk::glib::gformat!("{}{path}", uri.host().unwrap_or(uri.to_str())) + } } else { path }