From 4d4d2714aa9e4ee9bec005531b24442d0a1a8665 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Mon, 27 Jul 2009 17:02:42 +0200 Subject: Don't animate widgets on first show in Vista Checkboxes would animate when first shown if they were checked. This is unintentional and looks a bit odd in wizard for instance. To fix this we simply check if the old state was set. Note that this is safe because we will at least require the enabled state flag to be set. Task-number:253075 Reviewed-by: ogoffart --- src/gui/styles/qwindowsvistastyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 298207d..6f3017a 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -364,7 +364,8 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt w->setProperty("_q_stylestate", (int)option->state); w->setProperty("_q_stylerect", w->rect()); - bool doTransition = ((state & State_Sunken) != (oldState & State_Sunken) || + bool doTransition = oldState && + ((state & State_Sunken) != (oldState & State_Sunken) || (state & State_On) != (oldState & State_On) || (state & State_MouseOver) != (oldState & State_MouseOver)); -- cgit v0.12