From ceab9903cda2929b0dc8b5c245854c81f028ab29 Mon Sep 17 00:00:00 2001 From: MacDue Date: Tue, 7 Jun 2022 23:37:00 +0100 Subject: [PATCH] MouseSettings: Avoid rendering artifact on loading highlighting defaults Occasionally, the top of the preview would have the wrong opacity. This seems to be solved by updating the widget again a bit after setting the values. --- Userland/Applications/MouseSettings/HighlightWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Applications/MouseSettings/HighlightWidget.cpp b/Userland/Applications/MouseSettings/HighlightWidget.cpp index cf423bbbdf3..2a3293b3726 100644 --- a/Userland/Applications/MouseSettings/HighlightWidget.cpp +++ b/Userland/Applications/MouseSettings/HighlightWidget.cpp @@ -75,4 +75,8 @@ void HighlightWidget::reset_default_values() m_highlight_opacity_slider->set_value(default_highlight_opacity); m_highlight_color_input->set_color(default_highlight_color); m_highlight_radius_slider->set_value(default_highlight_radius_length); + deferred_invoke([&] { + // Avoid artifact due to setting both color and opacity sliders: + m_highlight_preview->update(); + }); }