summaryrefslogtreecommitdiff
path: root/noncore/styles
Unidiff
Diffstat (limited to 'noncore/styles') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/othemebase.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp
index 21d16f2..58005b5 100644
--- a/noncore/styles/theme/othemebase.cpp
+++ b/noncore/styles/theme/othemebase.cpp
@@ -25,24 +25,25 @@
25//#include <kglobalsettings.h> 25//#include <kglobalsettings.h>
26//#include <kstddirs.h> 26//#include <kstddirs.h>
27#include <qfile.h> 27#include <qfile.h>
28#include <qtextstream.h> 28#include <qtextstream.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qpainter.h> 30#include <qpainter.h>
31#include <qbitmap.h> 31#include <qbitmap.h>
32#include <stdlib.h> 32#include <stdlib.h>
33#include <qstringlist.h> 33#include <qstringlist.h>
34 34
35#include <stdio.h> 35#include <stdio.h>
36 36
37
37template class QIntCache<OThemePixmap> 38template class QIntCache<OThemePixmap>
38; 39;
39 40
40static const char *widgetEntries[] = 41static const char *widgetEntries[] =
41 { // unsunken widgets (see header) 42 { // unsunken widgets (see header)
42 "PushButton", "ComboBox", "HSBarSlider", "VSBarSlider", "Bevel", "ToolButton", 43 "PushButton", "ComboBox", "HSBarSlider", "VSBarSlider", "Bevel", "ToolButton",
43 "ScrollButton", "HScrollDeco", "VScrollDeco", "ComboDeco", "MenuItem", "Tab", 44 "ScrollButton", "HScrollDeco", "VScrollDeco", "ComboDeco", "MenuItem", "Tab",
44 "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", 45 "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight",
45 // sunken widgets 46 // sunken widgets
46 "PushButtonDown", "ComboBoxDown", "HSBarSliderDown", "VSBarSliderDown", 47 "PushButtonDown", "ComboBoxDown", "HSBarSliderDown", "VSBarSliderDown",
47 "BevelDown", "ToolButtonDown", "ScrollButtonDown", "HScrollDecoDown", 48 "BevelDown", "ToolButtonDown", "ScrollButtonDown", "HScrollDecoDown",
48 "VScrollDecoDown", "ComboDecoDown", "MenuItemDown", "TabDown", "SunkenArrowUp", 49 "VScrollDecoDown", "ComboDecoDown", "MenuItemDown", "TabDown", "SunkenArrowUp",
@@ -264,58 +265,58 @@ void OThemeBase::readConfig( Qt::GUIStyle /*style*/ )
264 QString pixnames[ WIDGETS ]; // used for duplicate check 265 QString pixnames[ WIDGETS ]; // used for duplicate check
265 QString brdnames[ WIDGETS ]; 266 QString brdnames[ WIDGETS ];
266 bool loaded[ WIDGETS ]; // used for preloading for CopyWidget 267 bool loaded[ WIDGETS ]; // used for preloading for CopyWidget
267 268
268 if ( configFileName.isEmpty() ) { 269 if ( configFileName.isEmpty() ) {
269 Config cfg ( "qpe" ); 270 Config cfg ( "qpe" );
270 cfg. setGroup ( "Appearance" ); 271 cfg. setGroup ( "Appearance" );
271 272
272 configFileName = cfg. readEntry ( "Theme", "default" ); 273 configFileName = cfg. readEntry ( "Theme", "default" );
273 } 274 }
274 MyConfig config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File ); 275 MyConfig config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File );
275 276
276 printf ( "Opened config file: %s\n", ( configFilePath + "/themes/" + configFileName + ".themerc" ). ascii()); 277 //printf ( "Opened config file: %s\n", ( configFilePath + "/themes/" + configFileName + ".themerc" ). ascii());
277 278
278 // Are we initalized? 279 // Are we initalized?
279 for ( i = 0; i < INHERIT_ITEMS; ++i ) { 280 for ( i = 0; i < INHERIT_ITEMS; ++i ) {
280 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 281 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
281 printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() ); 282 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() );
282 } 283 }
283 for ( ; i < INHERIT_ITEMS*2; ++i ) { 284 for ( ; i < INHERIT_ITEMS*2; ++i ) {
284 if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) { 285 if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) {
285 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 286 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
286 printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() ); 287 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() );
287 } 288 }
288 else { 289 else {
289 copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ]; 290 copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ];
290 printf ( "%d [%s]: copy=%s\n", i, widgetEntries [i], copyfrom [i].latin1()); 291 // printf ( "%d [%s]: copy=%s\n", i, widgetEntries [i], copyfrom [i].latin1());
291 } 292 }
292 } 293 }
293 for ( ; i < WIDGETS; ++i ) { 294 for ( ; i < WIDGETS; ++i ) {
294 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 295 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
295 printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() ); 296 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1() );
296 } 297 }
297 applyMiscResourceGroup( &config ); 298 applyMiscResourceGroup( &config );
298 299
299 // initalize defaults that may not be read 300 // initalize defaults that may not be read
300 for ( i = 0; i < WIDGETS; ++i ) 301 for ( i = 0; i < WIDGETS; ++i )
301 loaded[ i ] = false; 302 loaded[ i ] = false;
302 btnXShift = btnYShift = focus3DOffset = 0; 303 btnXShift = btnYShift = focus3DOffset = 0;
303 aTabLine = iTabLine = true; 304 aTabLine = iTabLine = true;
304 roundedButton = roundedCombo = roundedSlider = focus3D = false; 305 roundedButton = roundedCombo = roundedSlider = focus3D = false;
305 splitterWidth = 10; 306 splitterWidth = 10;
306 307
307 for ( i = 0; i < WIDGETS; ++i ) { 308 for ( i = 0; i < WIDGETS; ++i ) {
308 readResourceGroup( i, copyfrom, pixnames, brdnames, loaded ); 309 readResourceGroup( i, copyfrom, pixnames, brdnames, loaded );
309 printf ( "%d [%s]: copy=%s, pix=%s, brd=%s, colors=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1(), (colors[i]?colors[i]->background().name().latin1():"<none)" )); 310 // printf ( "%d [%s]: copy=%s, pix=%s, brd=%s, colors=%s\n", i, widgetEntries [i], copyfrom [i].latin1(), pixnames[i].latin1(),brdnames[i].latin1(), (colors[i]?colors[i]->background().name().latin1():"<none)" ));
310 } 311 }
311 312
312 // misc items 313 // misc items
313 readMiscResourceGroup(); 314 readMiscResourceGroup();
314 315
315 // Handle preblend items 316 // Handle preblend items
316 for ( i = 0; i < PREBLEND_ITEMS; ++i ) { 317 for ( i = 0; i < PREBLEND_ITEMS; ++i ) {
317 if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 ) 318 if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 )
318 blend( preBlend[ i ] ); 319 blend( preBlend[ i ] );
319 } 320 }
320} 321}
321 322