diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index 40678f6cf8d1c6773ccf1168e065cb318ae9f14f..f1316de125485b1a69ea6ae22c2b3506cb289e51 100644 --- a/crates/settings_ui/src/settings_ui.rs +++ b/crates/settings_ui/src/settings_ui.rs @@ -1378,6 +1378,14 @@ impl SettingsWindow { cx.observe_global_in::(window, move |this, window, cx| { this.fetch_files(window, cx); + + // Whenever settings are changed, it's possible that the changed + // settings affects the rendering of the `SettingsWindow`, like is + // the case with `ui_font_size`. When that happens, we need to + // instruct the `ListState` to re-measure the list items, as the + // list item heights may have changed depending on the new font + // size. + this.list_state.clone().measure_all(); cx.notify(); }) .detach(); @@ -1487,7 +1495,6 @@ impl SettingsWindow { None }; - // high overdraw value so the list scrollbar len doesn't change too much let list_state = gpui::ListState::new(0, gpui::ListAlignment::Top, px(0.0)).measure_all(); list_state.set_scroll_handler(|_, _, _| {}); @@ -1980,7 +1987,6 @@ impl SettingsWindow { } fn reset_list_state(&mut self) { - // plus one for the title let mut visible_items_count = self.visible_page_items().count(); if visible_items_count > 0 {