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

List:       kde-commits
Subject:    kdepim/knode
From:       Jakob Schröter <cvsci () camaya ! net>
Date:       2004-10-28 17:42:36
Message-ID: 20041028174236.6602416C46 () office ! kde ! org
[Download RAW message or body]

CVS commit by schrot: 

make sure the 'unread msgs in thread'-counter is always visible in the msg list


  M +15 -9     knlistview.cpp   1.57


--- kdepim/knode/knlistview.cpp  #1.56:1.57
@@ -94,14 +94,20 @@ void KNLVItemBase::paintCell(QPainter *p
 
   if (width-xText-5 > 0) {
-    QString t = shortString(text(column),column,width-xText-5,p->fontMetrics());
-    p->drawText(xText, 0, width-xText-5, height(), alignment | AlignVCenter,  t);
+    int cntWidth = 0;
+    QString t2;
+    QFont f2;
     if (countUnreadInThread() > 0 && column==0 && !isOpen()) {
-      QString t2 = QString("   (%1)").arg(countUnreadInThread());
-      QFont orig=p->font();
-      QFont font=p->font();
-      font.setBold( true );
-      p->setFont(font);
-      QPen pen=p->pen();
-      if (isSelected()||a_ctive) {
+      t2 = QString("   (%1)").arg(countUnreadInThread());
+      f2 = p->font();
+      f2.setBold (true);
+      cntWidth = QFontMetrics(f2).width(t2, -1);
+    }
+    QString t = shortString(text(column),column,width-xText-cntWidth-5,p->fontMetrics());
+    p->drawText(xText, 0, width-xText-5, height(), alignment | AlignVCenter,  t);
+    if (cntWidth) {
+      QFont orig = p->font();
+      p->setFont( f2 );
+      QPen pen = p->pen();
+      if (isSelected() || a_ctive) {
         pen.setColor(cg.highlightedText());
       } else {


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

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