From: <it_...@us...> - 2009-05-17 10:05:22
|
Revision: 4841 http://kmess.svn.sourceforge.net/kmess/?rev=4841&view=rev Author: it_amroth Date: 2009-05-17 10:05:16 +0000 (Sun, 17 May 2009) Log Message: ----------- Fixed displaying labels in the contact list. Modified Paths: -------------- trunk/kmess/ChangeLog trunk/kmess/src/kmessviewdelegate.cpp Modified: trunk/kmess/ChangeLog =================================================================== --- trunk/kmess/ChangeLog 2009-05-17 02:03:07 UTC (rev 4840) +++ trunk/kmess/ChangeLog 2009-05-17 10:05:16 UTC (rev 4841) @@ -1,4 +1,7 @@ +2009-05-17 (Valerio) + * Fixed displaying labels in the contact list. + 2009-05-17 (Pano) * Merged an updated Brazilian Portuguese translation by Maurício Arozi Moraes. Modified: trunk/kmess/src/kmessviewdelegate.cpp =================================================================== --- trunk/kmess/src/kmessviewdelegate.cpp 2009-05-17 02:03:07 UTC (rev 4840) +++ trunk/kmess/src/kmessviewdelegate.cpp 2009-05-17 10:05:16 UTC (rev 4841) @@ -52,6 +52,7 @@ // Create the document used to render the HTML text labels textDocument_ = new QTextDocument(); #if QT_VERSION >= 0x040500 + // Qt >= 4.5 started applying a 4px border by default textDocument_->setDocumentMargin( 0 ); #endif @@ -199,7 +200,9 @@ QPoint iconPoint( originPoint ); QPoint picturePoint( originPoint ); - QRect labelRect( option.rect.adjusted( ITEM_SPACE, 0, -ITEM_SPACE, 0 ) ); + // Labels get adjusted to 2 pixels below the top border, because otherwise, they get painted + // too close to the top border + QRect labelRect( option.rect.adjusted( ITEM_SPACE, 2, -ITEM_SPACE, 0 ) ); // Group item positions if( itemData[ "type" ].toInt() == ContactListModelItem::ItemGroup ) @@ -422,6 +425,8 @@ // The painter will be used to blend the label with the gradient QPainter p( &image ); p.translate( 0, 0 ); + p.setRenderHints( QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing, + true ); // Paint the label over the image textDocument_->drawContents( &p, labelRect ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |