diff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rs index 74a914f52..04a3ed19b 100644 --- a/wezterm-gui/src/termwindow/mod.rs +++ b/wezterm-gui/src/termwindow/mod.rs @@ -305,7 +305,6 @@ pub struct TermWindow { show_scroll_bar: bool, tab_bar: TabBarState, fancy_tab_bar: Option, - fancy_tab_bar_height: Option, pub right_status: String, last_ui_item: Option, /// Tracks whether the current mouse-down event is part of click-focus. @@ -641,7 +640,7 @@ impl TermWindow { // for the tab bar state. let show_tab_bar = config.enable_tab_bar && !config.hide_tab_bar_if_only_one_tab; let tab_bar_height = if show_tab_bar { - Self::tab_bar_pixel_height_impl(&config, &fontconfig, &render_metrics, &None)? as usize + Self::tab_bar_pixel_height_impl(&config, &fontconfig, &render_metrics, None)? as usize } else { 0 }; @@ -729,7 +728,6 @@ impl TermWindow { show_scroll_bar: config.enable_scroll_bar, tab_bar: TabBarState::default(), fancy_tab_bar: None, - fancy_tab_bar_height: None, right_status: String::new(), last_mouse_coords: (0, -1), window_drag_position: None, diff --git a/wezterm-gui/src/termwindow/render.rs b/wezterm-gui/src/termwindow/render.rs index 303d92cfb..0e702eeea 100644 --- a/wezterm-gui/src/termwindow/render.rs +++ b/wezterm-gui/src/termwindow/render.rs @@ -442,11 +442,11 @@ impl super::TermWindow { config: &ConfigHandle, fontconfig: &wezterm_font::FontConfiguration, render_metrics: &RenderMetrics, - fancy_tab_bar_height: &Option, + fancy_tab_bar_height: Option, ) -> anyhow::Result { if config.use_fancy_tab_bar { if let Some(tab_bar_height) = fancy_tab_bar_height { - Ok(*tab_bar_height) + Ok(tab_bar_height) } else { let font = fontconfig.title_font()?; Ok((font.metrics().cell_height.get() as f32 * 1.75).ceil()) @@ -461,7 +461,9 @@ impl super::TermWindow { &self.config, &self.fonts, &self.render_metrics, - &self.fancy_tab_bar_height, + self.fancy_tab_bar + .as_ref() + .map(|elem| elem.content_rect.size.height), ) } @@ -854,8 +856,6 @@ impl super::TermWindow { if self.fancy_tab_bar.is_none() { let palette = self.palette().clone(); let tab_bar = self.build_fancy_tab_bar(&palette)?; - self.fancy_tab_bar_height - .replace(tab_bar.content_rect.size.height); self.fancy_tab_bar.replace(tab_bar); }