1 //////////////////////////////////////////////////////////////////////////////
4 // Ozone window decoration for KDE. Buttons.
6 // Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 //////////////////////////////////////////////////////////////////////////////
27 class OxygenWidget
: public QWidget
30 virtual void paintEvent ( QPaintEvent
* event
);
33 void OxygenWidget::paintEvent ( QPaintEvent
* )
35 QPainter
painter(this);
37 QRadialGradient
grad1(QPointF(5.0, 5.0),5.0);
38 grad1
.setColorAt(0.9, QColor(0,0,0,100));
39 grad1
.setColorAt(1.0, QColor(0,0,0,0));
40 QRadialGradient
grad2(QPointF(5.0, 5.0),5.0);
41 grad2
.setColorAt(0.0, QColor(235,235,235));
42 grad2
.setColorAt(1.0, QColor(220,220,220));
43 QRadialGradient
grad3(QPointF(5.0, 3.75), 3.5,QPointF(5.0, 2.5));
44 grad3
.setColorAt(0, QColor(255,255,255,50));
45 grad3
.setColorAt(1, QColor(255,255,255,0));
46 QRadialGradient
grad4(QPointF(5.0, 3.3), 3.5, QPointF(5.0, 2.1));
47 grad4
.setColorAt(0, QColor(255,255,255,50));
48 grad4
.setColorAt(1, QColor(255,255,255,0));
54 painter
.scale(1.6, 1.6);
55 painter
.setRenderHint(QPainter::Antialiasing
,true);
58 path1
.addEllipse(0.0, 0.0, 10.0, 10.0);
59 painter
.fillPath(path1
, brush1
);
62 path2
.addEllipse(0.5, 0.5, 9.0, 9.0);
63 painter
.fillPath(path2
, brush2
);
66 path3
.addEllipse(1.5, 0.5, 7.0, 6.0);
67 painter
.fillPath(path3
, brush3
);
70 path4
.addEllipse(1.5, 0.5, 7.0, 6.0);
71 painter
.fillPath(path4
, brush4
);