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

List:       kde-panel-devel
Subject:    Re: kickoff highlight -- please help
From:       Marco Martin <notmart () gmail ! com>
Date:       2008-02-28 20:06:08
Message-ID: 200802282106.08724.notmart () gmail ! com
[Download RAW message or body]

On Thursday 28 February 2008, Marco Martin wrote:
> On Thursday 28 February 2008, Aaron J. Seigo wrote:
> > On Thursday 28 February 2008, Marco Martin wrote:
> > > created a little patch of my proposal (the last one)
> >
> > nice; some actual code. note that a screenshot would help some of the
> > people on this list who may not be able to compile from source daily as
> > we can who are involved in the discussion.
>
> (sending again, too big attachment...)
> ok, here is a version with drawing problems fixed and a screenshot with the
> default color scheme (http://www.notmart.org/misc/kickoff2.png)

mmh, i liked the gray bar that expanded without margins, but since in the 
flipscrollview the area before the icon is not clickable it could be 
misleading. and now the code is much simpler.
screenshot http://www.notmart.org/misc/kickoff3.png

Cheers,
Marco Martin



["kickoff_fulllightgradient3.diff" (text/x-diff)]

Index: flipscrollview.cpp
===================================================================
--- flipscrollview.cpp	(revision 779902)
+++ flipscrollview.cpp	(working copy)
@@ -556,7 +556,7 @@
             QRect triRect = option.rect;
             QPainterPath tPath = d->trianglePath();
             triRect.setLeft(triRect.right() - ItemDelegate::ITEM_RIGHT_MARGIN);
-            painter.translate(triRect.center().x(), triRect.y() + \
(tPath.boundingRect().height() / 2)  + 3); +            \
painter.translate(triRect.center().x(), triRect.center().y());  painter.rotate(180);
             painter.drawPath(tPath);
             painter.resetTransform();
Index: itemdelegate.cpp
===================================================================
--- itemdelegate.cpp	(revision 779902)
+++ itemdelegate.cpp	(working copy)
@@ -102,7 +102,23 @@
     if (hover) {
         painter->save();
         painter->setPen(Qt::NoPen);
+
         QColor backgroundColor = option.palette.color(QPalette::Highlight);
+        QColor lightBackColor;
+
+        //lightBackColor is backgroundColor to gray and made transparent
+        lightBackColor.setHsv(0, 0, backgroundColor.value());
+
+        QLinearGradient backGradient(contentRect.topLeft(), \
contentRect.bottomLeft()); +        lightBackColor.setAlphaF(0.3);
+        backGradient.setColorAt(0, lightBackColor);
+        lightBackColor.setAlphaF(0.7);
+        backGradient.setColorAt(1, lightBackColor);
+
+        painter->setBrush(QBrush(backGradient));
+        //painter->fillRect(contentRect.adjusted(0,0,0,1), backGradient);
+        painter->drawPath(Plasma::roundedRectangle(contentRect.adjusted(0,0,0,1), \
5)); +
         QFontMetrics titleMetrics(titleFont);
         QFontMetrics subTitleMetrics(subTitleFont);
         QRect textAreaRect = contentRect;
@@ -113,8 +129,11 @@
                             1);
         // use a slightly translucent version of the palette's highlight color
         // for the background
-        backgroundColor.setAlphaF(0.5);
-        painter->setBrush(QBrush(backgroundColor));
+        backgroundColor.setAlphaF(0.3);
+        backGradient.setColorAt(0, backgroundColor);
+        backgroundColor.setAlphaF(0.7);
+        backGradient.setColorAt(1, backgroundColor);
+        painter->setBrush(QBrush(backGradient));
         painter->drawPath(Plasma::roundedRectangle(textAreaRect, 5));
         painter->restore();
     }



_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel


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

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