add more spacing
[personal-kdebase.git] / workspace / kwin / clients / ozone / snippet.cpp
blobea752c526fd8ff967191c9d31b755f858e0d3132
1 //////////////////////////////////////////////////////////////////////////////
2 // oxygenbutton.h
3 // -------------------
4 // Ozone window decoration for KDE. Buttons.
5 // -------------------
6 // Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
7 //
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
24 // IN THE SOFTWARE.
25 //////////////////////////////////////////////////////////////////////////////
27 class OxygenWidget : public QWidget
29 protected:
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));
49 QBrush brush1(grad1);
50 QBrush brush2(grad2);
51 QBrush brush3(grad3);
52 QBrush brush4(grad4);
54 painter.scale(1.6, 1.6);
55 painter.setRenderHint(QPainter::Antialiasing,true);
57 QPainterPath path1;
58 path1.addEllipse(0.0, 0.0, 10.0, 10.0);
59 painter.fillPath(path1, brush1);
61 QPainterPath path2;
62 path2.addEllipse(0.5, 0.5, 9.0, 9.0);
63 painter.fillPath(path2, brush2);
65 QPainterPath path3;
66 path3.addEllipse(1.5, 0.5, 7.0, 6.0);
67 painter.fillPath(path3, brush3);
69 QPainterPath path4;
70 path4.addEllipse(1.5, 0.5, 7.0, 6.0);
71 painter.fillPath(path4, brush4);