summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 4013981..eb1ec6e 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -1,672 +1,670 @@
1/*- 1/*-
2 * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved. 2 * Copyright (C)QPL 2001 Daniel M. Duley. All rights reserved.
3 */ 3 */
4 4
5 5
6 6
7#ifndef INCLUDE_MENUITEM_DEF 7#ifndef INCLUDE_MENUITEM_DEF
8#define INCLUDE_MENUITEM_DEF 8#define INCLUDE_MENUITEM_DEF
9#endif 9#endif
10 10
11#include <qmenudata.h> 11#include <qmenudata.h>
12#include "liquid.h" 12#include "liquid.h"
13//#include "liquiddeco.h" 13//#include "liquiddeco.h"
14#include <qapplication.h> 14#include <qapplication.h>
15#include <qpe/config.h> 15#include <qpe/config.h>
16#include "effects.h" 16#include "effects.h"
17#include <qpalette.h> 17#include <qpalette.h>
18#include <qbitmap.h> 18#include <qbitmap.h>
19#include <qtabbar.h> 19#include <qtabbar.h>
20#include <qpopupmenu.h> 20#include <qpopupmenu.h>
21#include <qobjectlist.h> 21#include <qobjectlist.h>
22#include <qimage.h> 22#include <qimage.h>
23#include <qtimer.h> 23#include <qtimer.h>
24#include <qpixmapcache.h> 24#include <qpixmapcache.h>
25#include <qradiobutton.h> 25#include <qradiobutton.h>
26#include <qcombobox.h> 26#include <qcombobox.h>
27#include <qdrawutil.h> 27#include <qdrawutil.h>
28#include <qwidgetlist.h> 28#include <qwidgetlist.h>
29#include <qtoolbutton.h> 29#include <qtoolbutton.h>
30#include <qheader.h> 30#include <qheader.h>
31#include <unistd.h> 31#include <unistd.h>
32#include <qmenubar.h> 32#include <qmenubar.h>
33#include <qprogressbar.h> 33#include <qprogressbar.h>
34 34
35#include <stdio.h> 35#include <stdio.h>
36 36
37#include "htmlmasks.h" 37#include "htmlmasks.h"
38#include "embeddata.h" 38#include "embeddata.h"
39 39
40typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *, 40typedef void (QStyle::*QDrawMenuBarItemImpl) (QPainter *, int, int, int, int, QMenuItem *,
41 QColorGroup &, bool, bool); 41 QColorGroup &, bool, bool);
42 42
43QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl); 43QDrawMenuBarItemImpl qt_set_draw_menu_bar_impl(QDrawMenuBarItemImpl impl);
44 44
45void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color) 45void TransMenuHandler::stripePixmap(QPixmap &pix, const QColor &color)
46{ 46{
47 QImage img(pix.convertToImage()); 47 QImage img(pix.convertToImage());
48 QImageEffect::fade(img, 0.9, color); 48 QImageEffect::fade(img, 0.9, color);
49 int x, y; 49 int x, y;
50 int r, g, b; 50 int r, g, b;
51 for(y=0; y < img.height(); y+=3){ 51 for(y=0; y < img.height(); y+=3){
52 unsigned int *data = (unsigned int *) img.scanLine(y); 52 unsigned int *data = (unsigned int *) img.scanLine(y);
53 for(x=0; x < img.width(); ++x){ 53 for(x=0; x < img.width(); ++x){
54 r = qRed(data[x]); 54 r = qRed(data[x]);
55 g = qGreen(data[x]); 55 g = qGreen(data[x]);
56 b = qBlue(data[x]); 56 b = qBlue(data[x]);
57 if(r-10) 57 if(r-10)
58 r-=10; 58 r-=10;
59 if(g-10) 59 if(g-10)
60 g-=10; 60 g-=10;
61 if(b-10) 61 if(b-10)
62 b-=10; 62 b-=10;
63 data[x] = qRgb(r, g, b); 63 data[x] = qRgb(r, g, b);
64 } 64 }
65 } 65 }
66 pix.convertFromImage(img); 66 pix.convertFromImage(img);
67} 67}
68 68
69TransMenuHandler::TransMenuHandler(QObject *parent) 69TransMenuHandler::TransMenuHandler(QObject *parent)
70 : QObject(parent) 70 : QObject(parent)
71{ 71{
72 pixDict.setAutoDelete(true); 72 pixDict.setAutoDelete(true);
73 reloadSettings(); 73 reloadSettings();
74} 74}
75 75
76void TransMenuHandler::reloadSettings() 76void TransMenuHandler::reloadSettings()
77{ 77{
78 pixDict.clear(); 78 pixDict.clear();
79 79
80 Config config ( "qpe" ); 80 Config config ( "qpe" );
81 config. setGroup ( "Liquid-Style" ); 81 config. setGroup ( "Liquid-Style" );
82 82
83 type = config. readNumEntry("Type", TransStippleBg); 83 type = config. readNumEntry("Type", TransStippleBg);
84 color = QColor ( config. readEntry("Color", QApplication::palette().active().button().name())); 84 color = QColor ( config. readEntry("Color", QApplication::palette().active().button().name()));
85 fgColor = QColor ( config. readEntry("TextColor", QApplication::palette().active().text().name())); 85 fgColor = QColor ( config. readEntry("TextColor", QApplication::palette().active().text().name()));
86 opacity = config. readNumEntry("Opacity", 10); 86 opacity = config. readNumEntry("Opacity", 10);
87 if ( opacity < -20 ) 87 if ( opacity < -20 )
88 opacity = 20; 88 opacity = 20;
89 else if ( opacity > 20 ) 89 else if ( opacity > 20 )
90 opacity = 20; 90 opacity = 20;
91 91
92 shadowText = config. readBoolEntry("ShadowText", true); 92 shadowText = config. readBoolEntry("ShadowText", true);
93} 93}
94 94
95bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev) 95bool TransMenuHandler::eventFilter(QObject *obj, QEvent *ev)
96{ 96{
97 QWidget *p = (QWidget *)obj; 97 QWidget *p = (QWidget *)obj;
98 98
99 if(ev->type() == QEvent::Show){ 99 if(ev->type() == QEvent::Show){
100 if(type == TransStippleBg || type == TransStippleBtn || 100 if(type == TransStippleBg || type == TransStippleBtn ||
101 type == Custom){ 101 type == Custom){
102 QApplication::syncX(); 102 QApplication::syncX();
103 QPixmap *pix = new QPixmap; 103 QPixmap *pix = new QPixmap;
104 if(p->testWFlags(Qt::WType_Popup)){ 104 if(p->testWFlags(Qt::WType_Popup)){
105 QRect r(p->x(), p->y(), p->width(), p->height()); 105 QRect r(p->x(), p->y(), p->width(), p->height());
106 QRect deskR = QApplication::desktop()->rect(); 106 QRect deskR = QApplication::desktop()->rect();
107 if(r.right() > deskR.right() || r.bottom() > deskR.bottom()){ 107 if(r.right() > deskR.right() || r.bottom() > deskR.bottom()){
108 r.setBottom(deskR.bottom()); 108 r.setBottom(deskR.bottom());
109 r.setRight(deskR.right()); 109 r.setRight(deskR.right());
110 } 110 }
111 *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(), 111 *pix = QPixmap::grabWindow(QApplication::desktop()-> winId(), r.x(), r.y(),
112 r.width(), r.height()); 112 r.width(), r.height());
113 } 113 }
114 else{ // tear off menu 114 else{ // tear off menu
115 pix->resize(p->width(), p->height()); 115 pix->resize(p->width(), p->height());
116 pix->fill(Qt::black.rgb()); 116 pix->fill(Qt::black.rgb());
117 } 117 }
118 if(type == TransStippleBg){ 118 if(type == TransStippleBg){
119 stripePixmap(*pix, p->colorGroup().background()); 119 stripePixmap(*pix, p->colorGroup().background());
120 } 120 }
121 else if(type == TransStippleBtn){ 121 else if(type == TransStippleBtn){
122 stripePixmap(*pix, p->colorGroup().button()); 122 stripePixmap(*pix, p->colorGroup().button());
123 } 123 }
124 else{ 124 else{
125 QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color); 125 QPixmapEffect::fade(*pix, (((float)opacity)+80)*0.01, color);
126 } 126 }
127 127
128 pixDict.insert(p->winId(), pix); 128 pixDict.insert(p->winId(), pix);
129 129
130 if (!p->inherits("QPopupMenu")) { 130 if ( !p->inherits("QPopupMenu"))
131 p->setBackgroundPixmap(*pix); 131 p->setBackgroundPixmap(*pix);
132 132
133 QObjectList *ol = p-> queryList("QWidget"); 133 QObjectList *ol = p-> queryList("QWidget");
134 for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { 134 for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
135 QWidget *wid = (QWidget *) it.current ( ); 135 QWidget *wid = (QWidget *) it.current ( );
136 136
137 wid-> setBackgroundPixmap(*pix); 137 wid-> setBackgroundPixmap(*pix);
138 wid-> setBackgroundOrigin(QWidget::ParentOrigin); 138 wid-> setBackgroundOrigin(QWidget::ParentOrigin);
139 } 139 }
140 delete ol; 140 delete ol;
141 }
142 } 141 }
143 } 142 }
144 else if(ev->type() == QEvent::Hide){ 143 else if(ev->type() == QEvent::Hide){
145 if(type == TransStippleBg || type == TransStippleBtn || 144 if(type == TransStippleBg || type == TransStippleBtn ||
146 type == Custom){ 145 type == Custom){
147// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width()); 146// qWarning("Deleting menu pixmap, width %d", pixDict.find(p->winId())->width());
148 147
149 pixDict.remove(p->winId()); 148 pixDict.remove(p->winId());
150 if (!p->inherits("QPopupMenu")) { 149 if ( !p->inherits("QPopupMenu"))
151 p->setBackgroundMode(QWidget::PaletteBackground); 150 p->setBackgroundMode(QWidget::PaletteBackground);
152 151
153 QObjectList *ol = p-> queryList("QWidget"); 152 QObjectList *ol = p-> queryList("QWidget");
154 for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { 153 for ( QObjectListIt it( *ol ); it. current ( ); ++it ) {
155 QWidget *wid = (QWidget *) it.current ( ); 154 QWidget *wid = (QWidget *) it.current ( );
156 155
157 wid-> setBackgroundMode( QWidget::PaletteBackground ); 156 wid-> setBackgroundMode( QWidget::PaletteBackground );
158 }
159 delete ol;
160 } 157 }
158 delete ol;
161 } 159 }
162 } 160 }
163 return(false); 161 return(false);
164} 162}
165 163
166 164
167LiquidStyle::LiquidStyle() 165LiquidStyle::LiquidStyle()
168 :QWindowsStyle() 166 :QWindowsStyle()
169{ 167{
170 setName ( "LiquidStyle" ); 168 setName ( "LiquidStyle" );
171 169
172 flatTBButtons = false; 170 flatTBButtons = false;
173 171
174 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true); 172 btnMaskBmp = QBitmap(37, 26, buttonmask_bits, true);
175 btnMaskBmp.setMask(btnMaskBmp); 173 btnMaskBmp.setMask(btnMaskBmp);
176 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); 174 htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true);
177 htmlBtnMaskBmp.setMask(htmlBtnMaskBmp); 175 htmlBtnMaskBmp.setMask(htmlBtnMaskBmp);
178 headerHoverID = -1; 176 headerHoverID = -1;
179 highlightWidget = NULL; 177 highlightWidget = NULL;
180 setButtonDefaultIndicatorWidth(0); 178 setButtonDefaultIndicatorWidth(0);
181 btnDict.setAutoDelete(true); 179 btnDict.setAutoDelete(true);
182 bevelFillDict.setAutoDelete(true); 180 bevelFillDict.setAutoDelete(true);
183 smallBevelFillDict.setAutoDelete(true); 181 smallBevelFillDict.setAutoDelete(true);
184 customBtnColorList.setAutoDelete(true); 182 customBtnColorList.setAutoDelete(true);
185 customBtnIconList.setAutoDelete(true); 183 customBtnIconList.setAutoDelete(true);
186 customBtnLabelList.setAutoDelete(true); 184 customBtnLabelList.setAutoDelete(true);
187 185
188 rMatrix.rotate(270.0); 186 rMatrix.rotate(270.0);
189 highcolor = QPixmap::defaultDepth() > 8; 187 highcolor = QPixmap::defaultDepth() > 8;
190 btnBorderPix = new QPixmap; 188 btnBorderPix = new QPixmap;
191 btnBorderPix->convertFromImage(qembed_findImage("buttonfill")); 189 btnBorderPix->convertFromImage(qembed_findImage("buttonfill"));
192 btnBlendPix = new QPixmap; 190 btnBlendPix = new QPixmap;
193 btnBlendPix->convertFromImage(qembed_findImage("buttonborder")); 191 btnBlendPix->convertFromImage(qembed_findImage("buttonborder"));
194 bevelFillPix = new QPixmap; 192 bevelFillPix = new QPixmap;
195 bevelFillPix->convertFromImage(qembed_findImage("clear_fill_large")); 193 bevelFillPix->convertFromImage(qembed_findImage("clear_fill_large"));
196 smallBevelFillPix = new QPixmap; 194 smallBevelFillPix = new QPixmap;
197 smallBevelFillPix->convertFromImage(qembed_findImage("clear_fill_small")); 195 smallBevelFillPix->convertFromImage(qembed_findImage("clear_fill_small"));
198 // new stuff 196 // new stuff
199 vsbSliderFillPix = menuPix = NULL; 197 vsbSliderFillPix = menuPix = NULL;
200 menuHandler = new TransMenuHandler(this); 198 menuHandler = new TransMenuHandler(this);
201 setScrollBarExtent(15, 15); 199 setScrollBarExtent(15, 15);
202 int i; 200 int i;
203 for(i=0; i < BITMAP_ITEMS; ++i){ 201 for(i=0; i < BITMAP_ITEMS; ++i){
204 pixmaps[i] = NULL; 202 pixmaps[i] = NULL;
205 } 203 }
206 oldSliderThickness = sliderThickness(); 204 oldSliderThickness = sliderThickness();
207 setSliderThickness(11); 205 setSliderThickness(11);
208} 206}
209 207
210LiquidStyle::~LiquidStyle() 208LiquidStyle::~LiquidStyle()
211{ 209{
212 if(btnBorderPix) 210 if(btnBorderPix)
213 delete btnBorderPix; 211 delete btnBorderPix;
214 if(btnBlendPix) 212 if(btnBlendPix)
215 delete btnBlendPix; 213 delete btnBlendPix;
216 if(bevelFillPix) 214 if(bevelFillPix)
217 delete bevelFillPix; 215 delete bevelFillPix;
218 if(smallBevelFillPix) 216 if(smallBevelFillPix)
219 delete smallBevelFillPix; 217 delete smallBevelFillPix;
220 if(vsbSliderFillPix) 218 if(vsbSliderFillPix)
221 delete vsbSliderFillPix; 219 delete vsbSliderFillPix;
222 if(menuPix) 220 if(menuPix)
223 delete menuPix; 221 delete menuPix;
224 222
225 setScrollBarExtent(16, 16); 223 setScrollBarExtent(16, 16);
226 setSliderThickness(oldSliderThickness); 224 setSliderThickness(oldSliderThickness);
227 int i; 225 int i;
228 for(i=0; i < BITMAP_ITEMS; ++i){ 226 for(i=0; i < BITMAP_ITEMS; ++i){
229 if(pixmaps[i]) 227 if(pixmaps[i])
230 delete pixmaps[i]; 228 delete pixmaps[i];
231 } 229 }
232} 230}
233 231
234void LiquidStyle::drawClearBevel(QPainter *p, int x, int y, int w, int h, 232void LiquidStyle::drawClearBevel(QPainter *p, int x, int y, int w, int h,
235 const QColor &c, const QColor &bg) 233 const QColor &c, const QColor &bg)
236{ 234{
237 235
238 QPen oldPen = p->pen(); // headers need this 236 QPen oldPen = p->pen(); // headers need this
239 int x2 = x+w-1; 237 int x2 = x+w-1;
240 int y2 = y+h-1; 238 int y2 = y+h-1;
241 // outer dark rect 239 // outer dark rect
242 p->setPen(c.dark(130)); 240 p->setPen(c.dark(130));
243 p->drawLine(x, y+2, x, y2-2); // l 241 p->drawLine(x, y+2, x, y2-2); // l
244 p->drawLine(x2, y+2, x2, y2-2); // r 242 p->drawLine(x2, y+2, x2, y2-2); // r
245 p->drawLine(x+2, y, x2-2, y); // t 243 p->drawLine(x+2, y, x2-2, y); // t
246 p->drawLine(x+2, y2, x2-2, y2); // b 244 p->drawLine(x+2, y2, x2-2, y2); // b
247 p->drawPoint(x+1, y+1); // tl 245 p->drawPoint(x+1, y+1); // tl
248 p->drawPoint(x2-1, y+1); // tr 246 p->drawPoint(x2-1, y+1); // tr
249 p->drawPoint(x+1, y2-1); // bl 247 p->drawPoint(x+1, y2-1); // bl
250 p->drawPoint(x2-1, y2-1); // br 248 p->drawPoint(x2-1, y2-1); // br
251 249
252 // inner top light lines 250 // inner top light lines
253 p->setPen(c.light(105)); 251 p->setPen(c.light(105));
254 p->drawLine(x+2, y+1, x2-2, y+1); 252 p->drawLine(x+2, y+1, x2-2, y+1);
255 p->drawLine(x+1, y+2, x2-1, y+2); 253 p->drawLine(x+1, y+2, x2-1, y+2);
256 p->drawLine(x+1, y+3, x+2, y+3); 254 p->drawLine(x+1, y+3, x+2, y+3);
257 p->drawLine(x2-2, y+3, x2-1, y+3); 255 p->drawLine(x2-2, y+3, x2-1, y+3);
258 p->drawPoint(x+1, y+4); 256 p->drawPoint(x+1, y+4);
259 p->drawPoint(x2-1, y+4); 257 p->drawPoint(x2-1, y+4);
260 258
261 // inner bottom light lines 259 // inner bottom light lines
262 p->setPen(c.light(110)); 260 p->setPen(c.light(110));
263 p->drawLine(x+2, y2-1, x2-2, y2-1); 261 p->drawLine(x+2, y2-1, x2-2, y2-1);
264 p->drawLine(x+1, y2-2, x2-1, y2-2); 262 p->drawLine(x+1, y2-2, x2-1, y2-2);
265 p->drawLine(x+1, y2-3, x+2, y2-3); 263 p->drawLine(x+1, y2-3, x+2, y2-3);
266 p->drawLine(x2-2, y2-3, x2-1, y2-3); 264 p->drawLine(x2-2, y2-3, x2-1, y2-3);
267 p->drawPoint(x+1, y2-4); 265 p->drawPoint(x+1, y2-4);
268 p->drawPoint(x2-1, y2-4); 266 p->drawPoint(x2-1, y2-4);
269 267
270 // inner left mid lines 268 // inner left mid lines
271 //p->setPen(c.light(105)); 269 //p->setPen(c.light(105));
272 p->setPen(c); 270 p->setPen(c);
273 p->drawLine(x+1, y+5, x+1, y2-5); 271 p->drawLine(x+1, y+5, x+1, y2-5);
274 p->drawLine(x+2, y+4, x+2, y2-4); 272 p->drawLine(x+2, y+4, x+2, y2-4);
275 273
276 // inner right mid lines 274 // inner right mid lines
277 p->drawLine(x2-1, y+5, x2-1, y2-5); 275 p->drawLine(x2-1, y+5, x2-1, y2-5);
278 p->drawLine(x2-2, y+4, x2-2, y2-4); 276 p->drawLine(x2-2, y+4, x2-2, y2-4);
279 277
280 // fill 278 // fill
281 QPixmap *pix; 279 QPixmap *pix;
282 if(h >= 32){ 280 if(h >= 32){
283 pix = bevelFillDict.find(c.rgb()); 281 pix = bevelFillDict.find(c.rgb());
284 if(!pix){ 282 if(!pix){
285 int h, s, v; 283 int h, s, v;
286 c.hsv(&h, &s, &v); 284 c.hsv(&h, &s, &v);
287 pix = new QPixmap(*bevelFillPix); 285 pix = new QPixmap(*bevelFillPix);
288 adjustHSV(*pix, h, s, v); 286 adjustHSV(*pix, h, s, v);
289 bevelFillDict.insert(c.rgb(), pix); 287 bevelFillDict.insert(c.rgb(), pix);
290 } 288 }
291 } 289 }
292 else{ 290 else{
293 pix = smallBevelFillDict.find(c.rgb()); 291 pix = smallBevelFillDict.find(c.rgb());
294 if(!pix){ 292 if(!pix){
295 int h, s, v; 293 int h, s, v;
296 c.hsv(&h, &s, &v); 294 c.hsv(&h, &s, &v);
297 pix = new QPixmap(*smallBevelFillPix); 295 pix = new QPixmap(*smallBevelFillPix);
298 adjustHSV(*pix, h, s, v); 296 adjustHSV(*pix, h, s, v);
299 smallBevelFillDict.insert(c.rgb(), pix); 297 smallBevelFillDict.insert(c.rgb(), pix);
300 } 298 }
301 } 299 }
302 p->drawTiledPixmap(x+3, y+3, w-6, h-6, *pix); 300 p->drawTiledPixmap(x+3, y+3, w-6, h-6, *pix);
303 // blend 301 // blend
304 int red, green, blue; 302 int red, green, blue;
305 QColor btnColor(c.dark(130)); 303 QColor btnColor(c.dark(130));
306 red = (btnColor.red() >> 1) + (bg.red() >> 1); 304 red = (btnColor.red() >> 1) + (bg.red() >> 1);
307 green = (btnColor.green() >> 1) + (bg.green() >> 1); 305 green = (btnColor.green() >> 1) + (bg.green() >> 1);
308 blue = (btnColor.blue() >> 1) + (bg.blue() >> 1); 306 blue = (btnColor.blue() >> 1) + (bg.blue() >> 1);
309 btnColor.setRgb(red, green, blue); 307 btnColor.setRgb(red, green, blue);
310 308
311 p->setPen(btnColor); 309 p->setPen(btnColor);
312 p->drawPoint(x+1, y); 310 p->drawPoint(x+1, y);
313 p->drawPoint(x, y+1); 311 p->drawPoint(x, y+1);
314 p->drawPoint(x+1, y2); 312 p->drawPoint(x+1, y2);
315 p->drawPoint(x, y2-1); 313 p->drawPoint(x, y2-1);
316 314
317 p->drawPoint(x2-1, y); 315 p->drawPoint(x2-1, y);
318 p->drawPoint(x2, y+1); 316 p->drawPoint(x2, y+1);
319 p->drawPoint(x2-1, y2); 317 p->drawPoint(x2-1, y2);
320 p->drawPoint(x2, y2-1); 318 p->drawPoint(x2, y2-1);
321 319
322 p->setPen(oldPen); 320 p->setPen(oldPen);
323 321
324} 322}
325 323
326void LiquidStyle::drawRoundButton(QPainter *painter, const QColor &c, 324void LiquidStyle::drawRoundButton(QPainter *painter, const QColor &c,
327 const QColor &back, int x, int y, int w, int h, 325 const QColor &back, int x, int y, int w, int h,
328 bool supportPushDown, bool pushedDown, 326 bool supportPushDown, bool pushedDown,
329 bool autoDefault, bool isMasked) 327 bool autoDefault, bool isMasked)
330{ 328{
331 if(w < 21 || h < 21){ 329 if(w < 21 || h < 21){
332 drawClearBevel(painter, x, y, w, h, c, back); 330 drawClearBevel(painter, x, y, w, h, c, back);
333 return; 331 return;
334 } 332 }
335 if(supportPushDown){ 333 if(supportPushDown){
336 --w, --h; 334 --w, --h;
337 } 335 }
338 /* We don't make the round buttons smaller, since they don't look as good 336 /* We don't make the round buttons smaller, since they don't look as good
339 if(autoDefault){ 337 if(autoDefault){
340 w = w-buttonDefaultIndicatorWidth()*2; 338 w = w-buttonDefaultIndicatorWidth()*2;
341 h = h-buttonDefaultIndicatorWidth()*2; 339 h = h-buttonDefaultIndicatorWidth()*2;
342 }*/ 340 }*/
343 341
344 342
345 QPixmap *pix = btnDict.find(c.rgb()); 343 QPixmap *pix = btnDict.find(c.rgb());
346 if(!pix){ 344 if(!pix){
347 int h, s, v; 345 int h, s, v;
348 c.hsv(&h, &s, &v); 346 c.hsv(&h, &s, &v);
349 pix = new QPixmap(*btnBorderPix); 347 pix = new QPixmap(*btnBorderPix);
350 adjustHSV(*pix, h, s, v); 348 adjustHSV(*pix, h, s, v);
351 btnDict.insert(c.rgb(), pix); 349 btnDict.insert(c.rgb(), pix);
352 } 350 }
353 int x2 = x+w-1; 351 int x2 = x+w-1;
354 int y2 = y+h-1; 352 int y2 = y+h-1;
355 int bx2 = pix->width()-1; 353 int bx2 = pix->width()-1;
356 int by2 = pix->height()-1; 354 int by2 = pix->height()-1;
357 355
358 QPixmap tmpPix(w, h); 356 QPixmap tmpPix(w, h);
359 QPixmap tilePix; 357 QPixmap tilePix;
360 QPainter p; 358 QPainter p;
361 p.begin(&tmpPix); 359 p.begin(&tmpPix);
362 360
363 // do the fill 361 // do the fill
364 p.drawPixmap(0, 0, *pix, 0, 0, 10, 10); // tl 362 p.drawPixmap(0, 0, *pix, 0, 0, 10, 10); // tl
365 p.drawPixmap(x2-9, 0, *pix, bx2-9, 0, 10, 10); // tr 363 p.drawPixmap(x2-9, 0, *pix, bx2-9, 0, 10, 10); // tr
366 p.drawPixmap(0, y2-9, *pix, 0, by2-9, 10, 10); // bl 364 p.drawPixmap(0, y2-9, *pix, 0, by2-9, 10, 10); // bl
367 p.drawPixmap(x2-9, y2-9, *pix, bx2-9, by2-9, 10, 10); // br 365 p.drawPixmap(x2-9, y2-9, *pix, bx2-9, by2-9, 10, 10); // br
368 366
369 // edges 367 // edges
370 tilePix.resize(pix->width()-20, 10); 368 tilePix.resize(pix->width()-20, 10);
371 // top 369 // top
372 bitBlt(&tilePix, 0, 0, pix, 10, 0, pix->width()-20, 10); 370 bitBlt(&tilePix, 0, 0, pix, 10, 0, pix->width()-20, 10);
373 p.drawTiledPixmap(10, 0, w-20, 10, tilePix); 371 p.drawTiledPixmap(10, 0, w-20, 10, tilePix);
374 // bottom 372 // bottom
375 bitBlt(&tilePix, 0, 0, pix, 10, by2-9, pix->width()-20, 20); 373 bitBlt(&tilePix, 0, 0, pix, 10, by2-9, pix->width()-20, 20);
376 p.drawTiledPixmap(10, y2-9, w-20, 10, tilePix); 374 p.drawTiledPixmap(10, y2-9, w-20, 10, tilePix);
377 // left 375 // left
378 tilePix.resize(10, pix->height()-20); 376 tilePix.resize(10, pix->height()-20);
379 bitBlt(&tilePix, 0, 0, pix, 0, 10, 10, pix->height()-20); 377 bitBlt(&tilePix, 0, 0, pix, 0, 10, 10, pix->height()-20);
380 p.drawTiledPixmap(0, 10, 10, h-20, tilePix); 378 p.drawTiledPixmap(0, 10, 10, h-20, tilePix);
381 // right 379 // right
382 bitBlt(&tilePix, 0, 0, pix, bx2-9, 10, 10, pix->height()-20); 380 bitBlt(&tilePix, 0, 0, pix, bx2-9, 10, 10, pix->height()-20);
383 p.drawTiledPixmap(x2-9, 10, 10, h-20, tilePix); 381 p.drawTiledPixmap(x2-9, 10, 10, h-20, tilePix);
384 382
385 // middle 383 // middle
386 tilePix.resize(pix->width()-20, pix->height()-20); 384 tilePix.resize(pix->width()-20, pix->height()-20);
387 bitBlt(&tilePix, 0, 0, pix, 10, 10, pix->width()-20, pix->height()-20); 385 bitBlt(&tilePix, 0, 0, pix, 10, 10, pix->width()-20, pix->height()-20);
388 p.drawTiledPixmap(10, 10, w-20, h-20, tilePix); 386 p.drawTiledPixmap(10, 10, w-20, h-20, tilePix);
389 387
390 388
391 // do the blend 389 // do the blend
392 QBitmap blendMask; 390 QBitmap blendMask;
393 if(!isMasked){ 391 if(!isMasked){
394 //QRgb bgRgb = back.rgb(); 392 //QRgb bgRgb = back.rgb();
395 //QRgb fgRgb = c.rgb(); 393 //QRgb fgRgb = c.rgb();
396 //int r, g, b; 394 //int r, g, b;
397 395
398 //r = (int)(qRed(bgRgb)*0.75 + qRed(fgRgb)*0.25); 396 //r = (int)(qRed(bgRgb)*0.75 + qRed(fgRgb)*0.25);
399 //g = (int)(qGreen(bgRgb)*0.75 + qGreen(fgRgb)*0.25); 397 //g = (int)(qGreen(bgRgb)*0.75 + qGreen(fgRgb)*0.25);
400 //b = (int)(qBlue(bgRgb)*0.75 + qBlue(fgRgb)*0.25); 398 //b = (int)(qBlue(bgRgb)*0.75 + qBlue(fgRgb)*0.25);
401 //QColor blendColor(r, g, b); 399 //QColor blendColor(r, g, b);
402 int hue, sat, v1, v2; 400 int hue, sat, v1, v2;
403 QColor blendColor(autoDefault ? c : back); 401 QColor blendColor(autoDefault ? c : back);
404 back.hsv(&hue, &sat, &v1); 402 back.hsv(&hue, &sat, &v1);
405 blendColor.hsv(&hue, &sat, &v2); 403 blendColor.hsv(&hue, &sat, &v2);
406 if(v2 > v1) 404 if(v2 > v1)
407 blendColor.setHsv(hue, sat, (int)(v1*0.75 + v2*0.25)); 405 blendColor.setHsv(hue, sat, (int)(v1*0.75 + v2*0.25));
408 406
409 pix = btnBorderDict.find(blendColor.rgb()); 407 pix = btnBorderDict.find(blendColor.rgb());
410 if(!pix){ 408 if(!pix){
411 int h, s, v; 409 int h, s, v;
412 blendColor.hsv(&h, &s, &v); 410 blendColor.hsv(&h, &s, &v);
413 pix = new QPixmap(*btnBlendPix); 411 pix = new QPixmap(*btnBlendPix);
414 adjustHSV(*pix, h, s, v); 412 adjustHSV(*pix, h, s, v);
415 btnBorderDict.insert(blendColor.rgb(), pix); 413 btnBorderDict.insert(blendColor.rgb(), pix);
416 } 414 }
417 } 415 }
418 else{ 416 else{
419 pix = pushedDown ? getPixmap(HTMLBtnBorderDown) : 417 pix = pushedDown ? getPixmap(HTMLBtnBorderDown) :
420 getPixmap(HTMLBtnBorder); 418 getPixmap(HTMLBtnBorder);
421 } 419 }
422 p.drawPixmap(0, 0, *pix, 0, 0, 10, 10); // tl 420 p.drawPixmap(0, 0, *pix, 0, 0, 10, 10); // tl
423 p.drawPixmap(x2-9, 0, *pix, bx2-9, 0, 10, 10); // tr 421 p.drawPixmap(x2-9, 0, *pix, bx2-9, 0, 10, 10); // tr
424 p.drawPixmap(0, y2-9, *pix, 0, by2-9, 10, 10); // bl 422 p.drawPixmap(0, y2-9, *pix, 0, by2-9, 10, 10); // bl
425 p.drawPixmap(x2-9, y2-9, *pix, bx2-9, by2-9, 10, 10); // br 423 p.drawPixmap(x2-9, y2-9, *pix, bx2-9, by2-9, 10, 10); // br
426 424
427 // edges 425 // edges
428 tilePix.resize(pix->width()-20, 10); 426 tilePix.resize(pix->width()-20, 10);
429 blendMask.resize(pix->width()-20, 10); 427 blendMask.resize(pix->width()-20, 10);
430 // top 428 // top
431 bitBlt(&tilePix, 0, 0, pix, 10, 0, pix->width()-20, 10); 429 bitBlt(&tilePix, 0, 0, pix, 10, 0, pix->width()-20, 10);
432 bitBlt(&blendMask, 0, 0, pix->mask(), 10, 0, pix->width()-20, 10); 430 bitBlt(&blendMask, 0, 0, pix->mask(), 10, 0, pix->width()-20, 10);
433 tilePix.setMask(blendMask); 431 tilePix.setMask(blendMask);
434 p.drawTiledPixmap(10, 0, w-20, 10, tilePix); 432 p.drawTiledPixmap(10, 0, w-20, 10, tilePix);
435 // bottom 433 // bottom
436 bitBlt(&tilePix, 0, 0, pix, 10, by2-9, pix->width()-20, 20); 434 bitBlt(&tilePix, 0, 0, pix, 10, by2-9, pix->width()-20, 20);
437 bitBlt(&blendMask, 0, 0, pix->mask(), 10, by2-9, pix->width()-20, 20); 435 bitBlt(&blendMask, 0, 0, pix->mask(), 10, by2-9, pix->width()-20, 20);
438 tilePix.setMask(blendMask); 436 tilePix.setMask(blendMask);
439 p.drawTiledPixmap(10, y2-9, w-20, 10, tilePix); 437 p.drawTiledPixmap(10, y2-9, w-20, 10, tilePix);
440 // left 438 // left
441 tilePix.resize(10, pix->height()-20); 439 tilePix.resize(10, pix->height()-20);
442 blendMask.resize(10, pix->height()-20); 440 blendMask.resize(10, pix->height()-20);
443 bitBlt(&tilePix, 0, 0, pix, 0, 10, 10, pix->height()-20); 441 bitBlt(&tilePix, 0, 0, pix, 0, 10, 10, pix->height()-20);
444 bitBlt(&blendMask, 0, 0, pix->mask(), 0, 10, 10, pix->height()-20); 442 bitBlt(&blendMask, 0, 0, pix->mask(), 0, 10, 10, pix->height()-20);
445 tilePix.setMask(blendMask); 443 tilePix.setMask(blendMask);
446 p.drawTiledPixmap(0, 10, 10, h-20, tilePix); 444 p.drawTiledPixmap(0, 10, 10, h-20, tilePix);
447 // right 445 // right
448 bitBlt(&tilePix, 0, 0, pix, bx2-9, 10, 10, pix->height()-20); 446 bitBlt(&tilePix, 0, 0, pix, bx2-9, 10, 10, pix->height()-20);
449 bitBlt(&blendMask, 0, 0, pix->mask(), bx2-9, 10, 10, pix->height()-20); 447 bitBlt(&blendMask, 0, 0, pix->mask(), bx2-9, 10, 10, pix->height()-20);
450 tilePix.setMask(blendMask); 448 tilePix.setMask(blendMask);
451 p.drawTiledPixmap(x2-9, 10, 10, h-20, tilePix); 449 p.drawTiledPixmap(x2-9, 10, 10, h-20, tilePix);
452 450
453 p.end(); 451 p.end();
454 452
455 // do the button mask - we don't automask buttons 453 // do the button mask - we don't automask buttons
456 QBitmap btnMask(w, h); 454 QBitmap btnMask(w, h);
457 QBitmap *mask = isMasked ? &htmlBtnMaskBmp : &btnMaskBmp; 455 QBitmap *mask = isMasked ? &htmlBtnMaskBmp : &btnMaskBmp;
458 p.begin(&btnMask); 456 p.begin(&btnMask);
459 p.fillRect(0, 0, w, h, Qt::color0); 457 p.fillRect(0, 0, w, h, Qt::color0);
460 p.drawPixmap(0, 0, *mask, 0, 0, 10, 10); // tl 458 p.drawPixmap(0, 0, *mask, 0, 0, 10, 10); // tl
461 p.drawPixmap(x2-9, 0, *mask, bx2-9, 0, 10, 10); // tr 459 p.drawPixmap(x2-9, 0, *mask, bx2-9, 0, 10, 10); // tr
462 p.drawPixmap(0, y2-9, *mask, 0, by2-9, 10, 10); // bl 460 p.drawPixmap(0, y2-9, *mask, 0, by2-9, 10, 10); // bl
463 p.drawPixmap(x2-9, y2-9, *mask, bx2-9, by2-9, 10, 10); // br 461 p.drawPixmap(x2-9, y2-9, *mask, bx2-9, by2-9, 10, 10); // br
464 // fills 462 // fills
465 p.fillRect(10, 0, w-20, 10, Qt::color1); // top 463 p.fillRect(10, 0, w-20, 10, Qt::color1); // top
466 p.fillRect(10, y2-9, w-20, 10, Qt::color1); // bottom 464 p.fillRect(10, y2-9, w-20, 10, Qt::color1); // bottom
467 p.fillRect(0, 10, w, h-20, Qt::color1); // middle 465 p.fillRect(0, 10, w, h-20, Qt::color1); // middle
468 p.end(); 466 p.end();
469 tmpPix.setMask(btnMask); 467 tmpPix.setMask(btnMask);
470 /*if(autoDefault){ 468 /*if(autoDefault){
471 if(supportPushDown && pushedDown){ 469 if(supportPushDown && pushedDown){
472 painter->drawPixmap(x+3, y+3, tmpPix); 470 painter->drawPixmap(x+3, y+3, tmpPix);
473 } 471 }
474 else{ 472 else{
475 painter->drawPixmap(x+2, y+2, tmpPix); 473 painter->drawPixmap(x+2, y+2, tmpPix);
476 } 474 }
477 } 475 }
478 else */if(supportPushDown && pushedDown) 476 else */if(supportPushDown && pushedDown)
479 painter->drawPixmap(x+1, y+1, tmpPix); 477 painter->drawPixmap(x+1, y+1, tmpPix);
480 else 478 else
481 painter->drawPixmap(x, y, tmpPix); 479 painter->drawPixmap(x, y, tmpPix);
482 480
483 481
484 482
485} 483}
486 484
487 485
488QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v, 486QPixmap* LiquidStyle::processEmbedded(const char *label, int h, int s, int v,
489 bool blend) 487 bool blend)
490{ 488{
491 QImage img(qembed_findImage(label)); 489 QImage img(qembed_findImage(label));
492 img.detach(); 490 img.detach();
493 if(img.isNull()){ // shouldn't happen, been tested 491 if(img.isNull()){ // shouldn't happen, been tested
494 qWarning("Invalid embedded label %s", label); 492 qWarning("Invalid embedded label %s", label);
495 return(NULL); 493 return(NULL);
496 } 494 }
497 if(img.depth() != 32) 495 if(img.depth() != 32)
498 img = img.convertDepth(32); 496 img = img.convertDepth(32);
499 unsigned int *data = (unsigned int *)img.bits(); 497 unsigned int *data = (unsigned int *)img.bits();
500 int total = img.width()*img.height(); 498 int total = img.width()*img.height();
501 int current; 499 int current;
502 QColor c; 500 QColor c;
503 int oldH, oldS, oldV; 501 int oldH, oldS, oldV;
504 int alpha; 502 int alpha;
505 if(v < 235) 503 if(v < 235)
506 v += 20; 504 v += 20;
507 else 505 else
508 v = 255; 506 v = 255;
509 float intensity = v/255.0; 507 float intensity = v/255.0;
510 508
511 for(current=0; current<total; ++current){ 509 for(current=0; current<total; ++current){
512 alpha = qAlpha(data[current]); 510 alpha = qAlpha(data[current]);
513 c.setRgb(data[current]); 511 c.setRgb(data[current]);
514 c.hsv(&oldH, &oldS, &oldV); 512 c.hsv(&oldH, &oldS, &oldV);
515 oldV = (int)(oldV*intensity); 513 oldV = (int)(oldV*intensity);
516 c.setHsv(h, s, oldV); 514 c.setHsv(h, s, oldV);
517 if(blend && alpha != 255 && alpha != 0){ 515 if(blend && alpha != 255 && alpha != 0){
518 float srcPercent = ((float)alpha)/255.0; 516 float srcPercent = ((float)alpha)/255.0;
519 float destPercent = 1.0-srcPercent; 517 float destPercent = 1.0-srcPercent;
520 oldH = (int)((srcPercent*h) + (destPercent*bH)); 518 oldH = (int)((srcPercent*h) + (destPercent*bH));
521 oldS = (int)((srcPercent*s) + (destPercent*bS)); 519 oldS = (int)((srcPercent*s) + (destPercent*bS));
522 oldV = (int)((srcPercent*oldV) + (destPercent*bV)); 520 oldV = (int)((srcPercent*oldV) + (destPercent*bV));
523 c.setHsv(oldH, oldS, oldV); 521 c.setHsv(oldH, oldS, oldV);
524 alpha = 255; 522 alpha = 255;
525 } 523 }
526 data[current] = qRgba(c.red(), c.green(), c.blue(), alpha); 524 data[current] = qRgba(c.red(), c.green(), c.blue(), alpha);
527 } 525 }
528 QPixmap *pix = new QPixmap; 526 QPixmap *pix = new QPixmap;
529 pix->convertFromImage(img); 527 pix->convertFromImage(img);
530 return(pix); 528 return(pix);
531} 529}
532 530
533 531
534 532
535 533
536QPixmap* LiquidStyle::getPixmap(BitmapData item) 534QPixmap* LiquidStyle::getPixmap(BitmapData item)
537{ 535{
538 536
539 if(pixmaps[item]) 537 if(pixmaps[item])
540 return(pixmaps[item]); 538 return(pixmaps[item]);
541 539
542 switch(item){ 540 switch(item){
543 case HTMLBtnBorder: 541 case HTMLBtnBorder:
544 pixmaps[HTMLBtnBorder] = processEmbedded("htmlbtnborder", btnH, btnS, btnV); 542 pixmaps[HTMLBtnBorder] = processEmbedded("htmlbtnborder", btnH, btnS, btnV);
545 break; 543 break;
546 case HTMLBtnBorderDown: 544 case HTMLBtnBorderDown:
547 pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV); 545 pixmaps[HTMLBtnBorderDown] = processEmbedded("htmlbtnborder", btnHoverH, btnHoverS, btnHoverV);
548 break; 546 break;
549 case HTMLCB: 547 case HTMLCB:
550 pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV); 548 pixmaps[HTMLCB] = processEmbedded("htmlcheckbox", bH, bS, bV);
551 break; 549 break;
552 case HTMLCBDown: 550 case HTMLCBDown:
553 pixmaps[HTMLCBDown] = processEmbedded("htmlcheckboxdown", btnH, btnS, btnV); 551 pixmaps[HTMLCBDown] = processEmbedded("htmlcheckboxdown", btnH, btnS, btnV);
554 break; 552 break;
555 case HTMLCBHover: 553 case HTMLCBHover:
556 pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnH, btnS, btnV); 554 pixmaps[HTMLCBHover] = processEmbedded("htmlcheckbox", btnH, btnS, btnV);
557 break; 555 break;
558 case HTMLCBDownHover: 556 case HTMLCBDownHover:
559 pixmaps[HTMLCBDownHover] = processEmbedded("htmlcheckboxdown", 557 pixmaps[HTMLCBDownHover] = processEmbedded("htmlcheckboxdown",
560 btnHoverH, btnHoverS, 558 btnHoverH, btnHoverS,
561 btnHoverV); 559 btnHoverV);
562 break; 560 break;
563 case HTMLRadio: 561 case HTMLRadio:
564 pixmaps[HTMLRadio] = processEmbedded("htmlradio", bH, bS, bV); 562 pixmaps[HTMLRadio] = processEmbedded("htmlradio", bH, bS, bV);
565 case HTMLRadioDown: 563 case HTMLRadioDown:
566 pixmaps[HTMLRadioDown] = processEmbedded("htmlradiodown", btnH, btnS, btnV); 564 pixmaps[HTMLRadioDown] = processEmbedded("htmlradiodown", btnH, btnS, btnV);
567 case HTMLRadioHover: 565 case HTMLRadioHover:
568 pixmaps[HTMLRadioHover] = processEmbedded("htmlradio", btnH, btnS, btnV); 566 pixmaps[HTMLRadioHover] = processEmbedded("htmlradio", btnH, btnS, btnV);
569 case HTMLRadioDownHover: 567 case HTMLRadioDownHover:
570 pixmaps[HTMLRadioDownHover] = processEmbedded("htmlradiodown", 568 pixmaps[HTMLRadioDownHover] = processEmbedded("htmlradiodown",
571 btnHoverH, btnHoverS, 569 btnHoverH, btnHoverS,
572 btnHoverV); 570 btnHoverV);
573 case RadioOn: 571 case RadioOn:
574 pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV, true); 572 pixmaps[RadioOn] = processEmbedded("radio_down", btnH, btnS, btnV, true);
575 break; 573 break;
576 case RadioOnHover: 574 case RadioOnHover:
577 pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS, 575 pixmaps[RadioOnHover] = processEmbedded("radio_down", btnHoverH, btnHoverS,
578 btnHoverV, true); 576 btnHoverV, true);
579 break; 577 break;
580 case RadioOffHover: 578 case RadioOffHover:
581 pixmaps[RadioOffHover] = processEmbedded("radio", btnH, btnS, btnV, true); 579 pixmaps[RadioOffHover] = processEmbedded("radio", btnH, btnS, btnV, true);
582 break; 580 break;
583 case TabDown: 581 case TabDown:
584 pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV, true); 582 pixmaps[TabDown] = processEmbedded("tab", btnH, btnS, btnV, true);
585 break; 583 break;
586 case TabFocus: 584 case TabFocus:
587 pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS, 585 pixmaps[TabFocus] = processEmbedded("tab", btnHoverH, btnHoverS,
588 btnHoverS, true); 586 btnHoverS, true);
589 break; 587 break;
590 case CBDown: 588 case CBDown:
591 pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV, true); 589 pixmaps[CBDown] = processEmbedded("checkboxdown", btnH, btnS, btnV, true);
592 break; 590 break;
593 case CBDownHover: 591 case CBDownHover:
594 pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH, 592 pixmaps[CBDownHover] = processEmbedded("checkboxdown", btnHoverH,
595 btnHoverS, btnHoverV, true); 593 btnHoverS, btnHoverV, true);
596 break; 594 break;
597 case CBHover: 595 case CBHover:
598 pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true); 596 pixmaps[CBHover] = processEmbedded("checkbox", btnH, btnS, btnV, true);
599 break; 597 break;
600 case HSlider: 598 case HSlider:
601 pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); 599 pixmaps[HSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
602 break; 600 break;
603 case VSlider: 601 case VSlider:
604 pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true); 602 pixmaps[VSlider] = processEmbedded("sliderarrow", btnH, btnS, btnV, true);
605 *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix); 603 *pixmaps[VSlider] = pixmaps[VSlider]->xForm(rMatrix);
606 break; 604 break;
607 case RadioOff: 605 case RadioOff:
608 pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true); 606 pixmaps[RadioOff] = processEmbedded("radio", bH, bS, bV, true);
609 break; 607 break;
610 case Tab: 608 case Tab:
611 pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true); 609 pixmaps[Tab] = processEmbedded("tab", bH, bS, bV, true);
612 break; 610 break;
613 case CB: 611 case CB:
614 pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV, true); 612 pixmaps[CB] = processEmbedded("checkbox", bH, bS, bV, true);
615 break; 613 break;
616 case VSBSliderTop: 614 case VSBSliderTop:
617 pixmaps[VSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true); 615 pixmaps[VSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true);
618 break; 616 break;
619 case VSBSliderBtm: 617 case VSBSliderBtm:
620 pixmaps[VSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true); 618 pixmaps[VSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true);
621 break; 619 break;
622 case VSBSliderMid: 620 case VSBSliderMid:
623 pixmaps[VSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV); 621 pixmaps[VSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
624 break; 622 break;
625 case VSBSliderTopHover: 623 case VSBSliderTopHover:
626 pixmaps[VSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true); 624 pixmaps[VSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true);
627 break; 625 break;
628 case VSBSliderBtmHover: 626 case VSBSliderBtmHover:
629 pixmaps[VSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true); 627 pixmaps[VSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true);
630 break; 628 break;
631 case VSBSliderMidHover: 629 case VSBSliderMidHover:
632 pixmaps[VSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV); 630 pixmaps[VSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV);
633 break; 631 break;
634 632
635 case HSBSliderTop: 633 case HSBSliderTop:
636 pixmaps[HSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true); 634 pixmaps[HSBSliderTop] = processEmbedded("sbslider_top", btnH, btnS, btnV, true);
637 *pixmaps[HSBSliderTop] = pixmaps[HSBSliderTop]->xForm(rMatrix); 635 *pixmaps[HSBSliderTop] = pixmaps[HSBSliderTop]->xForm(rMatrix);
638 break; 636 break;
639 case HSBSliderBtm: 637 case HSBSliderBtm:
640 pixmaps[HSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true); 638 pixmaps[HSBSliderBtm] = processEmbedded("sbslider_btm", btnH, btnS, btnV, true);
641 *pixmaps[HSBSliderBtm] = pixmaps[HSBSliderBtm]->xForm(rMatrix); 639 *pixmaps[HSBSliderBtm] = pixmaps[HSBSliderBtm]->xForm(rMatrix);
642 break; 640 break;
643 case HSBSliderMid: 641 case HSBSliderMid:
644 pixmaps[HSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV); 642 pixmaps[HSBSliderMid] = processEmbedded("sbslider_mid", btnH, btnS, btnV);
645 *pixmaps[HSBSliderMid] = pixmaps[HSBSliderMid]->xForm(rMatrix); 643 *pixmaps[HSBSliderMid] = pixmaps[HSBSliderMid]->xForm(rMatrix);
646 break; 644 break;
647 case HSBSliderTopHover: 645 case HSBSliderTopHover:
648 pixmaps[HSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true); 646 pixmaps[HSBSliderTopHover] = processEmbedded("sbslider_top", btnHoverH, btnHoverS, btnHoverV, true);
649 *pixmaps[HSBSliderTopHover] = pixmaps[HSBSliderTopHover]->xForm(rMatrix); 647 *pixmaps[HSBSliderTopHover] = pixmaps[HSBSliderTopHover]->xForm(rMatrix);
650 break; 648 break;
651 case HSBSliderBtmHover: 649 case HSBSliderBtmHover:
652 pixmaps[HSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true); 650 pixmaps[HSBSliderBtmHover] = processEmbedded("sbslider_btm", btnHoverH, btnHoverS, btnHoverV, true);
653 *pixmaps[HSBSliderBtmHover] = pixmaps[HSBSliderBtmHover]->xForm(rMatrix); 651 *pixmaps[HSBSliderBtmHover] = pixmaps[HSBSliderBtmHover]->xForm(rMatrix);
654 break; 652 break;
655 case HSBSliderMidHover: 653 case HSBSliderMidHover:
656 pixmaps[HSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV); 654 pixmaps[HSBSliderMidHover] = processEmbedded("sbslider_mid", btnHoverH, btnHoverS, btnHoverV);
657 *pixmaps[HSBSliderMidHover] = pixmaps[HSBSliderMidHover]->xForm(rMatrix); 655 *pixmaps[HSBSliderMidHover] = pixmaps[HSBSliderMidHover]->xForm(rMatrix);
658 break; 656 break;
659 case VSBSliderTopBg: 657 case VSBSliderTopBg:
660 pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true); 658 pixmaps[VSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true);
661 break; 659 break;
662 case VSBSliderBtmBg: 660 case VSBSliderBtmBg:
663 pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true); 661 pixmaps[VSBSliderBtmBg] = processEmbedded("sbslider_btm", bH, bS, bV, true);
664 break; 662 break;
665 case VSBSliderMidBg: 663 case VSBSliderMidBg:
666 pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV); 664 pixmaps[VSBSliderMidBg] = processEmbedded("sbslider_mid", bH, bS, bV);
667 break; 665 break;
668 case HSBSliderTopBg: 666 case HSBSliderTopBg:
669 pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true); 667 pixmaps[HSBSliderTopBg] = processEmbedded("sbslider_top", bH, bS, bV, true);
670 *pixmaps[HSBSliderTopBg] = pixmaps[HSBSliderTopBg]->xForm(rMatrix); 668 *pixmaps[HSBSliderTopBg] = pixmaps[HSBSliderTopBg]->xForm(rMatrix);
671 break; 669 break;
672 case HSBSliderBtmBg: 670 case HSBSliderBtmBg: