[PATCH]Mouse-over effects don't work properly in QToolBox buttons

Chris January chris at atomice.net
Thu Dec 16 11:07:53 CET 2004


Thanks for trying to fix this, but qcommonstyle.cpp is not a
Windows-specific file and as such it is our policy not to change it (the X11
version works just fine with this code as it is). Perhaps you can find a fix
that only touches _win.cpp files?
 
Chris

Hi,
In styles/qcommonstyle.cpp, the function drawComplexControl is called at
least by QToolBox buttons to draw / clear the shape. The function tests for
flags (Style_Down | Style_On | Style_Raised), and in such a case it draws
the shape by calling drawPrimitive. If not, nothing is done, and so if a
shape was previously painted, it is not erased.  drawPrimitive already tests
for this flags, and if they are not present, it erase the shape. So the test
is unneeded, and removing it corrects the bug.
---------------------------------------8<-----------------------------------
-------
diff -u -r1.1.1.1 qcommonstyle.cpp
--- qcommonstyle.cpp 15 Dec 2004 23:06:00 -0000 1.1.1.1
+++ qcommonstyle.cpp 15 Dec 2004 23:52:53 -0000
@@ -1590,9 +1590,10 @@
   mflags |= Style_Down;
 
      if (controls & SC_ToolButton) {
-  if (bflags & (Style_Down | Style_On | Style_Raised)) {
-      drawPrimitive(PE_ButtonTool, p, button, c, bflags, opt);
-  } else if ( toolbutton->parentWidget() &&
+  //if (bflags & (Style_Down | Style_On | Style_Raised)) {
+  drawPrimitive(PE_ButtonTool, p, button, c, bflags, opt);
+  //} else 
+        if ( toolbutton->parentWidget() &&
      toolbutton->parentWidget()->backgroundPixmap() &&
      ! toolbutton->parentWidget()->backgroundPixmap()->isNull() ) {
       QPixmap pixmap =

---------------------------------------8<-----------------------------------
-------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-cygwin/attachments/20041216/9fdef26a/attachment.html


More information about the kde-cygwin mailing list