summaryrefslogtreecommitdiffstats
path: root/client/deKoratorclient.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/deKoratorclient.cpp')
-rw-r--r--client/deKoratorclient.cpp127
1 files changed, 51 insertions, 76 deletions
diff --git a/client/deKoratorclient.cpp b/client/deKoratorclient.cpp
index e5d89d9..9ac8b34 100644
--- a/client/deKoratorclient.cpp
+++ b/client/deKoratorclient.cpp
@@ -589,6 +589,23 @@ bool DeKoratorFactory::readConfig()
}
//////////////////////////////////////////////////////////////////////////////
+// loadBorderPixmap()
+// ------------
+// 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" );
+ if ( ! imgLoaded )
+ imgLoaded = DECOARR[ borderPart ][ orig ] ->load( decoPixDir + "/" + oldName + "Bg.png" );
+
+ if ( imgLoaded )
+ return true;
+ else
+ return false;
+}
+
+//////////////////////////////////////////////////////////////////////////////
// loadPixmaps()
// ------------
// Read in the configuration file
@@ -600,82 +617,40 @@ void DeKoratorFactory::loadPixmaps()
// deco
- // 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" );
- }
+ // top frame from left to right
+ // enable only if all images exist
+ bool optLeft = loadBorderPixmap( topLeftFrame, "topLeftFrame", "leftTopFrame");
+ bool optMid = loadBorderPixmap( topMidFrame, "topMidFrame", "midTopFrame");
+ bool optRight = loadBorderPixmap( topRightFrame, "topRightFrame", "rightTopFrame");
+ HASTOPFRAME = optLeft && optMid && optRight;
+
+ // title bar from left to right
+ loadBorderPixmap( leftUpperCornerFrame, "leftUpperCornerFrame", "topLeftCorner");
+ loadBorderPixmap( buttonsLeft, "buttonsLeft", "leftButtons");
+ loadBorderPixmap( titleLeft, "titleLeft", "leftTitle");
+ loadBorderPixmap( titleMid, "titleMid", "midTitle");
+ loadBorderPixmap( titleRight, "titleRight", "rightTitle");
+ loadBorderPixmap( buttonsRight, "buttonsRight", "rightButtons");
+ loadBorderPixmap( rightUpperCornerFrame, "rightUpperCornerFrame", "topRightCorner");
+ // left frame from top to bottom
+ loadBorderPixmap( leftUpperFrame, "leftUpperFrame", "topLeftFrame");
+ loadBorderPixmap( leftMidFrame, "leftMidFrame", "midLeftFrame");
+ loadBorderPixmap( leftLowerCornerFrame, "leftLowerCornerFrame", "bottomLeftFrame");
+ // bottom frame from left to right
+ loadBorderPixmap( bottomLeftFrame, "bottomLeftFrame", "leftBottomFrame");
+ loadBorderPixmap( bottomMidFrame, "bottomMidFrame", "midBottomFrame");
+ loadBorderPixmap( bottomRightFrame, "bottomRightFrame", "rightBottomFrame");
+ // bottom shaded frame from left to right
+ // enable only if all images exist
+ optLeft = loadBorderPixmap( bottomShadedLeftFrame, "bottomShadedLeftFrame", "leftBottomShadedFrame");
+ optMid = loadBorderPixmap( bottomShadedMidFrame, "bottomShadedMidFrame", "midBottomShadedFrame");
+ optRight = loadBorderPixmap( bottomShadedRightFrame, "bottomShadedRightFrame", "rightBottomShadedFrame");
+ HASBOTTOMSHADEDFRAME = optLeft && optMid && optRight;
+
+ // right frame from top to bottom
+ loadBorderPixmap( rightUpperFrame, "rightUpperFrame", "topRightFrame");
+ loadBorderPixmap( rightMidFrame, "rightMidFrame", "midRightFrame");
+ loadBorderPixmap( rightLowerCornerFrame, "rightLowerCornerFrame", "bottomRightFrame");
// buttons