summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-07-27 15:02:42 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-07-27 15:06:07 (GMT)
commit4d4d2714aa9e4ee9bec005531b24442d0a1a8665 (patch)
tree5423e7e9ba45287598efdad257368d21fa637bd5
parent1a81f8d676d7481e58f44dbb380acffe0800d93d (diff)
downloadQt-4d4d2714aa9e4ee9bec005531b24442d0a1a8665.zip
Qt-4d4d2714aa9e4ee9bec005531b24442d0a1a8665.tar.gz
Qt-4d4d2714aa9e4ee9bec005531b24442d0a1a8665.tar.bz2
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
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp3
1 files changed, 2 insertions, 1 deletions
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));