[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: Review Request: Bug with Plasma::Delegate text painter
From:       "Jesse L. Zamora" <xtremek2008 () aim ! com>
Date:       2008-11-19 16:20:30
Message-ID: 200811191120.30664.xtremek2008 () aim ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; \
font-weight:400; font-style:normal;">On Wednesday 19 November 2008 11:17:28 Aaron J. \
Seigo wrote:<br> &gt; On Wednesday 19 November 2008, Jesse Zamora wrote:<br>
&gt; &gt; EDIT: I am noticing that on the items with the gradient, it really \
starts<br> &gt; &gt; to slow down. Any suggestions?<br>
&gt;<br>
&gt; arg. once again, reviewboard is not showing me your patch. sorry, can you<br>
&gt; forward it on here? and what do you mean by "starts to slow down"<br>
&gt; precisely?<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>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! :-(<br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p>Xtreme Kommander</p></body></html>


["plasma_delegate.patch" (text/x-patch)]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic