Bug 222794

Summary: visual glitch in KCategorizedView
Product: [Frameworks and Libraries] kdelibs Reporter: Hugo Pereira Da Costa <hugo.pereira.da.costa>
Component: generalAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: hugo.pereira.da.costa, pano_90, peter.penz19
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: show bottom-truncated category text

Description Hugo Pereira Da Costa 2010-01-15 00:30:59 UTC
Version:           svn trunk (using Devel)
OS:                Linux
Installed from:    Compiled sources

Bottom of category text in kcategorized view is truncated. 
This happens in systemsettings->desktop->desktop effects->all effects, as well as in amarok->configure amarok->internet services.

Tried styles oxygen, cleanlooks, plastique.
(see screenshot)

This was not the case in kde4.3 (but the category text was rendered differently.
Comment 1 Hugo Pereira Da Costa 2010-01-15 00:31:56 UTC
Created attachment 39908 [details]
show bottom-truncated category text
Comment 2 Hugo Pereira Da Costa 2010-01-15 00:44:21 UTC
Following patch should fix it:

===================================================================
--- kdelibs/kdeui/itemviews/kcategorydrawer.cpp (revision 1074886)
+++ kdelibs/kdeui/itemviews/kcategorydrawer.cpp (working copy)
@@ -143,8 +143,10 @@
         textRect.setLeft(textRect.left() + 7);
         textRect.setHeight(fontMetrics.height());
         textRect.setRight(textRect.right() - 7);
-        textRect.setBottom(textRect.bottom() - 5); // only one pixel separation here (no gradient)

+        // this is wrong. This truncates the text to be drawn.
+        //textRect.setBottom(textRect.bottom() - 5); // only one pixel separation here (no gradient)
+
         painter->save();
         painter->setFont(font);
         QColor penColor(option.palette.text().color());

(since the rect height is set to the fontMetrics, it should _not_ be reduced using "setBottom" immediately after, otherwise the text is obviously truncated as described in the bug. I think)
Comment 3 Christoph Feck 2010-01-15 01:23:10 UTC
*** Bug 215586 has been marked as a duplicate of this bug. ***
Comment 4 Hugo Pereira Da Costa 2010-01-15 16:43:59 UTC
SVN commit 1075141 by hpereiradacosta:

Fix visual bug in category drawing. The text is truncated at the bottom because 
textRect height is shorten after it has been adjusted to the fontmetrics. I just 
removed the corresponding line of code
CCBUG: 222794
 --This line, and those below, will be ignored--

M    kcategorydrawer.cpp


 M  +0 -1      kcategorydrawer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1075141
Comment 5 Hugo Pereira Da Costa 2010-01-15 16:46:25 UTC
SVN commit 1075143 by hpereiradacosta:

Backport r1075141.
Fix visual bug in category text drawing.
The text is truncated at the bottom because textRect height is shorten after it has 
been adjusted to the fontmetrics. I just removed the corresponding line of code.
BUG: 222794



 M  +0 -1      kcategorydrawer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1075143