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

List:       kde-commits
Subject:    kdereview/rememberthemilk/applet
From:       Andrew Stromme <astromme () chatonka ! com>
Date:       2009-04-30 22:27:17
Message-ID: 1241130437.887843.19109.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 961904 by astromme:

Show the date as 'Jan 1' instead of '01/01/09'.
In sort by due mode, display the due date if the task is overdue

 M  +19 -6     taskitemdelegate.cpp  


--- trunk/kdereview/rememberthemilk/applet/taskitemdelegate.cpp #961903:961904
@@ -143,19 +143,32 @@
     painter->setPen(Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor));
 
     QString task = index.data(Qt::RTMNameRole).toString();
-    QString due = index.data(Qt::RTMDueRole).toDate().toString(Qt::DefaultLocaleShortDate);
 +    QString due = index.data(Qt::RTMDueRole).toDate().toString("MMM d");
     QString tags = index.data(Qt::RTMTagsRole).toStringList().join(", ");
     if (!tags.isEmpty())
       tags.prepend(tagsPrefix);
-
+    
     QFont font = painter->font();
     font.setPointSize(font.pointSize());
     QFontMetrics largerFM(font);
 
-    // Elide (text with dots like th...) if wider than view and draw
-    task = largerFM.elidedText(task, Qt::ElideRight, option.rect.width() - \
                4*MARGIN);
-    painter->setFont(font);
-    painter->drawText(option.rect.topLeft()+QPoint(2*MARGIN,largerFM.height()),task);
 +    if (smallTasks && index.data(Qt::RTMDueRole).toDate() < QDate::currentDate()) {
+      // Elide (text with dots like th...) if wider than view and draw
+      font.setBold(true);
+      task = largerFM.elidedText(task, Qt::ElideRight, option.rect.width() - \
4*MARGIN - QFontMetrics(font).width(due)); +      painter->setFont(font);
+      painter->drawText(option.rect.topLeft()+QPoint(2*MARGIN,largerFM.height()),due);
 +      
+      font.setBold(false);
+      painter->setFont(font);
+      painter->drawText(option.rect.topLeft()+QPoint(4*MARGIN + \
largerFM.width(due),largerFM.height()),task); +    }
+    else {
+       // Elide (text with dots like th...) if wider than view and draw
+      task = largerFM.elidedText(task, Qt::ElideRight, option.rect.width() - \
4*MARGIN); +      painter->setFont(font);
+      painter->drawText(option.rect.topLeft()+QPoint(2*MARGIN,largerFM.height()),task);
 +    }
 
     if (smallTasks) {
       painter->restore();


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

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