Bug 222794 - visual glitch in KCategorizedView
Summary: visual glitch in KCategorizedView
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 215586 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-01-15 00:30 UTC by Hugo Pereira Da Costa
Modified: 2010-01-15 16:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
show bottom-truncated category text (30.21 KB, image/png)
2010-01-15 00:31 UTC, Hugo Pereira Da Costa
Details

Note You need to log in before you can comment on or make changes to this bug.
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