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

List:       kde-core-devel
Subject:    [patch] kstyle issue with gradient brushes
From:       Fred Emmott <mail () fredemmott ! co ! uk>
Date:       2009-07-14 0:48:00
Message-ID: 200907140148.00646.mail () fredemmott ! co ! uk
[Download RAW message or body]

Hi,

In one of my models, I have the following code:

                case Qt::BackgroundRole:
                        {
                                QLinearGradient gradient;
                                gradient.setColorAt(0, Qt::white);
                                gradient.setColorAt(1, Qt::gray);
                                gradient.setStart(0, 0);
                                gradient.setFinalStop(0, 36); // 36 is a 
temporarily hardcoded value, the same as my row heights
                                return static_cast<QBrush>(gradient);
                        }

Under Qt styles, such as Plastique (although, works also with phase, windows, 
motif, cleanlook, GTK, CDE) this renders as expected: 

http://files.fredemmott.co.uk/kstyle-brush-origin/plastique.png

Under styles inheriting from kstyle, such as oxygen, it doesn't:

http://files.fredemmott.co.uk/kstyle-brush-origin/oxygen.png

Patch against 4.2.4 (sorry, my connection's sucking, that's all I've got at 
the moment - appears unresolved in trunk):

http://files.fredemmott.co.uk/kstyle-brush-origin/kstyle.diff

For comparison, the relevant QCommonStyle code is:

http://qt.gitorious.org/qt/qt/blobs/master/src/gui/styles/qcommonstyle.cpp#line787

Additionally, oxygen reimplements hardly any of QStyle::standardIcon - I might 
make a patch if there's interest?

-- 
Fred Emmott
(http://www.fredemmott.co.uk)
[prev in list] [next in list] [prev in thread] [next in thread] 

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