Diffstat (limited to 'noncore/styles/theme/othemebase.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/styles/theme/othemebase.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp index 7ce4e5a..d2226e6 100644 --- a/noncore/styles/theme/othemebase.cpp +++ b/noncore/styles/theme/othemebase.cpp | |||
@@ -175,13 +175,13 @@ void OThemeBase::generateBorderPix( int i ) | |||
175 | Qt::CopyROP, false ); | 175 | Qt::CopyROP, false ); |
176 | tmp.setMask( destMask ); | 176 | tmp.setMask( destMask ); |
177 | } | 177 | } |
178 | pbPixmaps[ i ] ->setBorder( OThemePixmap::Right, tmp ); | 178 | pbPixmaps[ i ] ->setBorder( OThemePixmap::Right, tmp ); |
179 | } | 179 | } |
180 | else | 180 | else |
181 | qDebug ( "OThemeBase: Tried making border from empty pixmap" ); | 181 | odebug << "OThemeBase: Tried making border from empty pixmap" << oendl; |
182 | } | 182 | } |
183 | 183 | ||
184 | 184 | ||
185 | void OThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, | 185 | void OThemeBase::copyWidgetConfig( int sourceID, int destID, QString *pixnames, |
186 | QString *brdnames ) | 186 | QString *brdnames ) |
187 | { | 187 | { |
@@ -370,25 +370,25 @@ QImage* OThemeBase::loadImage( QString &name ) | |||
370 | { | 370 | { |
371 | QImage * image = new QImage; | 371 | QImage * image = new QImage; |
372 | QString path = configFilePath + "/pixmaps/" + name; | 372 | QString path = configFilePath + "/pixmaps/" + name; |
373 | image->load( path ); | 373 | image->load( path ); |
374 | if ( !image->isNull() ) | 374 | if ( !image->isNull() ) |
375 | return ( image ); | 375 | return ( image ); |
376 | qDebug ( "OThemeBase: Unable to load image %s\n", name.ascii ( ) ); | 376 | odebug << "OThemeBase: Unable to load image " << name.ascii ( ) << oendl; |
377 | delete image; | 377 | delete image; |
378 | return ( NULL ); | 378 | return ( NULL ); |
379 | } | 379 | } |
380 | 380 | ||
381 | OThemePixmap* OThemeBase::loadPixmap( QString &name ) | 381 | OThemePixmap* OThemeBase::loadPixmap( QString &name ) |
382 | { | 382 | { |
383 | OThemePixmap * pixmap = new OThemePixmap( false ); | 383 | OThemePixmap * pixmap = new OThemePixmap( false ); |
384 | QString path = configFilePath + "/pixmaps/" + name; | 384 | QString path = configFilePath + "/pixmaps/" + name; |
385 | pixmap->load( path ); | 385 | pixmap->load( path ); |
386 | if ( !pixmap->isNull() ) | 386 | if ( !pixmap->isNull() ) |
387 | return pixmap; | 387 | return pixmap; |
388 | qDebug ( "OThemeBase: Unable to load pixmap %s\n", name.ascii() ); | 388 | odebug << "OThemeBase: Unable to load pixmap " << name.ascii() << oendl; |
389 | delete pixmap; | 389 | delete pixmap; |
390 | return ( NULL ); | 390 | return ( NULL ); |
391 | } | 391 | } |
392 | 392 | ||
393 | OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) | 393 | OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) |
394 | { | 394 | { |
@@ -420,13 +420,13 @@ OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) | |||
420 | OThemePixmap * cachePix = cache->horizontalPixmap( w, widget ); | 420 | OThemePixmap * cachePix = cache->horizontalPixmap( w, widget ); |
421 | if ( cachePix ) { | 421 | if ( cachePix ) { |
422 | cachePix = new OThemePixmap( *cachePix ); | 422 | cachePix = new OThemePixmap( *cachePix ); |
423 | if ( pixmaps[ widget ] ) | 423 | if ( pixmaps[ widget ] ) |
424 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); | 424 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); |
425 | else | 425 | else |
426 | qDebug ( "We would have inserted a null pixmap!\n" ); | 426 | odebug << "We would have inserted a null pixmap!" << oendl; |
427 | pixmaps[ widget ] = cachePix; | 427 | pixmaps[ widget ] = cachePix; |
428 | } | 428 | } |
429 | else { | 429 | else { |
430 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); | 430 | cache->insert( pixmaps[ widget ], OThemeCache::HorizontalScale, widget ); |
431 | QImage tmpImg = images[ widget ] -> | 431 | QImage tmpImg = images[ widget ] -> |
432 | smoothScale( w, images[ widget ] ->height() ); | 432 | smoothScale( w, images[ widget ] ->height() ); |
@@ -442,13 +442,13 @@ OThemePixmap* OThemeBase::scale( int w, int h, WidgetType widget ) | |||
442 | OThemePixmap * cachePix = cache->verticalPixmap( w, widget ); | 442 | OThemePixmap * cachePix = cache->verticalPixmap( w, widget ); |
443 | if ( cachePix ) { | 443 | if ( cachePix ) { |
444 | cachePix = new OThemePixmap( *cachePix ); | 444 | cachePix = new OThemePixmap( *cachePix ); |
445 | if ( pixmaps[ widget ] ) | 445 | if ( pixmaps[ widget ] ) |
446 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); | 446 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); |
447 | else | 447 | else |
448 | qDebug ( "We would have inserted a null pixmap!\n" ); | 448 | odebug << "We would have inserted a null pixmap!" << oendl; |
449 | pixmaps[ widget ] = cachePix; | 449 | pixmaps[ widget ] = cachePix; |
450 | } | 450 | } |
451 | else { | 451 | else { |
452 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); | 452 | cache->insert( pixmaps[ widget ], OThemeCache::VerticalScale, widget ); |
453 | QImage tmpImg = | 453 | QImage tmpImg = |
454 | images[ widget ] ->smoothScale( images[ widget ] ->width(), h ); | 454 | images[ widget ] ->smoothScale( images[ widget ] ->width(), h ); |
@@ -587,13 +587,13 @@ OThemePixmap* OThemeBase::scaleBorder( int w, int h, WidgetType widget ) | |||
587 | } | 587 | } |
588 | p.end(); | 588 | p.end(); |
589 | mPainter.end(); | 589 | mPainter.end(); |
590 | pixmap->setMask( mask ); | 590 | pixmap->setMask( mask ); |
591 | cache->insert( pixmap, OThemeCache::FullScale, widget, true ); | 591 | cache->insert( pixmap, OThemeCache::FullScale, widget, true ); |
592 | if ( !pixmap->mask() ) | 592 | if ( !pixmap->mask() ) |
593 | qDebug ( "No mask for border pixmap!\n" ); | 593 | odebug << "No mask for border pixmap!" << oendl; |
594 | } | 594 | } |
595 | return ( pixmap ); | 595 | return ( pixmap ); |
596 | } | 596 | } |
597 | 597 | ||
598 | 598 | ||
599 | OThemePixmap* OThemeBase::blend( WidgetType widget ) | 599 | OThemePixmap* OThemeBase::blend( WidgetType widget ) |
@@ -802,23 +802,25 @@ void OThemeBase::applyMiscResourceGroup( Config *config ) | |||
802 | if ( tmpStr == "BottomLeft" ) | 802 | if ( tmpStr == "BottomLeft" ) |
803 | sbPlacement = SBBottomLeft; | 803 | sbPlacement = SBBottomLeft; |
804 | else if ( tmpStr == "BottomRight" ) | 804 | else if ( tmpStr == "BottomRight" ) |
805 | sbPlacement = SBBottomRight; | 805 | sbPlacement = SBBottomRight; |
806 | else { | 806 | else { |
807 | if ( tmpStr != "Opposite" && !tmpStr.isEmpty() ) | 807 | if ( tmpStr != "Opposite" && !tmpStr.isEmpty() ) |
808 | qDebug ( "OThemeBase: Unrecognized sb button option %s, using Opposite.\n", tmpStr.ascii() ); | 808 | odebug << "OThemeBase: Unrecognized sb button option " << tmpStr.ascii() |
809 | << ", using Opposite." << oendl; | ||
809 | sbPlacement = SBOpposite; | 810 | sbPlacement = SBOpposite; |
810 | } | 811 | } |
811 | tmpStr = config->readEntry( "ArrowType" ); | 812 | tmpStr = config->readEntry( "ArrowType" ); |
812 | if ( tmpStr == "Small" ) | 813 | if ( tmpStr == "Small" ) |
813 | arrowStyle = SmallArrow; | 814 | arrowStyle = SmallArrow; |
814 | else if ( tmpStr == "3D" ) | 815 | else if ( tmpStr == "3D" ) |
815 | arrowStyle = MotifArrow; | 816 | arrowStyle = MotifArrow; |
816 | else { | 817 | else { |
817 | if ( tmpStr != "Normal" && !tmpStr.isEmpty() ) | 818 | if ( tmpStr != "Normal" && !tmpStr.isEmpty() ) |
818 | qDebug ( "OThemeBase: Unrecognized arrow option %s, using Normal.\n", tmpStr.ascii() ); | 819 | odebug << "OThemeBase: Unrecognized arrow option " << tmpStr.ascii() |
820 | << ", using Normal." << oendl; | ||
819 | arrowStyle = LargeArrow; | 821 | arrowStyle = LargeArrow; |
820 | } | 822 | } |
821 | tmpStr = config->readEntry( "ShadeStyle" ); | 823 | tmpStr = config->readEntry( "ShadeStyle" ); |
822 | if ( tmpStr == "Motif" ) | 824 | if ( tmpStr == "Motif" ) |
823 | shading = Motif; | 825 | shading = Motif; |
824 | else if ( tmpStr == "Next" ) | 826 | else if ( tmpStr == "Next" ) |
@@ -863,13 +865,14 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q | |||
863 | else if ( tmpStr == "Horizontal" ) | 865 | else if ( tmpStr == "Horizontal" ) |
864 | scaleHints [ i ] = HorizontalScale; | 866 | scaleHints [ i ] = HorizontalScale; |
865 | else if ( tmpStr == "Vertical" ) | 867 | else if ( tmpStr == "Vertical" ) |
866 | scaleHints [ i ] = VerticalScale; | 868 | scaleHints [ i ] = VerticalScale; |
867 | else { | 869 | else { |
868 | if ( tmpStr != "Tile" && !tmpStr.isEmpty() ) | 870 | if ( tmpStr != "Tile" && !tmpStr.isEmpty() ) |
869 | qDebug ( "OThemeBase: Unrecognized scale option %s, using Tile.\n", tmpStr.ascii() ); | 871 | odebug << "OThemeBase: Unrecognized scale option " << tmpStr.ascii() |
872 | << ", using Tile." << oendl; | ||
870 | scaleHints [ i ] = TileScale; | 873 | scaleHints [ i ] = TileScale; |
871 | } | 874 | } |
872 | 875 | ||
873 | 876 | ||
874 | // Gradient type | 877 | // Gradient type |
875 | tmpStr = config->readEntry( "Gradient" ); | 878 | tmpStr = config->readEntry( "Gradient" ); |
@@ -886,13 +889,14 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q | |||
886 | else if ( tmpStr == "Elliptic" ) | 889 | else if ( tmpStr == "Elliptic" ) |
887 | gradients [ i ] = GrElliptic; | 890 | gradients [ i ] = GrElliptic; |
888 | else if ( tmpStr == "ReverseBevel" ) | 891 | else if ( tmpStr == "ReverseBevel" ) |
889 | gradients [ i ] = GrReverseBevel; | 892 | gradients [ i ] = GrReverseBevel; |
890 | else { | 893 | else { |
891 | if ( tmpStr != "None" && !tmpStr.isEmpty() ) | 894 | if ( tmpStr != "None" && !tmpStr.isEmpty() ) |
892 | qDebug ( "OThemeBase: Unrecognized gradient option %s, using None.\n", tmpStr.ascii() ); | 895 | odebug << "OThemeBase: Unrecognized gradient option " << tmpStr.ascii() |
896 | << ", using None." << oendl; | ||
893 | gradients [ i ] = GrNone; | 897 | gradients [ i ] = GrNone; |
894 | } | 898 | } |
895 | 899 | ||
896 | // Blend intensity | 900 | // Blend intensity |
897 | blends[ i ] = config->readEntry( "BlendIntensity", "0.0" ).toDouble(); | 901 | blends[ i ] = config->readEntry( "BlendIntensity", "0.0" ).toDouble(); |
898 | 902 | ||
@@ -942,14 +946,15 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q | |||
942 | pbDuplicate[ i ] = false; | 946 | pbDuplicate[ i ] = false; |
943 | pbPixmaps[ i ] = NULL; | 947 | pbPixmaps[ i ] = NULL; |
944 | pbWidth[ i ] = 0; | 948 | pbWidth[ i ] = 0; |
945 | if ( !tmpStr.isEmpty() ) { | 949 | if ( !tmpStr.isEmpty() ) { |
946 | pbWidth[ i ] = config->readNumEntry( "PixmapBWidth", 0 ); | 950 | pbWidth[ i ] = config->readNumEntry( "PixmapBWidth", 0 ); |
947 | if ( pbWidth[ i ] == 0 ) { | 951 | if ( pbWidth[ i ] == 0 ) { |
948 | qDebug ( "OThemeBase: No border width specified for pixmapped border widget %s\n", widgetEntries[ i ] ); | 952 | odebug << "OThemeBase: No border width specified for pixmapped border widget " |
949 | qDebug ( "OThemeBase: Using default of 2.\n" ); | 953 | << widgetEntries[ i ] << oendl; |
954 | odebug << "OThemeBase: Using default of 2." << oendl; | ||
950 | pbWidth[ i ] = 2; | 955 | pbWidth[ i ] = 2; |
951 | } | 956 | } |
952 | } | 957 | } |
953 | 958 | ||
954 | 959 | ||
955 | // Various widget specific settings. This was more efficent when bunched | 960 | // Various widget specific settings. This was more efficent when bunched |
@@ -1000,13 +1005,13 @@ void OThemeBase::readResourceGroup( int i, QString *copyfrom, QString *pixnames, | |||
1000 | } | 1005 | } |
1001 | } | 1006 | } |
1002 | if ( loadArray[ sIndex ] ) { | 1007 | if ( loadArray[ sIndex ] ) { |
1003 | copyWidgetConfig( sIndex, i, pixnames, brdnames ); | 1008 | copyWidgetConfig( sIndex, i, pixnames, brdnames ); |
1004 | } | 1009 | } |
1005 | else | 1010 | else |
1006 | qDebug ( "OThemeBase: Unable to identify source widget for %s\n", widgetEntries[ i ] ); | 1011 | odebug << "OThemeBase: Unable to identify source widget for " << widgetEntries[ i ] << oendl; |
1007 | return ; | 1012 | return ; |
1008 | } | 1013 | } |
1009 | // special inheritance for disabled arrows (these are tri-state unlike | 1014 | // special inheritance for disabled arrows (these are tri-state unlike |
1010 | // the rest of what we handle). | 1015 | // the rest of what we handle). |
1011 | for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) { | 1016 | for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) { |
1012 | if ( tmpVal == i ) { | 1017 | if ( tmpVal == i ) { |