diff options
| author | Daniel Würl <trinity@dwrl.de> | 2025-03-10 12:59:04 +0100 |
|---|---|---|
| committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2025-03-17 12:13:38 +0900 |
| commit | 0dbee1608295bb86c33463a8bcc57f0d696c0436 (patch) | |
| tree | 3c05a90f95aae0ea6edeb5c88c2264e7f8a69153 | |
| parent | 50430830b30d1424cf178606a0c14a13386a49c3 (diff) | |
| download | twin-style-dekorator-0dbee160.tar.gz twin-style-dekorator-0dbee160.zip | |
Cleaned up empty lines and lines beginning with spaces. Changed evaluation of new frame parts to use && instead of ||, also replaced TRUE with true.
Signed-off-by: Daniel Würl <trinity@dwrl.de>
(cherry picked from commit 0f7b96bc062ba316ee92b25cc0b8d52b0c3b4ef0)
| -rw-r--r-- | client/deKoratorclient.cpp | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/client/deKoratorclient.cpp b/client/deKoratorclient.cpp index b83fcc2..efc2b36 100644 --- a/client/deKoratorclient.cpp +++ b/client/deKoratorclient.cpp @@ -605,10 +605,10 @@ void DeKoratorFactory::loadPixmaps() 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" ); - if ( ( optLeft == TRUE ) || ( optMid == TRUE ) || ( optRight == TRUE ) ) - HASTOPFRAME = TRUE; + if ( ( optLeft == true ) && ( optMid == true ) && ( optRight == true ) ) + HASTOPFRAME = true; else - HASTOPFRAME = FALSE; + HASTOPFRAME = false; // title bar from left to right DECOARR[ leftTopCornerFrame ][ orig ] ->load( decoPixDir + "/topLeftCornerBg.png" ); DECOARR[ buttonsLeft ][ orig ] ->load( decoPixDir + "/leftButtonsBg.png" ); @@ -630,10 +630,10 @@ void DeKoratorFactory::loadPixmaps() optLeft = DECOARR[ bottomShadedLeftFrame ][ orig ] ->load( decoPixDir + "/leftBottomShadedFrameBg.png" ); optMid = DECOARR[ bottomShadedMidFrame ][ orig ] ->load( decoPixDir + "/midBottomShadedFrameBg.png" ); optRight = DECOARR[ bottomShadedRightFrame ][ orig ] ->load( decoPixDir + "/rightBottomShadedFrameBg.png" ); - if ( ( optLeft == TRUE ) || ( optMid == TRUE ) || ( optRight == TRUE ) ) - HASBOTTOMSHADEDFRAME = TRUE; + if ( ( optLeft == true ) && ( optMid == true ) && ( optRight == true ) ) + HASBOTTOMSHADEDFRAME = true; else - HASBOTTOMSHADEDFRAME = FALSE; + HASBOTTOMSHADEDFRAME = false; // right frame from top to bottom DECOARR[ rightTopFrame ][ orig ] ->load( decoPixDir + "/topRightFrameBg.png" ); DECOARR[ rightMidFrame ][ orig ] ->load( decoPixDir + "/midRightFrameBg.png" ); @@ -1770,19 +1770,19 @@ void DeKoratorClient::init() bottomSpacer_ = new TQSpacerItem( 1, ( !isSetShade() || SHOWBTMBORDER ) ? BOTTOMFRAMESIZE : 0, TQSizePolicy::Expanding, TQSizePolicy::Fixed ); - + // layouts mainLayout_ = new TQVBoxLayout( widget(), 0, 0 ); //add top spacer atop the other layouts mainLayout_->addItem( topSpacer_ ); - + titleLayout_ = new TQHBoxLayout( mainLayout_, 0, 0 ); midLayout_ = new TQHBoxLayout( mainLayout_, 0, 0 ); - + // setup layout - - - + + + //left spacer titleLayout_->addItem( leftTitleBarSpacer_ ); // setup titlebar buttons @@ -2263,8 +2263,8 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co { return PositionCenter; } - - if ( HASTOPFRAME == TRUE && point.y() <= TOPFRAMESIZE ) + + if ( HASTOPFRAME == true && point.y() <= TOPFRAMESIZE ) { // inside top frame if ( point.x() <= TQMAX( TOPLEFTFRAMEWIDTH, LEFTFRAMESIZE ) ) @@ -2274,7 +2274,7 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co else pos = PositionTop; } - else if ( HASTOPFRAME == FALSE && point.y() <= 5 ) + else if ( HASTOPFRAME == false && point.y() <= 5 ) { // inside titlebar if ( point.x() <= TQMAX( BOTTOMLEFTFRAMEWIDTH, LEFTFRAMESIZE ) ) @@ -2297,7 +2297,7 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co else if ( point.x() <= LEFTFRAMESIZE ) { // on left frame - if ( HASTOPFRAME == TRUE && point.y() <= TOPFRAMESIZE + TITLESIZE ) + if ( HASTOPFRAME == true && point.y() <= TOPFRAMESIZE + TITLESIZE ) pos = PositionTopLeft; else if ( HASTOPFRAME == FALSE && point.y() <= TITLESIZE ) pos = PositionTopLeft; @@ -2309,9 +2309,9 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co else if ( point.x() >= width() - RIGHTFRAMESIZE ) { // on right frame - if ( HASTOPFRAME == TRUE && point.y() <= TOPFRAMESIZE + TITLESIZE ) + if ( HASTOPFRAME == true && point.y() <= TOPFRAMESIZE + TITLESIZE ) pos = PositionTopRight; - else if ( HASTOPFRAME == FALSE && point.y() <= TITLESIZE ) + else if ( HASTOPFRAME == false && point.y() <= TITLESIZE ) pos = PositionTopRight; else if ( point.y() >= ( height() - RIGHTBOTTOMCORNERFRAMEHEIGTH - BOTTOMFRAMESIZE ) ) pos = PositionBottomRight; @@ -2473,10 +2473,7 @@ void DeKoratorClient::paintEvent( TQPaintEvent* ) { if (background && DeKoratorFactory::transparency_) painter2.drawPixmap( 0, 0, *background, p.x(), p.y(), w, TOPFRAMESIZE + TITLESIZE ); - - - - + // top frame if ( w > 0 ) { // left @@ -2502,10 +2499,8 @@ void DeKoratorClient::paintEvent( TQPaintEvent* ) } } - - - - + + // leftTopCorner rect.setRect( 0, TOPFRAMESIZE, LEFTTOPCORNERWIDTH, TITLESIZE ); @@ -2678,7 +2673,7 @@ void DeKoratorClient::paintEvent( TQPaintEvent* ) if ( w > 0 ) { // shaded bottom border - if ( isShade() && HASBOTTOMSHADEDFRAME == TRUE ) + if ( isShade() && HASBOTTOMSHADEDFRAME == true ) { // left rect.setRect( 0 , h - BOTTOMSHADEDFRAMESIZE, TQMIN( BOTTOMSHADEDLEFTFRAMEWIDTH, w ) , BOTTOMSHADEDFRAMESIZE ); @@ -2976,12 +2971,11 @@ void DeKoratorClient::doShape() m.translate( pos, 0 ); mask -= m; } - + //top right m = TQRegion( decoFactory_->topRightCornerBitmap_ ); m.translate( width() - TOPRIGHTMASKWIDTH, 0 ); mask -= TQRegion( m ); - if ( !isShade() || SHOWBTMBORDER ) |
