From 86c8bc57a5c5e2093194abf10ad6331de50cfd33 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 3 Nov 2017 10:01:51 -0300 Subject: [PATCH] Avoid redrawing the whole PaletteView when we move the mouse between color entries --- src/app/ui/palette_view.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/ui/palette_view.cpp b/src/app/ui/palette_view.cpp index ac6af6a52..fcbf12871 100644 --- a/src/app/ui/palette_view.cpp +++ b/src/app/ui/palette_view.cpp @@ -413,8 +413,13 @@ bool PaletteView::onProcessMessage(Message* msg) MouseMessage* mouseMsg = static_cast(msg); Hit hit = hitTest(mouseMsg->position() - bounds().origin()); if (hit != m_hot) { + // Redraw only when we put the mouse in other part of the + // widget (e.g. if we move from color to color, we don't want + // to redraw the whole widget). + if (hit.part != m_hot.part) + invalidate(); + m_hot = hit; - invalidate(); } setCursor(); return true;