summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/othemebase.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp
index 00cea03..21d16f2 100644
--- a/noncore/styles/theme/othemebase.cpp
+++ b/noncore/styles/theme/othemebase.cpp
@@ -879,194 +879,198 @@ void OThemeBase::applyResourceGroup( Config *config, int i, QString *copyfrom, Q
else if ( tmpStr == "Horizontal" )
scaleHints [ i ] = HorizontalScale;
else if ( tmpStr == "Vertical" )
scaleHints [ i ] = VerticalScale;
else {
if ( tmpStr != "Tile" && !tmpStr.isEmpty() )
qDebug ( "OThemeBase: Unrecognized scale option %s, using Tile.\n", tmpStr.ascii() );
scaleHints [ i ] = TileScale;
}
// Gradient type
tmpStr = config->readEntry( "Gradient" );
if ( tmpStr == "Diagonal" )
gradients [ i ] = GrDiagonal;
else if ( tmpStr == "Horizontal" )
gradients [ i ] = GrHorizontal;
else if ( tmpStr == "Vertical" )
gradients [ i ] = GrVertical;
else if ( tmpStr == "Pyramid" )
gradients [ i ] = GrPyramid;
else if ( tmpStr == "Rectangle" )
gradients [ i ] = GrRectangle;
else if ( tmpStr == "Elliptic" )
gradients [ i ] = GrElliptic;
else if ( tmpStr == "ReverseBevel" )
gradients [ i ] = GrReverseBevel;
else {
if ( tmpStr != "None" && !tmpStr.isEmpty() )
qDebug ( "OThemeBase: Unrecognized gradient option %s, using None.\n", tmpStr.ascii() );
gradients [ i ] = GrNone;
}
// Blend intensity
blends[ i ] = config->readEntry( "BlendIntensity", "0.0" ).toDouble();
// Bevel contrast
bContrasts[ i ] = config->readNumEntry( "BevelContrast", 0 );
// Border width
borders [ i ] = config->readNumEntry( "Border", 1 );
// Highlight width
highlights [ i ] = config->readNumEntry( "Highlight", 1 );
// Gradient low color or blend background
if ( config->hasKey( "GradientLow" ) && ( gradients[ i ] != GrNone || blends[ i ] != 0.0 ))
grLowColors[ i ] = new QColor( strToColor ( config->readEntry( "GradientLow", qApp->palette().normal().background().name() )));
else
grLowColors[ i ] = NULL;
// Gradient high color
if ( config->hasKey( "GradientHigh" ) && ( gradients[ i ] != GrNone ))
grHighColors[ i ] = new QColor( strToColor ( config->readEntry( "GradientHigh", qApp->palette().normal().background().name() )));
else
grHighColors[ i ] = NULL;
// Extended color attributes
if ( config->hasKey( "Foreground" ) || config->hasKey( "Background" ) ) {
QColor bg = strToColor( config->readEntry( "Background", qApp->palette().normal().background().name() ));
QColor fg = strToColor( config->readEntry( "Foreground", qApp->palette().normal().foreground().name() ));
colors[ i ] = makeColorGroup( fg, bg, Qt::WindowsStyle );
}
else
colors[ i ] = NULL;
// Pixmap
tmpStr = config->readEntry( "Pixmap", "" );
pixnames[ i ] = tmpStr;
duplicate[ i ] = false;
pixmaps[ i ] = NULL;
images[ i ] = NULL;
// Pixmap border
tmpStr = config->readEntry( "PixmapBorder", "" );
brdnames[ i ] = tmpStr;
pbDuplicate[ i ] = false;
pbPixmaps[ i ] = NULL;
pbWidth[ i ] = 0;
if ( !tmpStr.isEmpty() ) {
pbWidth[ i ] = config->readNumEntry( "PixmapBWidth", 0 );
if ( pbWidth[ i ] == 0 ) {
qDebug ( "OThemeBase: No border width specified for pixmapped border widget %s\n", widgetEntries[ i ] );
qDebug ( "OThemeBase: Using default of 2.\n" );
pbWidth[ i ] = 2;
}
}
// Various widget specific settings. This was more efficent when bunched
// together in the misc group, but this makes an easier to read config.
if ( i == SliderGroove )
roundedSlider = config->readBoolEntry( "SmallGroove", false );
- else if ( i == ActiveTab || i == InactiveTab )
- aTabLine = iTabLine = config->readBoolEntry( "BottomLine", true );
+ else if ( i == ActiveTab ) {
+ aTabLine = config->readBoolEntry( "BottomLine", true );
+ }
+ else if ( i == InactiveTab ) {
+ iTabLine = config->readBoolEntry( "BottomLine", true );
+ }
else if ( i == Splitter )
splitterWidth = config->readNumEntry( "Width", 10 );
else if ( i == ComboBox || i == ComboBoxDown ) {
roundedCombo = config->readBoolEntry( "Round", false );
}
else if ( i == PushButton || i == PushButtonDown ) {
btnXShift = config->readNumEntry( "XShift", 0 );
btnYShift = config->readNumEntry( "YShift", 0 );
focus3D = config->readBoolEntry( "3DFocusRect", false );
focus3DOffset = config->readBoolEntry( "3DFocusOffset", 0 );
roundedButton = config->readBoolEntry( "Round", false );
}
}
void OThemeBase::readResourceGroup( int i, QString *copyfrom, QString *pixnames, QString *brdnames,
bool *loadArray )
{
if ( loadArray[ i ] == true ) {
return ; // already been preloaded.
}
int tmpVal;
QString tmpStr;
tmpStr = copyfrom [ i ];
if ( !tmpStr.isEmpty() ) { // Duplicate another widget's config
int sIndex;
loadArray[ i ] = true;
for ( sIndex = 0; sIndex < WIDGETS; ++sIndex ) {
if ( tmpStr == widgetEntries[ sIndex ] ) {
if ( !loadArray[ sIndex ] ) // hasn't been loaded yet
readResourceGroup( sIndex, copyfrom, pixnames, brdnames,
loadArray );
break;
}
}
if ( loadArray[ sIndex ] ) {
copyWidgetConfig( sIndex, i, pixnames, brdnames );
}
else
qDebug ( "OThemeBase: Unable to identify source widget for %s\n", widgetEntries[ i ] );
return ;
}
// special inheritance for disabled arrows (these are tri-state unlike
// the rest of what we handle).
for ( tmpVal = DisArrowUp; tmpVal <= DisArrowRight; ++tmpVal ) {
if ( tmpVal == i ) {
tmpStr = pixnames [ i ];
if ( tmpStr.isEmpty() ) {
copyWidgetConfig( ArrowUp + ( tmpVal - DisArrowUp ), i, pixnames,
brdnames );
return ;
}
}
}
// Pixmap
int existing;
// Scan for duplicate pixmaps(two identical pixmaps, tile scale, no blend,
// no pixmapped border)
if ( !pixnames [ i ].isEmpty() ) {
for ( existing = 0; existing < i; ++existing ) {
if ( pixnames[ i ] == pixnames[ existing ] && scaleHints[ i ] == TileScale &&
scaleHints[ existing ] == TileScale && blends[ existing ] == 0.0 &&
blends[ i ] == 0.0 ) {
pixmaps[ i ] = pixmaps[ existing ];
duplicate[ i ] = true;
break;
}
}
}
// load
if ( !duplicate[ i ] && !pixnames[ i ].isEmpty() ) {
pixmaps[ i ] = loadPixmap( pixnames[ i ] );
// load and save images for scaled/blended widgets for speed.
if ( scaleHints[ i ] == TileScale && blends[ i ] == 0.0 )
images[ i ] = NULL;
else
images[ i ] = loadImage( pixnames[ i ] );
}
// Pixmap border
if ( !brdnames [ i ]. isEmpty () ) {
// duplicate check
for ( existing = 0; existing < i; ++existing ) {
if ( brdnames [i] == brdnames[ existing ] ) {
pbPixmaps[ i ] = pbPixmaps[ existing ];
pbDuplicate[ i ] = true;
break;
}
}
}
// load
if ( !pbDuplicate[ i ] && !brdnames[ i ].isEmpty() )
pbPixmaps[ i ] = loadPixmap( brdnames[ i ] );