[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-cygwin
Subject:    [PATCH]Mouse-over effects don't work properly in QToolBox buttons
From:       REGAT-BARREL Aurelien <arbvtk () yahoo ! fr>
Date:       2004-12-16 0:05:29
Message-ID: 20041216000529.26502.qmail () web25209 ! mail ! ukl ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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<------------------------------------------

 
Regards.
 
Aurelien Regat-Barrel


Aurelien REGAT-BARREL 




		
---------------------------------
 Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail


[Attachment #5 (text/html)]

<DIV>Hi,</DIV>
<DIV>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.&nbsp; 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.</DIV> \
<DIV>---------------------------------------8&lt;------------------------------------------</DIV>
 <DIV>diff -u -r1.1.1.1 qcommonstyle.cpp<BR>--- qcommonstyle.cpp&nbsp;15 Dec 2004 \
23:06:00 -0000&nbsp;1.1.1.1<BR>+++ qcommonstyle.cpp&nbsp;15 Dec 2004 23:52:53 \
-0000<BR>@@ -1590,9 +1590,10 @@<BR>&nbsp;&nbsp;&nbsp;mflags |= \
Style_Down;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (controls &amp; \
SC_ToolButton) {<BR>-&nbsp;&nbsp;if (bflags &amp; (Style_Down | Style_On | \
Style_Raised)) {<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; drawPrimitive(PE_ButtonTool, p, \
button, c, bflags, opt);<BR>-&nbsp;&nbsp;} else if ( toolbutton-&gt;parentWidget() \
&amp;&amp;<BR>+&nbsp;&nbsp;//if (bflags &amp; (Style_Down | Style_On | Style_Raised)) \
{<BR>+&nbsp;&nbsp;drawPrimitive(PE_ButtonTool, p, button, c, bflags, \
opt);<BR>+&nbsp;&nbsp;//} else <BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( \
toolbutton-&gt;parentWidget() &amp;&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
toolbutton-&gt;parentWidget()-&gt;backgroundPixmap() \
&amp;&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !  \
toolbutton-&gt;parentWidget()-&gt;backgroundPixmap()-&gt;isNull() ) \
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; QPixmap pixmap =<BR> \
<DIV>---------------------------------------8&lt;------------------------------------------</DIV></DIV>
 <DIV>&nbsp;</DIV>
<DIV>Regards.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Aurelien Regat-Barrel</DIV><BR><BR><DIV>
<DIV>
<DIV>Aurelien REGAT-BARREL <BR></DIV></DIV></DIV><p>
		<hr size=1> 
Découvrez le nouveau Yahoo! Mail : <font color="red">250 Mo d'espace</font> de \
stockage pour vos mails !<br><a \
href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/evt=25917/*http://f \
r.rd.yahoo.com/mail_fr/mail_campaigns/splash/taglines_250/default/*http://fr.promotions.yahoo.com/mail/creer28.html">Créez \
votre Yahoo! Mail</a>



_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic