Don't highlight window titles when interacting with the window

It is very distracting.
This commit is contained in:
Emil Ernerfeldt 2021-01-16 01:47:21 +01:00
parent 60006cd9c6
commit a5ce1ba711

View file

@ -341,7 +341,6 @@ impl<'open> Window<'open> {
&mut area_content_ui, &mut area_content_ui,
outer_rect, outer_rect,
&content_response, &content_response,
&interaction,
open, open,
&mut collapsing, &mut collapsing,
collapsible, collapsible,
@ -703,13 +702,11 @@ fn show_title_bar(
} }
impl TitleBar { impl TitleBar {
#[allow(clippy::too_many_arguments)] // TODO
fn ui( fn ui(
mut self, mut self,
ui: &mut Ui, ui: &mut Ui,
outer_rect: Rect, outer_rect: Rect,
content_response: &Option<Response>, content_response: &Option<Response>,
interaction: &Option<WindowInteraction>,
open: Option<&mut bool>, open: Option<&mut bool>,
collapsing: &mut collapsing_header::State, collapsing: &mut collapsing_header::State,
collapsible: bool, collapsible: bool,
@ -726,14 +723,9 @@ impl TitleBar {
} }
} }
let is_moving_window = interaction // Always have inactive style for the window.
.map(|interaction| !interaction.is_resize()) // It is VERY annoying to e.g. change it when moving the window.
.unwrap_or(false); let style = ui.style().visuals.widgets.inactive;
let style = if is_moving_window {
ui.style().visuals.widgets.hovered
} else {
ui.style().visuals.widgets.inactive
};
self.title_label = self.title_label.text_color(style.fg_stroke.color); self.title_label = self.title_label.text_color(style.fg_stroke.color);