Bug 66257 - alpha blending for selected icons does not work without word-wrap
Summary: alpha blending for selected icons does not work without word-wrap
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-20 01:26 UTC by Benoit Walter
Modified: 2004-02-05 14:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Normal unselected icon (5.38 KB, image/png)
2003-12-27 14:29 UTC, Martin Hignett
Details
Selected icon (5.76 KB, image/png)
2003-12-27 14:30 UTC, Martin Hignett
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benoit Walter 2003-10-20 01:26:18 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          GCC 3.2.3 (Debian) 
OS:          Linux

Alpha blending (for selected icons) works properly, but only when using word-wrap (Configure Konqueror->Appearance->Word-wrap Icon Text). When the checkbox is not checked, alpha will not work...
Comment 1 Martin Hignett 2003-12-27 14:29:36 UTC
Created attachment 3848 [details]
Normal unselected icon
Comment 2 Martin Hignett 2003-12-27 14:30:46 UTC
Created attachment 3849 [details]
Selected icon
Comment 3 Martin Hignett 2003-12-27 14:31:31 UTC
I'm having similar problems, but it appears on my desktop. When I single click an icon instead of doing a nice alpha-blend I get a horrible pixilation affect. I've attached two PNGs that show normal and selected icons. I thought at first this might be a problem with the NVidia driver, but it happens with both the Open Source X driver and the official closed source NVidia driver. In fact I've gone through innumerable permutations and combinations of drivers, kernels and Qt. At the moment I'm using KDE-CVS, Qt-CVS, the open source NVidia driver with linux kernel 2.6. If I revert back to KDE/Qt provided with SuSE 9.0 I don't see this problem.
Comment 4 S 2004-01-23 17:31:41 UTC
Same problem here. Get horible color mixup when selecting an icon. The problem wasnt here in 3.1.94 but it is now in 3.1.95.
Comment 5 Dan Christensen 2004-01-23 18:30:13 UTC
I'm getting the same problem here. I didn't have the problem in 3.1.94 but got it when I upgraded to 3.1.95. I installed 3.1.95 from the SuSE RPM's. 
Comment 6 Thomas Zell 2004-01-23 20:43:51 UTC
The problem went away after updating to kdelibs3-3.1.95-4.i586.rpm which you can find on the SuSE FTP now.
Comment 7 Benoit Walter 2004-01-23 22:28:47 UTC
Subject: Re:  alpha blending for selected icons does not work without word-wrap

Well, unless Suse applied their own patch which would really surprise me a 
lot, the problem did not go away. The reason why "word-wrap" icons differ 
from "normal" icons is that some methods of QIconViewItem have been 
reimplemented in KIconViewItem, mostly to improve the word-wrap algorithm. As 
the painting function had to be written again for word-wrap icons, the pixmap 
effect for selection has been changed to use alpha-blending.

Normal icons (with squeezed text) still use the Qt functions (and a simple but 
horrible effect for selected icons). Solving it would not be that difficult, 
but would require to duplicate some code (from QIconViewItem to 
KIconViewItem), only to change the pixmap effect for selection...

Just check the option named "Word wrap Icon Text" to see the difference. It is 
located in the "Appearance" section of the konqueror configure dialog. I will 
probably fix it one day,,, My opinion is that we should remove the word-wrap 
option and use a mixed mode instead: word wrap and squeeze text at the end of 
the 2nd line. David, do like that idea?

Comment 8 Benoit Walter 2004-02-05 14:42:10 UTC
Subject: kdelibs/kdeui

CVS commit by bwalter: 

Fixed bug #66257
CCMAIL: 66257-fixed@bugs.kde.org


  M +7 -11     kiconview.cpp   1.63


--- kdelibs/kdeui/kiconview.cpp  #1.62:1.63
@@ -528,9 +528,4 @@ void KIconViewItem::paintItem( QPainter 
     // ################ This prevents the use of KPixmapEffect::selectedPixmap
     // This really needs to be opened up in qt.
-    if ( !view->wordWrapIconText() )
-    {
-        QIconViewItem::paintItem( p, cg );
-        return;
-    }
 #ifndef NDEBUG // be faster for the end-user, such a bug will have been fixed before hand :)
     if ( !view->inherits("KIconView") )
@@ -540,9 +535,4 @@ void KIconViewItem::paintItem( QPainter 
     }
 #endif
-    if ( !m_wordWrap )
-    {
-        kdWarning() << "KIconViewItem::paintItem called but wordwrap not ready - calcRect not called, or aborted!" << endl;
-        return;
-    }
 
     p->save();
@@ -603,5 +593,11 @@ void KIconViewItem::paintText( QPainter 
 
     int align = iconView()->itemTextPos() == QIconView::Bottom ? AlignHCenter : AlignAuto;
+    if ( iconView()->wordWrapIconText() )
+    {
     m_wordWrap->drawText( p, textX, textY, align );
+    } else {
+        calcTmpText();
+        p->drawText( textRect( FALSE ), align, tempText() );
+    }
 }