From 42365df12fa6af685bc132318ce60fc655c7f936 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:56:18 -0300 Subject: [PATCH] settings_ui: Fix content page title (#39987) Follow up to https://github.com/zed-industries/zed/pull/39979. The previous PR made it the title would change even if you were on a non-root tree view item. This PR fixes that by fixating the title to show only the root tree view item. Release Notes: - N/A --- crates/settings_ui/src/settings_ui.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index e06a45d1bc33136dc8fb42cf06b86da5e8b93f06..0ad5cb647e58f70242c593d5cd85fe18bc22a820 100644 --- a/crates/settings_ui/src/settings_ui.rs +++ b/crates/settings_ui/src/settings_ui.rs @@ -1793,14 +1793,17 @@ impl SettingsWindow { .find(|(_, (_, item))| !matches!(item, SettingsPageItem::SectionHeader(_))) .map(|(index, _)| index); + let root_nav_label = self + .navbar_entries + .iter() + .find(|entry| entry.is_root && entry.page_index == self.current_page_index()) + .map(|entry| entry.title); + page_content = page_content .when(sub_page_stack().is_empty(), |this| { - this.when_some( - self.navbar_entries - .get(self.navbar_entry) - .map(|entry| entry.title), - |this, title| this.child(Label::new(title).size(LabelSize::Large).mb_3()), - ) + this.when_some(root_nav_label, |this, title| { + this.child(Label::new(title).size(LabelSize::Large).mt_2().mb_3()) + }) }) .children(items.clone().into_iter().enumerate().map( |(index, (actual_item_index, item))| {