2 * KDE3 HighColor Style (version 1.0)
3 * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
4 * (C) 2001-2002 Fredrik Höglund <fredrik@kde.org>
6 * Drawing routines adapted from the KDE2 HCStyle,
7 * Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
8 * (C) 2000 Dirk Mueller <mueller@kde.org>
9 * (C) 2001 Martijn Klingens <klingens@kde.org>
11 * Many thanks to Bradley T. Hughes for the 3 button scrollbar code.
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License version 2 as published by the Free Software Foundation.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public License
23 * along with this library; see the file COPYING.LIB. If not, write to
24 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25 * Boston, MA 02110-1301, USA.
31 #include <QtGui/QBitmap>
32 #include <kdrawutil.h>
37 enum GradientType
{ VSmall
=0, VMed
, VLarge
, HMed
, HLarge
, GradientCount
};
42 GradientSet(const QColor
&baseColor
);
45 KPixmap
* gradient(GradientType type
);
46 QColor
* color() { return(&c
); }
48 KPixmap
*gradients
[5];
55 class HighColorStyle
: public KStyle
60 enum StyleType
{ HighColor
= 0, Default
, B3
};
62 HighColorStyle( StyleType
);
63 virtual ~HighColorStyle();
65 void polish( QWidget
* widget
);
66 void unPolish( QWidget
* widget
);
68 void renderMenuBlendPixmap( KPixmap
& pix
, const QColorGroup
&cg
,
69 const QMenu
* popup
) const;
71 void drawKStylePrimitive( KStylePrimitive kpe
,
73 const QWidget
* widget
,
75 const QColorGroup
&cg
,
76 SFlags flags
= Style_Default
,
77 const QStyleOption
& = QStyleOption::Default
) const;
79 void drawPrimitive( PrimitiveElement pe
,
82 const QColorGroup
&cg
,
83 SFlags flags
= Style_Default
,
84 const QStyleOption
& = QStyleOption::Default
) const;
86 void drawControl( ControlElement element
,
88 const QWidget
*widget
,
90 const QColorGroup
&cg
,
91 SFlags flags
= Style_Default
,
92 const QStyleOption
& = QStyleOption::Default
) const;
94 void drawControlMask( ControlElement element
,
96 const QWidget
*widget
,
98 const QStyleOption
& = QStyleOption::Default
) const;
100 void drawComplexControl( ComplexControl control
,
102 const QWidget
*widget
,
104 const QColorGroup
&cg
,
105 SFlags flags
= Style_Default
,
106 SCFlags controls
= SC_All
,
107 SCFlags active
= SC_None
,
108 const QStyleOption
& = QStyleOption::Default
) const;
110 void drawComplexControlMask( ComplexControl control
,
112 const QWidget
*widget
,
114 const QStyleOption
& = QStyleOption::Default
) const;
116 void drawItem( QPainter
*p
,
119 const QColorGroup
&cg
,
121 const QPixmap
*pixmap
,
124 const QColor
*penColor
= 0 ) const;
126 int pixelMetric( PixelMetric m
,
127 const QWidget
*widget
= 0 ) const;
129 QSize
sizeFromContents( ContentsType contents
,
130 const QWidget
*widget
,
131 const QSize
&contentSize
,
132 const QStyleOption
& opt
) const;
134 QRect
subRect( SubRect r
,
135 const QWidget
*widget
) const;
137 // Fix Qt3's wacky image positions
138 QPixmap
stylePixmap( StylePixmap stylepixmap
,
139 const QWidget
*widget
= 0,
140 const QStyleOption
& = QStyleOption::Default
) const;
143 bool eventFilter( QObject
*object
, QEvent
*event
);
145 void renderGradient( QPainter
* p
,
152 int pheight
=-1 ) const;
154 QWidget
*hoverWidget
;
157 mutable bool selectionBackground
;
160 // Disable copy constructor and = operator
161 HighColorStyle( const HighColorStyle
& );
162 HighColorStyle
& operator=( const HighColorStyle
& );
165 // vim: set noet ts=4 sw=4: