diff options
| author | Daniel Würl <trinity@dwrl.de> | 2025-03-22 19:10:20 +0100 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-03-26 17:25:26 +0900 |
| commit | 521f6d7e758c63358b6ec7ef4d5ff9b91d421589 (patch) | |
| tree | ecabbf8cbd05c8914e17ceed96bc42101f2b7cdd | |
| parent | bc0eb61f40f7508a1822edc1227c711796e843c5 (diff) | |
| download | twin-style-dekorator-521f6d7e.tar.gz twin-style-dekorator-521f6d7e.zip | |
Allow themes to use new filenames mirroring the new part names by checking for leftUpperCornerFrameBg.png, falling back to old file names if neccessary. Also use new files names in kcm.
Signed-off-by: Daniel Würl <trinity@dwrl.de>
(cherry picked from commit 8b707d2afc657b90b34f28675933badd28e29a62)
| -rw-r--r-- | client/config/themes.cpp | 28 | ||||
| -rw-r--r-- | client/deKoratorclient.cpp | 110 |
2 files changed, 97 insertions, 41 deletions
diff --git a/client/config/themes.cpp b/client/config/themes.cpp index 1688874..f309ba7 100644 --- a/client/config/themes.cpp +++ b/client/config/themes.cpp @@ -372,13 +372,27 @@ void IconThemesConfig::themeSelected( TQListViewItem *item, TQLabel *previewLabe } TQString dirNameStr = dirName + item->text( 0 ) + "/deco/" ; - topLeftCornerBg.load( dirNameStr + "topLeftCornerBg.png" ); - leftButtonsBg.load( dirNameStr + "leftButtonsBg" ); - leftTitleBg.load( dirNameStr + "leftTitleBg.png" ); - midTitleBg.load( dirNameStr + "midTitleBg.png" ); - rightTitleBg.load( dirNameStr + "rightTitleBg.png" ); - rightButtonsBg.load( dirNameStr + "rightButtonsBg.png" ); - topRightCornerBg.load( dirNameStr + "topRightCornerBg.png" ); + bool useNewFileNames = topLeftCornerBg.load( dirNameStr + "leftUpperCornerFrameBg.png" ); + + if ( useNewFileNames ) + { + leftButtonsBg.load( dirNameStr + "buttonsLeftBg" ); + leftTitleBg.load( dirNameStr + "titleLeftBg.png" ); + midTitleBg.load( dirNameStr + "titleMidBg.png" ); + rightTitleBg.load( dirNameStr + "titleRightBg.png" ); + rightButtonsBg.load( dirNameStr + "buttonsRightBg.png" ); + topRightCornerBg.load( dirNameStr + "rightUpperCornerFrameBg.png" ); + } + else + { + topLeftCornerBg.load( dirNameStr + "topLeftCornerBg.png" ); + leftButtonsBg.load( dirNameStr + "leftButtonsBg" ); + leftTitleBg.load( dirNameStr + "leftTitleBg.png" ); + midTitleBg.load( dirNameStr + "midTitleBg.png" ); + rightTitleBg.load( dirNameStr + "rightTitleBg.png" ); + rightButtonsBg.load( dirNameStr + "rightButtonsBg.png" ); + topRightCornerBg.load( dirNameStr + "topRightCornerBg.png" ); + } w = topLeftCornerBg.width() + leftButtonsBg.width() + leftTitleBg.width() + midTitleBg.width() + rightTitleBg.width() + rightButtonsBg.width() + topRightCornerBg.width() + 8; h = midTitleBg.height() + 8; diff --git a/client/deKoratorclient.cpp b/client/deKoratorclient.cpp index 4dd1834..e5d89d9 100644 --- a/client/deKoratorclient.cpp +++ b/client/deKoratorclient.cpp @@ -600,40 +600,82 @@ void DeKoratorFactory::loadPixmaps() // deco - // top frame from left to right - // enable if one of those images exist - bool optLeft = DECOARR[ topLeftFrame ][ orig ] ->load( decoPixDir + "/leftTopFrameBg.png" ); - bool optMid = DECOARR[ topMidFrame ][ orig ] ->load( decoPixDir + "/midTopFrameBg.png" ); - bool optRight = DECOARR[ topRightFrame ][ orig ] ->load( decoPixDir + "/rightTopFrameBg.png" ); - HASTOPFRAME = optLeft && optMid && optRight; - - // title bar from left to right - DECOARR[ leftUpperCornerFrame ][ orig ] ->load( decoPixDir + "/topLeftCornerBg.png" ); - DECOARR[ buttonsLeft ][ orig ] ->load( decoPixDir + "/leftButtonsBg.png" ); - DECOARR[ titleLeft ][ orig ] ->load( decoPixDir + "/leftTitleBg.png" ); - DECOARR[ titleMid ][ orig ] ->load( decoPixDir + "/midTitleBg.png" ); - DECOARR[ titleRight ][ orig ] ->load( decoPixDir + "/rightTitleBg.png" ); - DECOARR[ buttonsRight ][ orig ] ->load( decoPixDir + "/rightButtonsBg.png" ); - DECOARR[ rightUpperCornerFrame ][ orig ] ->load( decoPixDir + "/topRightCornerBg.png" ); - // left frame from top to bottom - DECOARR[ leftUpperFrame ][ orig ] ->load( decoPixDir + "/topLeftFrameBg.png" ); - DECOARR[ leftMidFrame ][ orig ] ->load( decoPixDir + "/midLeftFrameBg.png" ); - DECOARR[ leftLowerCornerFrame ][ orig ] ->load( decoPixDir + "/bottomLeftFrameBg.png" ); - // bottom frame from left to right - DECOARR[ bottomLeftFrame ][ orig ] ->load( decoPixDir + "/leftBottomFrameBg.png" ); - DECOARR[ bottomMidFrame ][ orig ] ->load( decoPixDir + "/midBottomFrameBg.png" ); - DECOARR[ bottomRightFrame ][ orig ] ->load( decoPixDir + "/rightBottomFrameBg.png" ); - // bottom shaded frame from left to right - // enable if one of those images exist - optLeft = DECOARR[ bottomShadedLeftFrame ][ orig ] ->load( decoPixDir + "/leftBottomShadedFrameBg.png" ); - optMid = DECOARR[ bottomShadedMidFrame ][ orig ] ->load( decoPixDir + "/midBottomShadedFrameBg.png" ); - optRight = DECOARR[ bottomShadedRightFrame ][ orig ] ->load( decoPixDir + "/rightBottomShadedFrameBg.png" ); - HASBOTTOMSHADEDFRAME = optLeft && optMid && optRight; - - // right frame from top to bottom - DECOARR[ rightUpperFrame ][ orig ] ->load( decoPixDir + "/topRightFrameBg.png" ); - DECOARR[ rightMidFrame ][ orig ] ->load( decoPixDir + "/midRightFrameBg.png" ); - DECOARR[ rightLowerCornerFrame ][ orig ] ->load( decoPixDir + "/bottomRightFrameBg.png" ); + // image 'leftUpperCornerFrameBg.png' doesn't exist in the old naming scheme, so we can simply check for that. + bool useNewFileNames = DECOARR[ leftUpperCornerFrame ][ orig ] ->load( decoPixDir + "/leftUpperCornerFrameBg.png" ); + if ( useNewFileNames ) + { + // top frame from left to right + // enable if one of those images exist + bool optLeft = DECOARR[ topLeftFrame ][ orig ] ->load( decoPixDir + "/topLeftFrameBg.png" ); + bool optMid = DECOARR[ topMidFrame ][ orig ] ->load( decoPixDir + "/topMidFrameBg.png" ); + bool optRight = DECOARR[ topRightFrame ][ orig ] ->load( decoPixDir + "/topRightFrameBg.png" ); + HASTOPFRAME = optLeft && optMid && optRight; + + // title bar from left to right + DECOARR[ leftUpperCornerFrame ][ orig ] ->load( decoPixDir + "/leftUpperCornerFrameBg.png" ); + DECOARR[ buttonsLeft ][ orig ] ->load( decoPixDir + "/buttonsLeftBg.png" ); + DECOARR[ titleLeft ][ orig ] ->load( decoPixDir + "/titleLeftBg.png" ); + DECOARR[ titleMid ][ orig ] ->load( decoPixDir + "/titleMidBg.png" ); + DECOARR[ titleRight ][ orig ] ->load( decoPixDir + "/titleRightBg.png" ); + DECOARR[ buttonsRight ][ orig ] ->load( decoPixDir + "/buttonsRightBg.png" ); + DECOARR[ rightUpperCornerFrame ][ orig ] ->load( decoPixDir + "/rightUpperCornerFrameBg.png" ); + // left frame from top to bottom + DECOARR[ leftUpperFrame ][ orig ] ->load( decoPixDir + "/leftUpperFrameBg.png" ); + DECOARR[ leftMidFrame ][ orig ] ->load( decoPixDir + "/leftMidFrameBg.png" ); + DECOARR[ leftLowerCornerFrame ][ orig ] ->load( decoPixDir + "/leftLowerCornerFrameBg.png" ); + // bottom frame from left to right + DECOARR[ bottomLeftFrame ][ orig ] ->load( decoPixDir + "/bottomLeftFrameBg.png" ); + DECOARR[ bottomMidFrame ][ orig ] ->load( decoPixDir + "/bottomMidFrameBg.png" ); + DECOARR[ bottomRightFrame ][ orig ] ->load( decoPixDir + "/bottomRightFrameBg.png" ); + // bottom shaded frame from left to right + // enable if one of those images exist + optLeft = DECOARR[ bottomShadedLeftFrame ][ orig ] ->load( decoPixDir + "/bottomShadedLeftFrameBg.png" ); + optMid = DECOARR[ bottomShadedMidFrame ][ orig ] ->load( decoPixDir + "/bottomShadedMidFrameBg.png" ); + optRight = DECOARR[ bottomShadedRightFrame ][ orig ] ->load( decoPixDir + "/bottomShadedRightFrameBg.png" ); + HASBOTTOMSHADEDFRAME = optLeft && optMid && optRight; + + // right frame from top to bottom + DECOARR[ rightUpperFrame ][ orig ] ->load( decoPixDir + "/rightUpperFrameBg.png" ); + DECOARR[ rightMidFrame ][ orig ] ->load( decoPixDir + "/rightMidFrameBg.png" ); + DECOARR[ rightLowerCornerFrame ][ orig ] ->load( decoPixDir + "/rightLowerCornerFrameBg.png" ); + } + else + { + // top frame from left to right + // enable if one of those images exist + bool optLeft = DECOARR[ topLeftFrame ][ orig ] ->load( decoPixDir + "/leftTopFrameBg.png" ); + bool optMid = DECOARR[ topMidFrame ][ orig ] ->load( decoPixDir + "/midTopFrameBg.png" ); + bool optRight = DECOARR[ topRightFrame ][ orig ] ->load( decoPixDir + "/rightTopFrameBg.png" ); + HASTOPFRAME = optLeft && optMid && optRight; + + // title bar from left to right + DECOARR[ leftUpperCornerFrame ][ orig ] ->load( decoPixDir + "/topLeftCornerBg.png" ); + DECOARR[ buttonsLeft ][ orig ] ->load( decoPixDir + "/leftButtonsBg.png" ); + DECOARR[ titleLeft ][ orig ] ->load( decoPixDir + "/leftTitleBg.png" ); + DECOARR[ titleMid ][ orig ] ->load( decoPixDir + "/midTitleBg.png" ); + DECOARR[ titleRight ][ orig ] ->load( decoPixDir + "/rightTitleBg.png" ); + DECOARR[ buttonsRight ][ orig ] ->load( decoPixDir + "/rightButtonsBg.png" ); + DECOARR[ rightUpperCornerFrame ][ orig ] ->load( decoPixDir + "/topRightCornerBg.png" ); + // left frame from top to bottom + DECOARR[ leftUpperFrame ][ orig ] ->load( decoPixDir + "/topLeftFrameBg.png" ); + DECOARR[ leftMidFrame ][ orig ] ->load( decoPixDir + "/midLeftFrameBg.png" ); + DECOARR[ leftLowerCornerFrame ][ orig ] ->load( decoPixDir + "/bottomLeftFrameBg.png" ); + // bottom frame from left to right + DECOARR[ bottomLeftFrame ][ orig ] ->load( decoPixDir + "/leftBottomFrameBg.png" ); + DECOARR[ bottomMidFrame ][ orig ] ->load( decoPixDir + "/midBottomFrameBg.png" ); + DECOARR[ bottomRightFrame ][ orig ] ->load( decoPixDir + "/rightBottomFrameBg.png" ); + // bottom shaded frame from left to right + // enable if one of those images exist + optLeft = DECOARR[ bottomShadedLeftFrame ][ orig ] ->load( decoPixDir + "/leftBottomShadedFrameBg.png" ); + optMid = DECOARR[ bottomShadedMidFrame ][ orig ] ->load( decoPixDir + "/midBottomShadedFrameBg.png" ); + optRight = DECOARR[ bottomShadedRightFrame ][ orig ] ->load( decoPixDir + "/rightBottomShadedFrameBg.png" ); + HASBOTTOMSHADEDFRAME = optLeft && optMid && optRight; + + // right frame from top to bottom + DECOARR[ rightUpperFrame ][ orig ] ->load( decoPixDir + "/topRightFrameBg.png" ); + DECOARR[ rightMidFrame ][ orig ] ->load( decoPixDir + "/midRightFrameBg.png" ); + DECOARR[ rightLowerCornerFrame ][ orig ] ->load( decoPixDir + "/bottomRightFrameBg.png" ); + } // buttons |
