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

List:       kmail-devel
Subject:    Re: [PATCH] Fix drawing
From:       Carsten Burghardt <burghardt () kde ! org>
Date:       2002-12-31 10:04:01
[Download RAW message or body]

Am Dienstag, 31. Dezember 2002 08:34 schrieb Carsten Burghardt:
> Hi,
>
> I just noticed that the count of the separate unread-column is not drawn
> bold, the attached patch fixes this and cleans the method a bit so that
> it's easier to debug.
>
> Regards,
>
> Carsten

I'm sorry, this was the wrong patch, next try.
["kfoldertree.diff" (text/x-diff)]

Index: kdenetwork/libkdenetwork/kfoldertree.cpp
===================================================================
RCS file: /home/kde/kdenetwork/libkdenetwork/kfoldertree.cpp,v
retrieving revision 1.23.2.1
diff -u -3 -p -r1.23.2.1 kfoldertree.cpp
--- kdenetwork/libkdenetwork/kfoldertree.cpp	12 Dec 2002 18:38:57 -0000	1.23.2.1
+++ kdenetwork/libkdenetwork/kfoldertree.cpp	31 Dec 2002 10:03:50 -0000
@@ -150,49 +150,46 @@ void KFolderTreeItem::paintCell( QPainte
   
   KListViewItem::paintCell( p, cg, column, width, align );
 
-  if (column == 0) 
-  {
-    KFolderTree *ft = static_cast<KFolderTree*>(listView());
-    int r = lv ? lv->itemMargin() : 1;
-    const QPixmap *icon = pixmap( column );
-    int marg = lv ? lv->itemMargin() : 1;
+  KFolderTree *ft = static_cast<KFolderTree*>(listView());
+  int r = lv ? lv->itemMargin() : 1;
+  const QPixmap *icon = pixmap( column );
+  int marg = lv ? lv->itemMargin() : 1;
 
-    QString t;
-    QRect br;
-    setText( 0, oldText );
-    if ( isSelected() )
-      p->setPen( cg.highlightedText() );
-    else
-      p->setPen( ft->paintInfo().colFore );
+  QString t;
+  QRect br;
+  setText( 0, oldText );
+  if ( isSelected() )
+    p->setPen( cg.highlightedText() );
+  else
+    p->setPen( ft->paintInfo().colFore );
 
-    if ( icon ) {
-      r += icon->width() + lv->itemMargin();
-    }
-    t = text( column );
-    if ( !t.isEmpty() ) 
+  if ( icon ) {
+    r += icon->width() + lv->itemMargin();
+  }
+  t = text( column );
+  if ( !t.isEmpty() ) 
+  {
+    // use a bold-font for the folder- and the unread-columns
+    if ( countUnreadRecursive() > 0 &&
+        (column == 0 || column == ft->unreadIndex()) ) 
     {
-      // use a bold-font for the folder- and the unread-columns
-      if ( countUnreadRecursive() > 0 &&
-          (column == 0 || column == ft->unreadIndex()) ) 
-      {
-        QFont f = p->font();
-        f.setWeight(QFont::Bold);
-        p->setFont(f);
-      }
-      p->drawText( r, 0, width-marg-r, height(),
-          align | AlignVCenter, t, -1, &br );
-      if (!isSelected())
-        p->setPen( ft->paintInfo().colUnread );
-      if (column == 0) {
-        // draw the unread-count if the unread-column is not active
-        QString unread = QString::null;
-        if ( !ft->isUnreadActive() && mUnread > 0 ) 
-          unread = " (" + QString::number(mUnread) + ")";
-        p->drawText( br.right(), 0, width-marg-br.right(), height(),
-            align | AlignVCenter, unread );
-      }
-    } // end !t.isEmpty()
-  } // end column = 0
+      QFont f = p->font();
+      f.setWeight(QFont::Bold);
+      p->setFont(f);
+    }
+    p->drawText( r, 0, width-marg-r, height(),
+        align | AlignVCenter, t, -1, &br );
+    if (!isSelected())
+      p->setPen( ft->paintInfo().colUnread );
+    if (column == 0) {
+      // draw the unread-count if the unread-column is not active
+      QString unread = QString::null;
+      if ( !ft->isUnreadActive() && mUnread > 0 ) 
+        unread = " (" + QString::number(mUnread) + ")";
+      p->drawText( br.right(), 0, width-marg-br.right(), height(),
+          align | AlignVCenter, unread );
+    }
+  } // end !t.isEmpty()
 }
 
 

_______________________________________________
KMail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail

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

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