On Wednesday 19 November 2008 11:17:28 Aaron J. Seigo wrote: > On Wednesday 19 November 2008, Jesse Zamora wrote: > > EDIT: I am noticing that on the items with the gradient, it really starts > > to slow down. Any suggestions? > > arg. once again, reviewboard is not showing me your patch. sorry, can you > forward it on here? and what do you mean by "starts to slow down" > precisely?
Well, on the items that have the gradient (i.e., the items that are too long and have a gradient to make them look better), the painting slows WAY WAY down.........I don't know how I could make it not be so slow! :-( Xtreme Kommander
Index: delegate.cpp =================================================================== --- delegate.cpp (revision 886515) +++ delegate.cpp (working copy) @@ -224,6 +224,9 @@ contentRect.adjusted(DelegatePrivate::ITEM_LEFT_MARGIN, DelegatePrivate::ITEM_TOP_MARGIN, -DelegatePrivate::ITEM_RIGHT_MARGIN, -DelegatePrivate::ITEM_BOTTOM_MARGIN)); decorationRect.moveTop(contentRect.top() + qMax(0, (contentRect.height() - decorationRect.height())) / 2); + QFont titleFont(option.font); + QFont subTitleFont = d->fontForSubTitle(option.font); + QString titleText = index.data(Qt::DisplayRole).value<QString>(); QString subTitleText = index.data(d->roles[SubTitleRole]).value<QString>(); @@ -249,10 +252,6 @@ subTitleText.clear(); } - QFont subTitleFont = d->fontForSubTitle(option.font); - - QFont titleFont(option.font); - if (hover) { painter->save(); painter->setRenderHint(QPainter::Antialiasing); @@ -357,7 +356,12 @@ // required to understand the item itself and that showing all the subtexts in a // listing makes the information density very high, impacting both the speed at // which one can scan the list visually and the aesthetic qualities of the listing. - painter->setPen(QPen(KColorScheme(QPalette::Active).foreground(KColorScheme::InactiveText), 1)); + + QColor subTitleColor = KColorScheme(QPalette::Active).foreground(KColorScheme::InactiveText).color(); + QLinearGradient textGradient(option.rect.topLeft(), option.rect.topRight()); + textGradient.setColorAt(0.85, subTitleColor); + textGradient.setColorAt(1.0, Qt::transparent); + painter->setPen(QPen(textGradient, 1)); painter->setFont(subTitleFont); painter->drawText(subTitleRect, Qt::AlignLeft|Qt::AlignVCenter, " " + subTitleText); }
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel