Bug 256145 - Korganizer text align bug ?
Summary: Korganizer text align bug ?
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-05 14:25 UTC by Aaron Lewis
Modified: 2010-12-31 02:41 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Korganizer-SummaryTableWidget-Text-Align (43.92 KB, image/png)
2010-11-05 14:25 UTC, Aaron Lewis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Lewis 2010-11-05 14:25:42 UTC
Created attachment 53160 [details]
Korganizer-SummaryTableWidget-Text-Align

Version:           unspecified (using Devel) 
OS:                Linux

See uploaded picture.

Text Alignment for the Table Widget on the left

Reproducible: Always
Comment 1 Aaron Lewis 2010-11-05 14:26:12 UTC
KDELIBS 4.5.3
ORganizer 4.4.7
Comment 2 Sergio Martins 2010-12-31 02:41:38 UTC
commit e7a26ec0756ee5bdad9c040fc0aef9c6ee67e6f5
branch master
Author: Sergio Martins <iamsergio@gmail.com>
Date:   Fri Dec 31 01:39:56 2010 +0000

    Center these columns in to-do view: priority, recurs, percent and due date.
    They were already centered in the header.
    BUG: 256145

diff --git a/korganizer/views/todoview/kotodomodel.cpp b/korganizer/views/todoview/kotodomodel.cpp
index 4d7b83f..64dafcb 100644
--- a/korganizer/views/todoview/kotodomodel.cpp
+++ b/korganizer/views/todoview/kotodomodel.cpp
@@ -776,6 +776,18 @@ QVariant KOTodoModel::data( const QModelIndex &index, int role ) const
     }
   }
 
+  if ( role == Qt::TextAlignmentRole ) {
+    switch ( index.column() ) {
+      // If you change this, change headerData() too.
+      case RecurColumn:
+      case PriorityColumn:
+      case PercentColumn:
+      case DueDateColumn:
+        return QVariant( Qt::AlignHCenter );
+    }
+    return QVariant();
+  }
+
   return QVariant();
 }
 
@@ -812,9 +824,11 @@ QVariant KOTodoModel::headerData( int column,
 
   if ( role == Qt::TextAlignmentRole ) {
     switch ( column ) {
+      // If you change this, change data() too.
       case RecurColumn:
       case PriorityColumn:
       case PercentColumn:
+      case DueDateColumn:
         return QVariant( Qt::AlignHCenter );
     }
     return QVariant();