From a5ce1ba7111b021365000e9cca456f4805ab4cb0 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sat, 16 Jan 2021 01:47:21 +0100 Subject: [PATCH] Don't highlight window titles when interacting with the window It is very distracting. --- egui/src/containers/window.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/egui/src/containers/window.rs b/egui/src/containers/window.rs index 2a499068..927d0a75 100644 --- a/egui/src/containers/window.rs +++ b/egui/src/containers/window.rs @@ -341,7 +341,6 @@ impl<'open> Window<'open> { &mut area_content_ui, outer_rect, &content_response, - &interaction, open, &mut collapsing, collapsible, @@ -703,13 +702,11 @@ fn show_title_bar( } impl TitleBar { - #[allow(clippy::too_many_arguments)] // TODO fn ui( mut self, ui: &mut Ui, outer_rect: Rect, content_response: &Option, - interaction: &Option, open: Option<&mut bool>, collapsing: &mut collapsing_header::State, collapsible: bool, @@ -726,14 +723,9 @@ impl TitleBar { } } - let is_moving_window = interaction - .map(|interaction| !interaction.is_resize()) - .unwrap_or(false); - let style = if is_moving_window { - ui.style().visuals.widgets.hovered - } else { - ui.style().visuals.widgets.inactive - }; + // Always have inactive style for the window. + // It is VERY annoying to e.g. change it when moving the window. + let style = ui.style().visuals.widgets.inactive; self.title_label = self.title_label.text_color(style.fg_stroke.color);