remove a couple of tricks used prior to the selection rect that now look over the top

* don't bold on hover for a calmer look
 * don't scale down the icons (made them blurry anyways)

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=793687
This commit is contained in:
Aaron J. Seigo 2008-04-04 20:17:49 +00:00
parent 9859202dbe
commit e36acd4151

View File

@ -306,31 +306,20 @@ void Delegate::paint(QPainter *painter, const QStyleOptionViewItem& option, cons
QIcon decorationIcon = index.data(Qt::DecorationRole).value<QIcon>(); QIcon decorationIcon = index.data(Qt::DecorationRole).value<QIcon>();
if (index.data(d->roles[ColumnTypeRole]).toInt() == SecondaryActionColumn) { if (index.data(d->roles[ColumnTypeRole]).toInt() == SecondaryActionColumn) {
if (hover) { if (hover) {
// Only draw on hover
const int delta = floor((qreal)(ICON_SIZE - ACTION_ICON_SIZE)/2.0); const int delta = floor((qreal)(ICON_SIZE - ACTION_ICON_SIZE)/2.0);
decorationRect.adjust(delta, delta-1, -delta-1, -delta); decorationRect.adjust(delta, delta-1, -delta-1, -delta);
decorationIcon.paint(painter, decorationRect, option.decorationAlignment); decorationIcon.paint(painter, decorationRect, option.decorationAlignment);
} }
//If not hover don't draw anything
// as default always draw as main column
} else { } else {
if (!hover) { // as default always draw as main column
decorationRect.adjust(2, 2, -2, -2);
}
decorationIcon.paint(painter, decorationRect, option.decorationAlignment); decorationIcon.paint(painter, decorationRect, option.decorationAlignment);
} }
painter->save(); painter->save();
// draw title // draw title
if (hover) {
titleFont.setBold(true);
}
painter->setFont(titleFont); painter->setFont(titleFont);
painter->drawText(titleRect, Qt::AlignLeft|Qt::AlignVCenter, titleText); painter->drawText(titleRect, Qt::AlignLeft|Qt::AlignVCenter, titleText);