diff options
Diffstat (limited to 'client/deKoratorclient.cpp')
| -rw-r--r-- | client/deKoratorclient.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/client/deKoratorclient.cpp b/client/deKoratorclient.cpp index 0e9c694..80d379d 100644 --- a/client/deKoratorclient.cpp +++ b/client/deKoratorclient.cpp @@ -594,17 +594,30 @@ bool DeKoratorFactory::readConfig() // Load border pixmaps and try to also get pixmaps for inactive state. bool DeKoratorFactory::loadBorderPixmap(decoType borderPart, const TQString& newName, const TQString& oldName) { TQString decoPixDir = DeKoratorFactory::framesPath_; - - bool imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + newName + "Bg.png" ); + TQString preferredName; + TQString fallbackName; + + // Solve collision on parts 'bottomLeftFrame' and 'bottomRightFrame' between new and old image names. + if ( borderPart == bottomLeftFrame || borderPart == bottomRightFrame ) { + preferredName = oldName; + fallbackName = newName; + } + else + { + preferredName = newName; + fallbackName = oldName; + } + + bool imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + preferredName + "Bg.png" ); if ( imgLoaded ) { - if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + newName + "InactiveBg.png" ) ) - DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + newName + "Bg.png" ); + if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + preferredName + "InactiveBg.png" ) ) + DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + preferredName + "Bg.png" ); } else { - imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + oldName + "Bg.png" ); - if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + oldName + "InactiveBg.png" ) ) - DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + oldName + "Bg.png" ); + imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + fallbackName + "Bg.png" ); + if ( !DECOARR[ borderPart ][ inActOrig ]->load( decoPixDir + "/" + fallbackName + "InactiveBg.png" ) ) + DECOARR[ borderPart ][ inActOrig ] ->load( decoPixDir + "/" + fallbackName + "Bg.png" ); } if ( imgLoaded ) return true; |
