Bug 64083 - list view branches misdrawn if items are hidden
Summary: list view branches misdrawn if items are hidden
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kstyle (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Karol Szwed
URL:
Keywords:
: 65976 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-11 16:34 UTC by _
Modified: 2004-02-01 17:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
do not extend dotlinery for a hidden item (1.50 KB, patch)
2003-11-23 17:44 UTC, Maksim Orlovich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ 2003-09-11 16:34:46 UTC
Version:           0.7.91>=20030909 (using KDE 3.1.3)
Installed from:    compiled sources
Compiler:          gcc version 3.2.2
OS:          Linux (i686) release 2.4.22.2-mark-athlon-

this is just some silly thing, but if u hide something (offline users, empty groups), the contact list tree shows up strange: under the [+], [-] or left of the contact icon, there are these dots.
Simply reproducable:
1. Make sure you have some empty groups and the bottom group is empty
2. Hide empty groups
3. Check the side of the tree! shows up v. weird.

i'll make a screenshot if i have time.
Comment 1 Martijn Klingens 2003-09-11 16:48:57 UTC
Subject: Re: [Kopete-devel]   New: contact list hiding mistake (cosmetical)

Bug in QListView. Known already to TT. I don't expect a fix though as 
QListView will disappear in Qt 4. Feel free to submit your own patch :)

Comment 2 _ 2003-09-11 17:04:08 UTC
not an expert at this... 
Comment 3 Casey Allen Shobe 2003-10-13 23:28:00 UTC
*** Bug 65976 has been marked as a duplicate of this bug. ***
Comment 4 Casey Allen Shobe 2003-10-13 23:29:13 UTC
*sigh*...not fixed...invalid.  
Comment 5 Casey Allen Shobe 2003-10-13 23:29:42 UTC
QT bug. 
Comment 6 Richard Smith 2003-11-23 16:55:20 UTC
Actually not. QListView drawing for KDE styles is done by code in kdelibs/kdefx. Qt is broken too, of course, but we can fix this.
Comment 7 Maksim Orlovich 2003-11-23 17:44:51 UTC
Created attachment 3362 [details]
do not extend dotlinery for a hidden item

Patch attached. Not sure whether I want to touch this before 3.2, though ---
the code is non-trivial, while the bug is very minor.
Comment 8 Maksim Orlovich 2004-02-01 17:02:40 UTC
Subject: kdelibs/kdefx

CVS commit by orlovich: 

Fully skip invisible items to avoid drawing "extra" lines if some end items are invisible. 
(#64083)
CCMAIL:64083-done@bugs.kde.org


  M +14 -2     kstyle.cpp   1.47


--- kdelibs/kdefx/kstyle.cpp  #1.46:1.47
@@ -985,4 +985,16 @@ int KStyle::pixelMetric(PixelMetric m, c
 }
 
+//Helper to find the next sibling that's not hidden
+static QListViewItem* nextVisibleSibling(QListViewItem* item)
+{
+    QListViewItem* sibling = item;
+    do
+    {
+        sibling = sibling->nextSibling();
+    }
+    while (sibling && !sibling->isVisible());
+    
+    return sibling;
+}
 
 void KStyle::drawComplexControl( ComplexControl control,
@@ -1213,8 +1225,8 @@ void KStyle::drawComplexControl( Complex
 
                                                 y += child->totalHeight();
-                                                child = child->nextSibling();
+                                                child = nextVisibleSibling(child);
                                         }
 
-                                        if ( child ) // there's a child, so move linebot to edge of rectangle
+                                        if ( child ) // there's a child to draw, so move linebot to edge of rectangle
                                                 linebot = r.height();