Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] r58469 - /trunk/control-center/src/moduleiconitem.cpp
  • From: kmachalkova@xxxxxxxxxxxxxxxx
  • Date: Tue, 01 Sep 2009 09:54:14 -0000
  • Message-id: <E1MiQ46-0002fS-L1@xxxxxxxxxxxxxxxx>
Author: kmachalkova
Date: Tue Sep 1 11:54:14 2009
New Revision: 58469

URL: http://svn.opensuse.org/viewcvs/yast?rev=58469&view=rev
Log:
Use more contrast colours, use wider text margin

Modified:
trunk/control-center/src/moduleiconitem.cpp

Modified: trunk/control-center/src/moduleiconitem.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/control-center/src/moduleiconitem.cpp?rev=58469&r1=58468&r2=58469&view=diff
==============================================================================
--- trunk/control-center/src/moduleiconitem.cpp (original)
+++ trunk/control-center/src/moduleiconitem.cpp Tue Sep 1 11:54:14 2009
@@ -59,8 +59,7 @@
style = QApplication::style();
}

-
- QPen p = painter->pen();
+ QFont f = painter->font();
if (selected || mouseover)
{
if (selected)
@@ -73,20 +72,22 @@
QColor hover = option.palette.color(QPalette::Highlight);
hover.setAlpha(88);
painter->fillPath(roundedRectangle(option.rect, 10), hover);
-
- QColor inv = option.palette.color( QPalette::WindowText );
- inv.setAlpha(100);
- painter->setPen( inv );
+ painter->setPen( option.palette.color( QPalette::WindowText ) );
}
+ QFont newFont = option.font;
+ newFont.setPointSize( option.font.pointSize() - 2);
+ QFontMetrics newFm = QFontMetrics( newFont );

- QString descr = option.fontMetrics.elidedText( index.data(
YQModulesModel::GenericNameRole ).toString(), Qt::ElideRight,
option.rect.width() );
+ QString descr = newFm.elidedText( index.data(
YQModulesModel::GenericNameRole ).toString(), Qt::ElideRight,
option.rect.width() );
QRect tr = option.rect;
tr.setTop( tr.top() + decorationSize.height() +
2*style->pixelMetric( QStyle::PM_FocusFrameVMargin) );
+ tr.setLeft( tr.left() + 2*style->pixelMetric(
QStyle::PM_FocusFrameHMargin ));
+
+ painter->setFont( newFont);
painter->drawText( tr, Qt::AlignLeft | Qt::TextSingleLine, descr );

}
- painter->setPen( p );
-
+ painter->setFont( f );
// if( index.data( Qt::UserRole ).toInt() == KIconLoader::DisabledState ) {
// painter->setPen( option.palette.color( QPalette::Disabled,
QPalette::Text ) );
// }

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages