Bug 218103

Summary: Description cutted when there is more than 3 lines ( Journal part )
Product: [Applications] korganizer Reporter: Nicolas L. <kde>
Component: journalviewAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: gustavo.boiko, winter
Priority: NOR    
Version: 4.3   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Unspecified   
Latest Commit: Version Fixed In:
Attachments: screenshot of the bug is not RichText
with and without RichText
Align the description at top so that it won't be cut if it has more than two lines
the patch in attachment

Description Nicolas L. 2009-12-10 12:34:58 UTC
Version:            (using Devel)
Installed from:    Compiled sources

In Korganizer on the Journal mode, if there is more than 3 lines in the description the top of the first line is cutted.
Comment 1 Allen Winter 2009-12-13 22:26:37 UTC
is this when printing the journal? or when looking at the journal in the actual view?
Comment 2 Nicolas L. 2009-12-14 00:34:48 UTC
Created attachment 39034 [details]
screenshot of the bug is not RichText
Comment 3 Nicolas L. 2009-12-14 00:40:15 UTC
this is supposed to be :


1111111111111111111111111111111111111111
2
3
Comment 4 Nicolas L. 2010-01-04 18:33:21 UTC
Created attachment 39559 [details]
with and without RichText

The first line is with RichText enabled and the second one w/o
Comment 5 Gustavo Pichorim Boiko 2010-01-05 14:41:39 UTC
Created attachment 39582 [details]
Align the description at top so that it won't be cut if it has more than two lines

This patch fixes the problem by aligning the text at top so that just the extra lines are cut when the description has more than two lines.
Comment 6 Gustavo Pichorim Boiko 2010-01-05 14:56:40 UTC
Ops, just saw the patch looks strage, my svn is doing something weird here when diff'ing. Sorry

Nicolas, can you please attach a fixed version of the patch?
Comment 7 Nicolas L. 2010-01-05 14:56:59 UTC
here is a patch with correct line numbers :)

Index: korganizer/views/todoview/kotododelegates.cpp
===================================================================
--- korganizer/views/todoview/kotododelegates.cpp
+++ korganizer/views/todoview/kotododelegates.cpp   2010-01-05 14:50:57.000000000 +0100
@@ -455,7 +455,11 @@

     painter->restore();
   } else {
-    QStyledItemDelegate::paint( painter, option, index );
+    // align the text at top so that when it has more than two lines
+    // it will just cut the extra lines out instead of aligning centered vertically
+    QStyleOptionViewItem copy = option;
+    copy.displayAlignment = Qt::AlignLeft | Qt::AlignTop;
+    QStyledItemDelegate::paint( painter, copy, index );
   }
 }
Comment 8 Nicolas L. 2010-01-05 15:03:21 UTC
Created attachment 39583 [details]
the patch in attachment
Comment 9 Allen Winter 2010-01-05 15:52:05 UTC
permission granted to commit this patch to trunk.
thanks guys
Comment 10 Gustavo Pichorim Boiko 2010-01-05 16:28:43 UTC
SVN commit 1070408 by boiko:

Draw the description aligned at top so that if it has more than two lines the 
additional lines are not drawn

BUG: 218103


 M  +5 -1      kotododelegates.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1070408