From 8533e9daabc58a22783bbb4e78694d2327005f83 Mon Sep 17 00:00:00 2001 From: yggverse Date: Mon, 3 Feb 2025 20:21:18 +0200 Subject: [PATCH] fix blank menu item labels --- src/app/browser/window/header/bar/menu.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/app/browser/window/header/bar/menu.rs b/src/app/browser/window/header/bar/menu.rs index 868857fc..ccf351d6 100644 --- a/src/app/browser/window/header/bar/menu.rs +++ b/src/app/browser/window/header/bar/menu.rs @@ -1,7 +1,7 @@ use super::{BrowserAction, Profile, WindowAction}; use gtk::{ gio::{self}, - glib::{gformat, GString, Uri}, + glib::{GString, Uri}, prelude::{ActionExt, ToVariant}, Align, MenuButton, }; @@ -272,12 +272,8 @@ 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(); - // Show hostname for index pages (or entire URL on possible unwrap failure) - if path == "/" { + if path == "/" || path.is_empty() || is_parent { uri.host().unwrap_or(uri.to_str()) - // Parental item names have some format exception - } else if is_parent { - gformat!("{}{}", uri.host().unwrap_or(uri.to_str()), uri.path()) } else { path }