summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Würl <trinity@dwrl.de>2025-03-03 18:05:47 +0100
committerMichele Calgaro <michele.calgaro@yahoo.it>2025-03-17 12:13:38 +0900
commit50430830b30d1424cf178606a0c14a13386a49c3 (patch)
tree257041a2b411dc060d79e5650e12b5ba0c5bc323
parent3b6894047b20408920d6fddf8b9e043d585d84f4 (diff)
downloadtwin-style-dekorator-50430830.tar.gz
twin-style-dekorator-50430830.zip
Add support for top border above the title bar and for bottom border on shaded windows. Adjust resizing handles to consider the new images.
Signed-off-by: Daniel Würl <trinity@dwrl.de> (cherry picked from commit 215d11de367f7573c28485789403014ca496b263)
-rw-r--r--client/deKoratorclient.cpp507
-rw-r--r--client/deKoratorclient.h38
2 files changed, 360 insertions, 185 deletions
diff --git a/client/deKoratorclient.cpp b/client/deKoratorclient.cpp
index 47355c0..b83fcc2 100644
--- a/client/deKoratorclient.cpp
+++ b/client/deKoratorclient.cpp
@@ -51,21 +51,30 @@ static TQColor STYLEBGCOL;
// frames
static int TITLESIZE = 0;
+static int TOPFRAMESIZE = 0;
static int LEFTFRAMESIZE = 0;
-static int BUTTOMFRAMESIZE = 0;
+static int BOTTOMFRAMESIZE = 0;
+static int BOTTOMSHADEDFRAMESIZE = 0;
static int RIGHTFRAMESIZE = 0;
+static bool HASTOPFRAME = FALSE;
+static bool HASBOTTOMSHADEDFRAME = FALSE;
+
// deco
-static int TOPLEFTCORNERWIDTH;
-static int TOPRIGHTCORNERWIDTH;
-static int LEFTTITLEWIDTH;
-static int RIGHTTITLEWIDTH;
-static int TOPLEFTFRAMEHEIGHT;
-static int BOTTOMLEFTFRAMEHEIGHT;
-static int TOPRIGHTFRAMEHEIGHT;
-static int BOTTOMRIGHTFRAMEHEIGHT;
-static int LEFTBOTTOMFRAMEWIDTH;
-static int RIGHTBOTTOMFRAMEWIDTH;
+static int LEFTTOPCORNERWIDTH;
+static int RIGHTTOPCORNERWIDTH;
+static int TITLELEFTWIDTH;
+static int TITLERIGHTWIDTH;
+static int LEFTTOPFRAMEHEIGHT;
+static int LEFTBOTTOMCORNERFRAMEHEIGHT;
+static int RIGHTTOPFRAMEHEIGHT;
+static int RIGHTBOTTOMCORNERFRAMEHEIGTH;
+static int BOTTOMLEFTFRAMEWIDTH;
+static int BOTTOMRIGHTFRAMEWIDTH;
+static int BOTTOMSHADEDLEFTFRAMEWIDTH;
+static int BOTTOMSHADEDRIGHTFRAMEWIDTH;
+static int TOPLEFTFRAMEWIDTH;
+static int TOPRIGHTFRAMEWIDTH;
// buttons
//static const int DECOSIZE = 24;
@@ -99,10 +108,16 @@ static int TOPRIGHTMASKWIDTH = 0;
static int BOTTOMLEFTMASKWIDTH = 0;
static int BOTTOMMIDMASKWIDTH = 0;
static int BOTTOMRIGHTMASKWIDTH = 0;
+static int BOTTOMSHADEDLEFTMASKWIDTH = 0;
+static int BOTTOMSHADEDMIDMASKWIDTH = 0;
+static int BOTTOMSHADEDRIGHTMASKWIDTH = 0;
static int BOTTOMLEFTMASKHEIGHT = 0;
static int BOTTOMMIDMASKHEIGHT = 0;
static int BOTTOMRIGHTMASKHEIGHT = 0;
+static int BOTTOMSHADEDLEFTMASKHEIGHT = 0;
+static int BOTTOMSHADEDMIDMASKHEIGHT = 0;
+static int BOTTOMSHADEDRIGHTMASKHEIGHT = 0;
// config
// misc
@@ -585,26 +600,44 @@ void DeKoratorFactory::loadPixmaps()
// deco
- // top bar from left to right
- DECOARR[ topLeftCorner ][ orig ] ->load( decoPixDir + "/topLeftCornerBg.png" );
- DECOARR[ leftButtons ][ orig ] ->load( decoPixDir + "/leftButtonsBg.png" );
- DECOARR[ leftTitle ][ orig ] ->load( decoPixDir + "/leftTitleBg.png" );
- DECOARR[ midTitle ][ orig ] ->load( decoPixDir + "/midTitleBg.png" );
- DECOARR[ rightTitle ][ orig ] ->load( decoPixDir + "/rightTitleBg.png" );
- DECOARR[ rightButtons ][ orig ] ->load( decoPixDir + "/rightButtonsBg.png" );
- DECOARR[ topRightCorner ][ orig ] ->load( decoPixDir + "/topRightCornerBg.png" );
- // left frame from top to buttom
- DECOARR[ topLeftFrame ][ orig ] ->load( decoPixDir + "/topLeftFrameBg.png" );
- DECOARR[ midLeftFrame ][ orig ] ->load( decoPixDir + "/midLeftFrameBg.png" );
- DECOARR[ buttomLeftFrame ][ orig ] ->load( decoPixDir + "/bottomLeftFrameBg.png" );
- // buttom frame from left to right
- DECOARR[ leftButtomFrame ][ orig ] ->load( decoPixDir + "/leftBottomFrameBg.png" );
- DECOARR[ midButtomFrame ][ orig ] ->load( decoPixDir + "/midBottomFrameBg.png" );
- DECOARR[ rightButtomFrame ][ orig ] ->load( decoPixDir + "/rightBottomFrameBg.png" );
- // right frame from top to buttom
- DECOARR[ topRightFrame ][ orig ] ->load( decoPixDir + "/topRightFrameBg.png" );
- DECOARR[ midRightFrame ][ orig ] ->load( decoPixDir + "/midRightFrameBg.png" );
- DECOARR[ buttomRightFrame ][ orig ] ->load( decoPixDir + "/bottomRightFrameBg.png" );
+ // 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" );
+ if ( ( optLeft == TRUE ) || ( optMid == TRUE ) || ( optRight == TRUE ) )
+ HASTOPFRAME = TRUE;
+ else
+ HASTOPFRAME = FALSE;
+ // title bar from left to right
+ DECOARR[ leftTopCornerFrame ][ 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[ rightTopCornerFrame ][ orig ] ->load( decoPixDir + "/topRightCornerBg.png" );
+ // left frame from top to bottom
+ DECOARR[ leftTopFrame ][ orig ] ->load( decoPixDir + "/topLeftFrameBg.png" );
+ DECOARR[ leftMidFrame ][ orig ] ->load( decoPixDir + "/midLeftFrameBg.png" );
+ DECOARR[ leftBottomCornerFrame ][ 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" );
+ if ( ( optLeft == TRUE ) || ( optMid == TRUE ) || ( optRight == TRUE ) )
+ HASBOTTOMSHADEDFRAME = TRUE;
+ else
+ HASBOTTOMSHADEDFRAME = FALSE;
+ // right frame from top to bottom
+ DECOARR[ rightTopFrame ][ orig ] ->load( decoPixDir + "/topRightFrameBg.png" );
+ DECOARR[ rightMidFrame ][ orig ] ->load( decoPixDir + "/midRightFrameBg.png" );
+ DECOARR[ rightBottomCornerFrame ][ orig ] ->load( decoPixDir + "/bottomRightFrameBg.png" );
// buttons
@@ -672,6 +705,9 @@ void DeKoratorFactory::loadPixmaps()
buttomLeftCornerBitmap_ = TQBitmap( masksPixDir + "/buttomLeftCornerBitmap.png" );
buttomMidBitmap_ = TQBitmap( masksPixDir + "/buttomMidBitmap.png" );
buttomRightCornerBitmap_ = TQBitmap( masksPixDir + "/buttomRightCornerBitmap.png" );
+ buttomShadedLeftCornerBitmap_ = TQBitmap( masksPixDir + "/buttomShadedLeftCornerBitmap.png" );
+ buttomShadedMidBitmap_ = TQBitmap( masksPixDir + "/buttomShadedMidBitmap.png" );
+ buttomShadedRightCornerBitmap_ = TQBitmap( masksPixDir + "/buttomShadedRightCornerBitmap.png" );
determineSizes();
@@ -688,21 +724,27 @@ void DeKoratorFactory::determineSizes()
//MARGIN = midButtomFrameBg_.height();
// frames
- TITLESIZE = DECOARR[ midTitle ][ orig ] ->height();
- LEFTFRAMESIZE = DECOARR[ midLeftFrame ][ orig ] ->width();
- BUTTOMFRAMESIZE = DECOARR[ midButtomFrame ][ orig ] ->height();
- RIGHTFRAMESIZE = DECOARR[ midRightFrame ][ orig ] ->width();
-
- TOPLEFTCORNERWIDTH = DECOARR[ topLeftCorner ][ orig ] ->width();
- TOPRIGHTCORNERWIDTH = DECOARR[ topRightCorner ][ orig ] ->width();
- LEFTTITLEWIDTH = DECOARR[ leftTitle ][ orig ] ->width();
- RIGHTTITLEWIDTH = DECOARR[ rightTitle ][ orig ] ->width();
- TOPLEFTFRAMEHEIGHT = DECOARR[ topLeftFrame ][ orig ] ->height();
- BOTTOMLEFTFRAMEHEIGHT = DECOARR[ buttomLeftFrame ][ orig ] ->height();
- TOPRIGHTFRAMEHEIGHT = DECOARR[ topRightFrame ][ orig ] ->height();
- BOTTOMRIGHTFRAMEHEIGHT = DECOARR[ buttomRightFrame ][ orig ] ->height();
- LEFTBOTTOMFRAMEWIDTH = DECOARR[ leftButtomFrame ][ orig ] ->width();
- RIGHTBOTTOMFRAMEWIDTH = DECOARR[ rightButtomFrame ][ orig ] ->width();
+ TOPFRAMESIZE = HASTOPFRAME ? DECOARR[ topMidFrame ][ orig ] ->height() : 0;
+ TITLESIZE = DECOARR[ titleMid ][ orig ] ->height();
+ LEFTFRAMESIZE = DECOARR[ leftMidFrame ][ orig ] ->width();
+ BOTTOMFRAMESIZE = DECOARR[ bottomMidFrame ][ orig ] ->height();
+ BOTTOMSHADEDFRAMESIZE = DECOARR[ bottomShadedMidFrame ][ orig ] ->height();
+ RIGHTFRAMESIZE = DECOARR[ rightMidFrame ][ orig ] ->width();
+
+ LEFTTOPCORNERWIDTH = DECOARR[ leftTopCornerFrame ][ orig ] ->width();
+ RIGHTTOPCORNERWIDTH = DECOARR[ rightTopCornerFrame ][ orig ] ->width();
+ TITLELEFTWIDTH = DECOARR[ titleLeft ][ orig ] ->width();
+ TITLERIGHTWIDTH = DECOARR[ titleRight ][ orig ] ->width();
+ LEFTTOPFRAMEHEIGHT = DECOARR[ leftTopFrame ][ orig ] ->height();
+ LEFTBOTTOMCORNERFRAMEHEIGHT = DECOARR[ leftBottomCornerFrame ][ orig ] ->height();
+ RIGHTTOPFRAMEHEIGHT = DECOARR[ rightTopFrame ][ orig ] ->height();
+ RIGHTBOTTOMCORNERFRAMEHEIGTH = DECOARR[ rightBottomCornerFrame ][ orig ] ->height();
+ BOTTOMLEFTFRAMEWIDTH = DECOARR[ bottomLeftFrame ][ orig ] ->width();
+ BOTTOMRIGHTFRAMEWIDTH = DECOARR[ bottomRightFrame ][ orig ] ->width();
+ BOTTOMSHADEDLEFTFRAMEWIDTH = DECOARR[ bottomShadedLeftFrame ][ orig ] ->width();
+ BOTTOMSHADEDRIGHTFRAMEWIDTH = DECOARR[ bottomShadedRightFrame ][ orig ] ->width();
+ TOPLEFTFRAMEWIDTH = DECOARR[ topLeftFrame ][ orig ] ->width();
+ TOPRIGHTFRAMEWIDTH = DECOARR[ topRightFrame ][ orig ] ->width();
// buttons
@@ -735,10 +777,16 @@ void DeKoratorFactory::determineSizes()
BOTTOMLEFTMASKWIDTH = buttomLeftCornerBitmap_.width();
BOTTOMMIDMASKWIDTH = buttomMidBitmap_.width();
BOTTOMRIGHTMASKWIDTH = buttomRightCornerBitmap_.width();
+ BOTTOMSHADEDLEFTMASKWIDTH = buttomShadedLeftCornerBitmap_.width();
+ BOTTOMSHADEDMIDMASKWIDTH = buttomShadedMidBitmap_.width();
+ BOTTOMSHADEDRIGHTMASKWIDTH = buttomShadedRightCornerBitmap_.width();
BOTTOMLEFTMASKHEIGHT = buttomLeftCornerBitmap_.height();
BOTTOMMIDMASKHEIGHT = buttomMidBitmap_.height();
BOTTOMRIGHTMASKHEIGHT = buttomRightCornerBitmap_.height();
+ BOTTOMSHADEDLEFTMASKHEIGHT = buttomShadedLeftCornerBitmap_.height();
+ BOTTOMSHADEDMIDMASKHEIGHT = buttomShadedMidBitmap_.height();
+ BOTTOMSHADEDRIGHTMASKHEIGHT = buttomShadedRightCornerBitmap_.height();
}
@@ -1390,9 +1438,9 @@ void DeKoratorButton::drawButton( TQPainter * painter )
// fill background
if ( isLeft_ )
- painter->drawTiledPixmap( rect(), act ? *( DECOPIXACTARR[ leftButtons ] ) : *( DECOPIXINACTARR[ leftButtons ] ) );
+ painter->drawTiledPixmap( rect(), act ? *( DECOPIXACTARR[ buttonsLeft ] ) : *( DECOPIXINACTARR[ buttonsLeft ] ) );
else
- painter->drawTiledPixmap( rect(), act ? *( DECOPIXACTARR[ rightButtons ] ) : *( DECOPIXINACTARR[ rightButtons ] ) );
+ painter->drawTiledPixmap( rect(), act ? *( DECOPIXACTARR[ buttonsRight ] ) : *( DECOPIXINACTARR[ buttonsRight ] ) );
// apply app icon effects
if ( type_ == ButtonMenu && !USEMENUEIMAGE )
@@ -1477,7 +1525,9 @@ void DeKoratorButton::drawButton( TQPainter * painter )
if ( client_->isShade() && !SHOWBTMBORDER )
{
- painter->setPen( TQColor( 70, 70, 70 ) );
+ TQColorGroup g;
+ g = KDecoration::options()->colorGroup(KDecoration::ColorButtonBg, true);
+ painter->setPen( TQColor( g.dark().dark(155) ) );
painter->drawLine( 0, BUTTONSHEIGHT - 1, buttonWidth_ - 1, BUTTONSHEIGHT - 1 );
}
}
@@ -1628,7 +1678,7 @@ void DeKoratorButton::animate()
// ---------------
// Constructor
DeKoratorClient::DeKoratorClient( KDecorationBridge * b, KDecorationFactory * f )
- : KDecoration( b, f ), mainLayout_( NULL ), titleLayout_( NULL ), midLayout_( NULL ) , leftTitleBarSpacer_( NULL ), titleBarSpacer_( NULL ), rightTitleBarSpacer_( NULL ), leftSpacer_( NULL ), rightSpacer_( NULL ), bottomSpacer_( NULL ), captionBufferDirty_( true )
+ : KDecoration( b, f ), mainLayout_( NULL ), titleLayout_( NULL ), midLayout_( NULL ) , topSpacer_( NULL ),leftTitleBarSpacer_( NULL ), titleBarSpacer_( NULL ), rightTitleBarSpacer_( NULL ), leftSpacer_( NULL ), rightSpacer_( NULL ), bottomSpacer_( NULL ), captionBufferDirty_( true )
{
//captionBufferDirty_ = true;
//maskDirty_ = true;
@@ -1677,6 +1727,7 @@ void DeKoratorClient::init()
delete titleLayout_;
delete midLayout_;
// spacers
+ delete topSpacer_;
delete leftTitleBarSpacer_;
delete titleBarSpacer_;
delete rightTitleBarSpacer_;
@@ -1703,28 +1754,35 @@ void DeKoratorClient::init()
midRightFrameBg[ normal ] ->load( decoPixDir + "/midRightFrameBg.png" );
buttomRightFrameBg[ normal ] ->load( decoPixDir + "/bottomRightFrameBg.png" );*/
- // layouts
- mainLayout_ = new TQVBoxLayout( widget(), 0, 0 );
- titleLayout_ = new TQHBoxLayout( mainLayout_, 0, 0 );
- midLayout_ = new TQHBoxLayout( mainLayout_, 0, 0 );
-
// spacers
- leftTitleBarSpacer_ = new TQSpacerItem( TOPLEFTCORNERWIDTH, TITLESIZE,
+ topSpacer_ = new TQSpacerItem( 1, TOPFRAMESIZE,
+ TQSizePolicy::Expanding, TQSizePolicy::Fixed );
+ leftTitleBarSpacer_ = new TQSpacerItem( LEFTTOPCORNERWIDTH, TITLESIZE,
TQSizePolicy::Fixed, TQSizePolicy::Fixed );
titleBarSpacer_ = new TQSpacerItem( 1, TITLESIZE, TQSizePolicy::Expanding,
TQSizePolicy::Fixed );
- rightTitleBarSpacer_ = new TQSpacerItem( TOPRIGHTCORNERWIDTH, TITLESIZE,
+ rightTitleBarSpacer_ = new TQSpacerItem( RIGHTTOPCORNERWIDTH, TITLESIZE,
TQSizePolicy::Fixed, TQSizePolicy::Fixed );
leftSpacer_ = new TQSpacerItem( LEFTFRAMESIZE, 1,
TQSizePolicy::Fixed, TQSizePolicy::Expanding );
rightSpacer_ = new TQSpacerItem( RIGHTFRAMESIZE, 1,
TQSizePolicy::Fixed, TQSizePolicy::Expanding );
- bottomSpacer_ = new TQSpacerItem( 1, ( !isSetShade() || SHOWBTMBORDER ) ? BUTTOMFRAMESIZE : 0,
+ 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
@@ -2152,16 +2210,16 @@ void DeKoratorClient::borders( int & l, int & r, int & t, int & b ) const
{
l = LEFTFRAMESIZE;
r = RIGHTFRAMESIZE;
- t = TITLESIZE ;
+ t = TOPFRAMESIZE + TITLESIZE ;
// if ( SHOWBTMBORDER )
//b = 10;
// else
- // b = isShade() ? 0 : BUTTOMFRAMESIZE;
- //b = SHOWBTMBORDER ? BUTTOMFRAMESIZE : isShade() ? 1 : BUTTOMFRAMESIZE;
+ // b = isShade() ? 0 : BOTTOMFRAMESIZE;
+ //b = SHOWBTMBORDER ? BOTTOMFRAMESIZE : isShade() ? 1 : BOTTOMFRAMESIZE;
if ( !isShade() || SHOWBTMBORDER )
{
- b = BUTTOMFRAMESIZE;
- bottomSpacer_->changeSize( 1, BUTTOMFRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed );
+ b = BOTTOMFRAMESIZE;
+ bottomSpacer_->changeSize( 1, BOTTOMFRAMESIZE, TQSizePolicy::Expanding, TQSizePolicy::Fixed );
}
else
{
@@ -2187,7 +2245,7 @@ void DeKoratorClient::resize( const TQSize & size )
TQSize DeKoratorClient::minimumSize() const
{
TQSize size = widget() ->minimumSize();
- size.setWidth( size.width() + TOPLEFTCORNERWIDTH + TOPRIGHTCORNERWIDTH );
+ size.setWidth( size.width() + LEFTTOPCORNERWIDTH + RIGHTTOPCORNERWIDTH );
return size;
@@ -2205,23 +2263,33 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co
{
return PositionCenter;
}
-
- if ( point.y() <= 5 )
+
+ if ( HASTOPFRAME == TRUE && point.y() <= TOPFRAMESIZE )
{
// inside top frame
- if ( point.x() <= LEFTFRAMESIZE )
+ if ( point.x() <= TQMAX( TOPLEFTFRAMEWIDTH, LEFTFRAMESIZE ) )
pos = PositionTopLeft;
- else if ( point.x() >= ( width() - RIGHTFRAMESIZE ) )
+ else if ( point.x() >= ( width() - TQMAX( TOPRIGHTFRAMEWIDTH, RIGHTFRAMESIZE ) ) )
pos = PositionTopRight;
else
pos = PositionTop;
}
- else if ( point.y() >= ( height() - BUTTOMFRAMESIZE ) )
+ else if ( HASTOPFRAME == FALSE && point.y() <= 5 )
+ {
+ // inside titlebar
+ if ( point.x() <= TQMAX( BOTTOMLEFTFRAMEWIDTH, LEFTFRAMESIZE ) )
+ pos = PositionTopLeft;
+ else if ( point.x() >= ( width() - TQMAX( BOTTOMRIGHTFRAMEWIDTH, RIGHTFRAMESIZE ) ) )
+ pos = PositionTopRight;
+ else
+ pos = PositionTop;
+ }
+ else if ( point.y() >= ( height() - BOTTOMFRAMESIZE ) )
{
// inside handle
- if ( point.x() <= std::max( LEFTBOTTOMFRAMEWIDTH, LEFTFRAMESIZE ) )
+ if ( point.x() <= TQMAX( BOTTOMLEFTFRAMEWIDTH, LEFTFRAMESIZE ) )
pos = PositionBottomLeft;
- else if ( point.x() >= ( width() - std::max( RIGHTBOTTOMFRAMEWIDTH, RIGHTFRAMESIZE ) ) )
+ else if ( point.x() >= ( width() - TQMAX( BOTTOMRIGHTFRAMEWIDTH, RIGHTFRAMESIZE ) ) )
pos = PositionBottomRight;
else
pos = PositionBottom;
@@ -2229,9 +2297,11 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co
else if ( point.x() <= LEFTFRAMESIZE )
{
// on left frame
- if ( point.y() <= TITLESIZE )
+ if ( HASTOPFRAME == TRUE && point.y() <= TOPFRAMESIZE + TITLESIZE )
+ pos = PositionTopLeft;
+ else if ( HASTOPFRAME == FALSE && point.y() <= TITLESIZE )
pos = PositionTopLeft;
- else if ( point.y() >= ( height() - BOTTOMLEFTFRAMEHEIGHT - BUTTOMFRAMESIZE ) )
+ else if ( point.y() >= ( height() - LEFTBOTTOMCORNERFRAMEHEIGHT - BOTTOMFRAMESIZE ) )
pos = PositionBottomLeft;
else
pos = PositionLeft;
@@ -2239,9 +2309,11 @@ KDecoration::Position DeKoratorClient::mousePosition( const TQPoint & point ) co
else if ( point.x() >= width() - RIGHTFRAMESIZE )
{
// on right frame
- if ( point.y() <= TITLESIZE )
+ if ( HASTOPFRAME == TRUE && point.y() <= TOPFRAMESIZE + TITLESIZE )
+ pos = PositionTopRight;
+ else if ( HASTOPFRAME == FALSE && point.y() <= TITLESIZE )
pos = PositionTopRight;
- else if ( point.y() >= ( height() - BOTTOMRIGHTFRAMEHEIGHT - BUTTOMFRAMESIZE ) )
+ else if ( point.y() >= ( height() - RIGHTBOTTOMCORNERFRAMEHEIGTH - BOTTOMFRAMESIZE ) )
pos = PositionBottomRight;
else
pos = PositionRight;
@@ -2396,66 +2468,98 @@ void DeKoratorClient::paintEvent( TQPaintEvent* )
painter.drawPixmap( 0, 0, *background, p.x(), p.y(), w, h );
TQPainter painter2;
- TQPixmap pix( w, TITLESIZE );
+ TQPixmap pix( w, TOPFRAMESIZE + TITLESIZE );
painter2.begin( &pix );
{
if (background && DeKoratorFactory::transparency_)
- painter2.drawPixmap( 0, 0, *background, p.x(), p.y(), w, TITLESIZE );
+ painter2.drawPixmap( 0, 0, *background, p.x(), p.y(), w, TOPFRAMESIZE + TITLESIZE );
+
+
+
+
+ // top frame
+ if ( w > 0 )
+ { // left
+ rect.setRect( 0 , 0, TQMIN( TOPLEFTFRAMEWIDTH, w ) , TOPFRAMESIZE );
+
+ painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topLeftFrame ] ) : *( DECOPIXINACTARR[ topLeftFrame ] ) );
+
+ // mid
+ if ( w > TOPLEFTFRAMEWIDTH + TOPRIGHTFRAMEWIDTH )
+ {
+ rect.setRect( TOPLEFTFRAMEWIDTH , 0, w - TOPLEFTFRAMEWIDTH - TOPRIGHTFRAMEWIDTH, TOPFRAMESIZE );
+
+ painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topMidFrame ] ) : *( DECOPIXINACTARR[ topMidFrame ] ) );
- // topLeftCorner
+ }
+
+ // right
+ if ( w > TOPLEFTFRAMEWIDTH )
+ {
+ rect.setRect( TQMAX( w - TOPRIGHTFRAMEWIDTH, TOPLEFTFRAMEWIDTH ) , 0, TQMIN( TOPRIGHTFRAMEWIDTH, w - TOPLEFTFRAMEWIDTH ) , TOPFRAMESIZE );
+
+ painter2.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ topRightFrame ] ) : *( DECOPIXINACTARR[ topRightFrame ] ), ( w > TOPLEFTFRAMEWIDTH + TOPRIGHTFRAMEWIDTH ) ? 0 : TOPLEFTFRAMEWIDTH - ( w - TOPRIGHTFRAMEWIDTH ), 0 );
- rect.setRect( 0, 0, TOPLEFTCORNERWIDTH, TITLESIZE );
- painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topLeftCorner ] ) : *( DECOPIXINACTARR[ topLeftCorner ] ) );
+ }
+ }
+
+
+
+
+ // leftTopCorner
+
+ rect.setRect( 0, TOPFRAMESIZE, LEFTTOPCORNERWIDTH, TITLESIZE );
+ painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftTopCornerFrame ] ) : *( DECOPIXINACTARR[ leftTopCornerFrame ] ) );
- // rect.setRect( 0, 0, TOPLEFTCORNERWIDTH, TITLESIZE );
+ // rect.setRect( 0, 0, LEFTTOPCORNERWIDTH, TITLESIZE );
// painter2.drawTiledPixmap( rect, isActive() ? decoFactory_->topLeftCornerBg_ : decoFactory_->topLeftCornerBgInAct_ );
// Space under the left button group
painter2.drawTiledPixmap( leftTitleR.right() + 1, titleR.top(),
- ( titleR.left() - 1 ) - leftTitleR.right(), titleR.height(), isActive() ? *( DECOPIXACTARR[ leftButtons ] ) : *( DECOPIXINACTARR[ leftButtons ] ) );
+ ( titleR.left() - 1 ) - leftTitleR.right(), titleR.height(), isActive() ? *( DECOPIXACTARR[ buttonsLeft ] ) : *( DECOPIXINACTARR[ buttonsLeft ] ) );
if ( tw > 0 )
{
//tqWarning("%d",titleR.width());
//leftTitleR
- rect.setRect( tx, 0, TQMIN( LEFTTITLEWIDTH, tw ), TITLESIZE );
+ rect.setRect( tx, TOPFRAMESIZE, TQMIN( TITLELEFTWIDTH, tw ), TITLESIZE );
- painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftTitle ] ) : *( DECOPIXINACTARR[ leftTitle ] ) );
+ painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ titleLeft ] ) : *( DECOPIXINACTARR[ titleLeft ] ) );
- // rect.setRect( tx, 0, TQMIN( LEFTTITLEWIDTH, tw ), TITLESIZE );
+ // rect.setRect( tx, 0, TQMIN( TITLELEFTWIDTH, tw ), TITLESIZE );
// painter2.drawTiledPixmap( rect, isActive() ? decoFactory_->leftTitleBg_ : decoFactory_->leftTitleBgInAct_ );
//midTitle
- if ( tw > LEFTTITLEWIDTH + RIGHTTITLEWIDTH )
+ if ( tw > TITLELEFTWIDTH + TITLERIGHTWIDTH )
{
- rect.setRect( tx + LEFTTITLEWIDTH, 0, tw - ( RIGHTTITLEWIDTH + LEFTTITLEWIDTH ), th );
+ rect.setRect( tx + TITLELEFTWIDTH, TOPFRAMESIZE, tw - ( TITLERIGHTWIDTH + TITLELEFTWIDTH ), th );
- painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ midTitle ] ) : *( DECOPIXINACTARR[ midTitle ] ) );
+ painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ titleMid ] ) : *( DECOPIXINACTARR[ titleMid ] ) );
// painter2.drawTiledPixmap( rect, isActive() ? decoFactory_->midTitleBg_ : decoFactory_->midTitleBgInAct_ );
}
//rightTitleR
- if ( tw > LEFTTITLEWIDTH )
+ if ( tw > TITLELEFTWIDTH )
{
- rect.setRect( TQMAX( tx + tw - RIGHTTITLEWIDTH, tx + LEFTTITLEWIDTH ), 0, TQMIN( RIGHTTITLEWIDTH, tw - LEFTTITLEWIDTH ), th );
+ rect.setRect( TQMAX( tx + tw - TITLERIGHTWIDTH, tx + TITLELEFTWIDTH ), TOPFRAMESIZE, TQMIN( TITLERIGHTWIDTH, tw - TITLELEFTWIDTH ), th );
- painter2.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ rightTitle ] ) : *( DECOPIXINACTARR[ rightTitle ] ), ( tw > LEFTTITLEWIDTH + RIGHTTITLEWIDTH ) ? 0 : LEFTTITLEWIDTH - ( tw - RIGHTTITLEWIDTH ), 0 );
+ painter2.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ titleRight ] ) : *( DECOPIXINACTARR[ titleRight ] ), ( tw > TITLELEFTWIDTH + TITLERIGHTWIDTH ) ? 0 : TITLELEFTWIDTH - ( tw - TITLERIGHTWIDTH ), 0 );
- // painter2.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->rightTitleBg_ : decoFactory_->rightTitleBgInAct_, ( tw > LEFTTITLEWIDTH + RIGHTTITLEWIDTH ) ? 0 : LEFTTITLEWIDTH - ( tw - RIGHTTITLEWIDTH ), 0 );
+ // painter2.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->rightTitleBg_ : decoFactory_->rightTitleBgInAct_, ( tw > TITLELEFTWIDTH + TITLERIGHTWIDTH ) ? 0 : TITLELEFTWIDTH - ( tw - TITLERIGHTWIDTH ), 0 );
}
}
// Space under the right button group
painter2.drawTiledPixmap( titleR.right() + 1, titleR.top(),
- ( rightTitleR.left() - 1 ) - titleR.right(), titleR.height(), isActive() ? *( DECOPIXACTARR[ rightButtons ] ) : *( DECOPIXINACTARR[ rightButtons ] ) );
+ ( rightTitleR.left() - 1 ) - titleR.right(), titleR.height(), isActive() ? *( DECOPIXACTARR[ buttonsRight ] ) : *( DECOPIXINACTARR[ buttonsRight ] ) );
//topRightCorner
- rect.setRect( widget() ->width() - TOPRIGHTCORNERWIDTH, 0, TOPRIGHTCORNERWIDTH, TITLESIZE );
+ rect.setRect( widget() ->width() - RIGHTTOPCORNERWIDTH, TOPFRAMESIZE, RIGHTTOPCORNERWIDTH, TITLESIZE );
- painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topRightCorner ] ) : *( DECOPIXINACTARR[ topRightCorner ] ) );
+ painter2.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ rightTopCornerFrame ] ) : *( DECOPIXINACTARR[ rightTopCornerFrame ] ) );
// painter2.drawTiledPixmap( rect, isActive() ? decoFactory_->topRightCornerBg_ : decoFactory_->topRightCornerBgInAct_ );
@@ -2486,7 +2590,7 @@ void DeKoratorClient::paintEvent( TQPaintEvent* )
dy = ( TITLESIZE / 2 ) - ( captionHeight / 2 ) + ( isActive() ? ACTIVESHDTEXTY : INACTIVESHDTEXTY ) ;
}
- painter2.drawImage( dx, dy, isActive() ? activeShadowImg_ : inActiveShadowImg_, 0, 0, isActive() ? TQMIN( activeShadowImg_.width(), titleR.width() ) : TQMIN( inActiveShadowImg_.width(), titleR.width() ), isActive() ? activeShadowImg_.height() : inActiveShadowImg_.height() );
+ painter2.drawImage( dx, dy + TOPFRAMESIZE, isActive() ? activeShadowImg_ : inActiveShadowImg_, 0, 0, isActive() ? TQMIN( activeShadowImg_.width(), titleR.width() ) : TQMIN( inActiveShadowImg_.width(), titleR.width() ), isActive() ? activeShadowImg_.height() : inActiveShadowImg_.height() );
}
@@ -2508,92 +2612,118 @@ void DeKoratorClient::paintEvent( TQPaintEvent* )
if ( ! isShade() || SHOWBTMBORDER )
{
- if ( h - TITLESIZE - BUTTOMFRAMESIZE > 0 )
+ if ( h - TOPFRAMESIZE - TITLESIZE - BOTTOMFRAMESIZE > 0 )
{
- int leftRightFramesHeight = h - TITLESIZE - BUTTOMFRAMESIZE ;
+ int leftRightFramesHeight = h - TOPFRAMESIZE - TITLESIZE - BOTTOMFRAMESIZE ;
+ int topOffset = TOPFRAMESIZE + TITLESIZE ;
//left frame
//top
- rect.setRect( 0, TITLESIZE , LEFTFRAMESIZE, TQMIN( TOPLEFTFRAMEHEIGHT, leftRightFramesHeight ) );
+ rect.setRect( 0, topOffset , LEFTFRAMESIZE, TQMIN( LEFTTOPFRAMEHEIGHT, leftRightFramesHeight ) );
- painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topLeftFrame ] ) : *( DECOPIXINACTARR[ topLeftFrame ] ) );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftTopFrame ] ) : *( DECOPIXINACTARR[ leftTopFrame ] ) );
// mid
- if ( leftRightFramesHeight > TOPLEFTFRAMEHEIGHT + BOTTOMLEFTFRAMEHEIGHT )
+ if ( leftRightFramesHeight > LEFTTOPFRAMEHEIGHT + LEFTBOTTOMCORNERFRAMEHEIGHT )
{
- rect.setRect( 0, TITLESIZE + TOPLEFTFRAMEHEIGHT , LEFTFRAMESIZE, leftRightFramesHeight - TOPLEFTFRAMEHEIGHT - BOTTOMLEFTFRAMEHEIGHT );
+ rect.setRect( 0, topOffset + LEFTTOPFRAMEHEIGHT , LEFTFRAMESIZE, leftRightFramesHeight - LEFTTOPFRAMEHEIGHT - LEFTBOTTOMCORNERFRAMEHEIGHT );
- painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ midLeftFrame ] ) : *( DECOPIXINACTARR[ midLeftFrame ] ) );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftMidFrame ] ) : *( DECOPIXINACTARR[ leftMidFrame ] ) );
// painter.drawTiledPixmap( rect, isActive() ? decoFactory_->midLeftFrameBg_ : decoFactory_->midLeftFrameBgInAct_ );
}
- // buttom
- if ( leftRightFramesHeight > TOPLEFTFRAMEHEIGHT )
+ // bottom corner
+ if ( leftRightFramesHeight > LEFTTOPFRAMEHEIGHT )
{
- rect.setRect( 0, TQMAX( h - BUTTOMFRAMESIZE - BOTTOMLEFTFRAMEHEIGHT, TITLESIZE + TOPLEFTFRAMEHEIGHT ) , LEFTFRAMESIZE, TQMIN( BOTTOMLEFTFRAMEHEIGHT, leftRightFramesHeight - TOPLEFTFRAMEHEIGHT ) );
+ rect.setRect( 0, TQMAX( h - BOTTOMFRAMESIZE - LEFTBOTTOMCORNERFRAMEHEIGHT, topOffset + LEFTTOPFRAMEHEIGHT ) , LEFTFRAMESIZE, TQMIN( LEFTBOTTOMCORNERFRAMEHEIGHT, leftRightFramesHeight - LEFTTOPFRAMEHEIGHT ) );
- painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ buttomLeftFrame ] ) : *( DECOPIXINACTARR[ buttomLeftFrame ] ), 0, ( leftRightFramesHeight > TOPLEFTFRAMEHEIGHT + BOTTOMLEFTFRAMEHEIGHT ) ? 0 : TITLESIZE + TOPLEFTFRAMEHEIGHT - ( h - BUTTOMFRAMESIZE - BOTTOMLEFTFRAMEHEIGHT ) );
+ painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ leftBottomCornerFrame ] ) : *( DECOPIXINACTARR[ leftBottomCornerFrame ] ), 0, ( leftRightFramesHeight > LEFTTOPFRAMEHEIGHT + LEFTBOTTOMCORNERFRAMEHEIGHT ) ? 0 : topOffset + LEFTTOPFRAMEHEIGHT - ( h - BOTTOMFRAMESIZE - LEFTBOTTOMCORNERFRAMEHEIGHT ) );
- // painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->buttomLeftFrameBg_ : decoFactory_->buttomLeftFrameBgInAct_, 0, ( leftRightFramesHeight > TOPLEFTFRAMEHEIGHT + BOTTOMLEFTFRAMEHEIGHT ) ? 0 : TITLESIZE + TOPLEFTFRAMEHEIGHT - ( h - BUTTOMFRAMESIZE - BOTTOMLEFTFRAMEHEIGHT ) );
+ // painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->buttomLeftFrameBg_ : decoFactory_->buttomLeftFrameBgInAct_, 0, ( leftRightFramesHeight > LEFTTOPFRAMEHEIGHT + LEFTBOTTOMCORNERFRAMEHEIGHT ) ? 0 : TITLESIZE + LEFTTOPFRAMEHEIGHT - ( h - BOTTOMFRAMESIZE - LEFTBOTTOMCORNERFRAMEHEIGHT ) );
}
//rightFrame
// top
- rect.setRect( w - RIGHTFRAMESIZE, TITLESIZE , RIGHTFRAMESIZE, TQMIN( TOPRIGHTFRAMEHEIGHT, leftRightFramesHeight ) );
+ rect.setRect( w - RIGHTFRAMESIZE, topOffset , RIGHTFRAMESIZE, TQMIN( RIGHTTOPFRAMEHEIGHT, leftRightFramesHeight ) );
- painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ topRightFrame ] ) : *( DECOPIXINACTARR[ topRightFrame ] ) );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ rightTopFrame ] ) : *( DECOPIXINACTARR[ rightTopFrame ] ) );
// painter.drawTiledPixmap( rect, isActive() ? decoFactory_->topRightFrameBg_ : decoFactory_->topRightFrameBgInAct_ );
// mid
- if ( leftRightFramesHeight > TOPRIGHTFRAMEHEIGHT + BOTTOMRIGHTFRAMEHEIGHT )
+ if ( leftRightFramesHeight > RIGHTTOPFRAMEHEIGHT + RIGHTBOTTOMCORNERFRAMEHEIGTH )
{
- rect.setRect( w - RIGHTFRAMESIZE, TITLESIZE + TOPRIGHTFRAMEHEIGHT, RIGHTFRAMESIZE, leftRightFramesHeight - TOPRIGHTFRAMEHEIGHT - BOTTOMRIGHTFRAMEHEIGHT );
+ rect.setRect( w - RIGHTFRAMESIZE, topOffset + RIGHTTOPFRAMEHEIGHT, RIGHTFRAMESIZE, leftRightFramesHeight - RIGHTTOPFRAMEHEIGHT - RIGHTBOTTOMCORNERFRAMEHEIGTH );
- painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ midRightFrame ] ) : *( DECOPIXINACTARR[ midRightFrame ] ) );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ rightMidFrame ] ) : *( DECOPIXINACTARR[ rightMidFrame ] ) );
// painter.drawTiledPixmap( rect, isActive() ? decoFactory_->midRightFrameBg_ : decoFactory_->rightFrameBgInAct_ );
}
- // bottom
- if ( leftRightFramesHeight > TOPRIGHTFRAMEHEIGHT )
+ // bottom corner
+ if ( leftRightFramesHeight > RIGHTTOPFRAMEHEIGHT )
{
- rect.setRect( w - RIGHTFRAMESIZE, TQMAX( h - BUTTOMFRAMESIZE - BOTTOMRIGHTFRAMEHEIGHT, TITLESIZE + TOPRIGHTFRAMEHEIGHT ) , RIGHTFRAMESIZE, TQMIN( BOTTOMRIGHTFRAMEHEIGHT, leftRightFramesHeight - TOPRIGHTFRAMEHEIGHT ) );
+ rect.setRect( w - RIGHTFRAMESIZE, TQMAX( h - BOTTOMFRAMESIZE - RIGHTBOTTOMCORNERFRAMEHEIGTH, topOffset + RIGHTTOPFRAMEHEIGHT ) , RIGHTFRAMESIZE, TQMIN( RIGHTBOTTOMCORNERFRAMEHEIGTH, leftRightFramesHeight - RIGHTTOPFRAMEHEIGHT ) );
- painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ buttomRightFrame ] ) : *( DECOPIXINACTARR[ buttomRightFrame ] ), 0, ( leftRightFramesHeight > TOPRIGHTFRAMEHEIGHT + BOTTOMRIGHTFRAMEHEIGHT ) ? 0 : TITLESIZE + TOPRIGHTFRAMEHEIGHT - ( h - BUTTOMFRAMESIZE - BOTTOMRIGHTFRAMEHEIGHT ) );
+ painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ rightBottomCornerFrame ] ) : *( DECOPIXINACTARR[ rightBottomCornerFrame ] ), 0, ( leftRightFramesHeight > RIGHTTOPFRAMEHEIGHT + RIGHTBOTTOMCORNERFRAMEHEIGTH ) ? 0 : topOffset + RIGHTTOPFRAMEHEIGHT - ( h - BOTTOMFRAMESIZE - RIGHTBOTTOMCORNERFRAMEHEIGTH ) );
- // painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->buttomRightFrameBg_ : decoFactory_->buttomRightFrameBgInAct_, 0, ( leftRightFramesHeight > TOPRIGHTFRAMEHEIGHT + BOTTOMRIGHTFRAMEHEIGHT ) ? 0 : TITLESIZE + TOPRIGHTFRAMEHEIGHT - ( h - BUTTOMFRAMESIZE - BOTTOMRIGHTFRAMEHEIGHT ) );
+ // painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->buttomRightFrameBg_ : decoFactory_->buttomRightFrameBgInAct_, 0, ( leftRightFramesHeight > RIGHTTOPFRAMEHEIGHT + RIGHTBOTTOMCORNERFRAMEHEIGTH ) ? 0 : TITLESIZE + RIGHTTOPFRAMEHEIGHT - ( h - BOTTOMFRAMESIZE - RIGHTBOTTOMCORNERFRAMEHEIGTH ) );
}
}
- // buttom frame
+ // bottom frame
if ( w > 0 )
- { // left
- rect.setRect( 0 , h - BUTTOMFRAMESIZE, TQMIN( LEFTBOTTOMFRAMEWIDTH, w ) , BUTTOMFRAMESIZE );
+ {
+ // shaded bottom border
+ if ( isShade() && HASBOTTOMSHADEDFRAME == TRUE )
+ {
+ // left
+ rect.setRect( 0 , h - BOTTOMSHADEDFRAMESIZE, TQMIN( BOTTOMSHADEDLEFTFRAMEWIDTH, w ) , BOTTOMSHADEDFRAMESIZE );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ bottomShadedLeftFrame ] ) : *( DECOPIXINACTARR[ bottomShadedLeftFrame ] ) );
- painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ leftButtomFrame ] ) : *( DECOPIXINACTARR[ leftButtomFrame ] ) );
+ // mid
+ if ( w > BOTTOMSHADEDLEFTFRAMEWIDTH + BOTTOMSHADEDRIGHTFRAMEWIDTH )
+ {
+ rect.setRect( BOTTOMSHADEDLEFTFRAMEWIDTH , h - BOTTOMSHADEDFRAMESIZE, w - BOTTOMSHADEDLEFTFRAMEWIDTH - BOTTOMSHADEDRIGHTFRAMEWIDTH, BOTTOMSHADEDFRAMESIZE );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ bottomShadedMidFrame ] ) : *( DECOPIXINACTARR[ bottomShadedMidFrame ] ) );
+ }
+ // right
+ if ( w > BOTTOMSHADEDLEFTFRAMEWIDTH )
+ {
+ rect.setRect( TQMAX( w - BOTTOMSHADEDRIGHTFRAMEWIDTH, BOTTOMSHADEDLEFTFRAMEWIDTH ) , h - BOTTOMSHADEDFRAMESIZE, TQMIN( BOTTOMSHADEDRIGHTFRAMEWIDTH, w - BOTTOMSHADEDLEFTFRAMEWIDTH ) , BOTTOMSHADEDFRAMESIZE );
- // mid
- if ( w > LEFTBOTTOMFRAMEWIDTH + RIGHTBOTTOMFRAMEWIDTH )
+ painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ bottomShadedRightFrame ] ) : *( DECOPIXINACTARR[ bottomShadedRightFrame ] ), ( w > BOTTOMSHADEDLEFTFRAMEWIDTH + BOTTOMSHADEDRIGHTFRAMEWIDTH ) ? 0 : BOTTOMSHADEDLEFTFRAMEWIDTH - ( w - BOTTOMSHADEDRIGHTFRAMEWIDTH ), 0 );
+ }
+ }
+ else
{
- rect.setRect( LEFTBOTTOMFRAMEWIDTH , h - BUTTOMFRAMESIZE, w - LEFTBOTTOMFRAMEWIDTH - RIGHTBOTTOMFRAMEWIDTH, BUTTOMFRAMESIZE );
+ // left
+ rect.setRect( 0 , h - BOTTOMFRAMESIZE, TQMIN( BOTTOMLEFTFRAMEWIDTH, w ) , BOTTOMFRAMESIZE );
- painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ midButtomFrame ] ) : *( DECOPIXINACTARR[ midButtomFrame ] ) );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ bottomLeftFrame ] ) : *( DECOPIXINACTARR[ bottomLeftFrame ] ) );
- // painter.drawTiledPixmap( rect, isActive() ? decoFactory_->midButtomFrameBg_ : decoFactory_->midButtomFrameBgInAct_ );
- }
+ // mid
+ if ( w > BOTTOMLEFTFRAMEWIDTH + BOTTOMRIGHTFRAMEWIDTH )
+ {
+ rect.setRect( BOTTOMLEFTFRAMEWIDTH , h - BOTTOMFRAMESIZE, w - BOTTOMLEFTFRAMEWIDTH - BOTTOMRIGHTFRAMEWIDTH, BOTTOMFRAMESIZE );
- // right
- if ( w > LEFTBOTTOMFRAMEWIDTH )
- {
- rect.setRect( TQMAX( w - RIGHTBOTTOMFRAMEWIDTH, LEFTBOTTOMFRAMEWIDTH ) , h - BUTTOMFRAMESIZE, TQMIN( RIGHTBOTTOMFRAMEWIDTH, w - LEFTBOTTOMFRAMEWIDTH ) , BUTTOMFRAMESIZE );
+ painter.drawTiledPixmap( rect, isActive() ? *( DECOPIXACTARR[ bottomMidFrame ] ) : *( DECOPIXINACTARR[ bottomMidFrame ] ) );
+
+ // painter.drawTiledPixmap( rect, isActive() ? decoFactory_->midButtomFrameBg_ : decoFactory_->midButtomFrameBgInAct_ );
+ }
+
+ // right
+ if ( w > BOTTOMLEFTFRAMEWIDTH )
+ {
+ rect.setRect( TQMAX( w - BOTTOMRIGHTFRAMEWIDTH, BOTTOMLEFTFRAMEWIDTH ) , h - BOTTOMFRAMESIZE, TQMIN( BOTTOMRIGHTFRAMEWIDTH, w - BOTTOMLEFTFRAMEWIDTH ) , BOTTOMFRAMESIZE );
- painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ rightButtomFrame ] ) : *( DECOPIXINACTARR[ rightButtomFrame ] ), ( w > LEFTBOTTOMFRAMEWIDTH + RIGHTBOTTOMFRAMEWIDTH ) ? 0 : LEFTBOTTOMFRAMEWIDTH - ( w - RIGHTBOTTOMFRAMEWIDTH ), 0 );
+ painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? *( DECOPIXACTARR[ bottomRightFrame ] ) : *( DECOPIXINACTARR[ bottomRightFrame ] ), ( w > BOTTOMLEFTFRAMEWIDTH + BOTTOMRIGHTFRAMEWIDTH ) ? 0 : BOTTOMLEFTFRAMEWIDTH - ( w - BOTTOMRIGHTFRAMEWIDTH ), 0 );
- // painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->rightButtomFrameBg_ : decoFactory_->rightButtomFrameBgInAct_, ( w > LEFTBOTTOMFRAMEWIDTH + RIGHTBOTTOMFRAMEWIDTH ) ? 0 : LEFTBOTTOMFRAMEWIDTH - ( w - RIGHTBOTTOMFRAMEWIDTH ), 0 );
+ // painter.drawTiledPixmap( rect.x(), rect.y(), rect.width(), rect.height(), isActive() ? decoFactory_->rightButtomFrameBg_ : decoFactory_->rightButtomFrameBgInAct_, ( w > BOTTOMLEFTFRAMEWIDTH + BOTTOMRIGHTFRAMEWIDTH ) ? 0 : BOTTOMLEFTFRAMEWIDTH - ( w - BOTTOMRIGHTFRAMEWIDTH ), 0 );
+ }
}
}
}
@@ -2846,51 +2976,90 @@ void DeKoratorClient::doShape()
m.translate( pos, 0 );
mask -= m;
}
-
- {
- //top right
- m = TQRegion( decoFactory_->topRightCornerBitmap_ );
- m.translate( width() - TOPRIGHTMASKWIDTH, 0 );
- mask -= TQRegion( m );
- }
+
+ //top right
+ m = TQRegion( decoFactory_->topRightCornerBitmap_ );
+ m.translate( width() - TOPRIGHTMASKWIDTH, 0 );
+ mask -= TQRegion( m );
+
if ( !isShade() || SHOWBTMBORDER )
{
- //buttom left
- m = TQRegion( decoFactory_->buttomLeftCornerBitmap_ );
- m.translate( 0, h - BOTTOMLEFTMASKHEIGHT );
- mask -= TQRegion( m );
-
- // bottom mid
- if ( BOTTOMMIDMASKWIDTH >= 1 )
+ if ( isShade() && HASBOTTOMSHADEDFRAME )
{
- int pos = BOTTOMLEFTMASKWIDTH;
- int rep = ( w - BOTTOMLEFTMASKWIDTH - BOTTOMRIGHTMASKWIDTH ) / BOTTOMMIDMASKWIDTH;
- int hm = h - BOTTOMMIDMASKHEIGHT;
- m = TQRegion( decoFactory_->buttomMidBitmap_ );
- TQRegion mBak = m;
+ //buttom left
+ m = TQRegion( decoFactory_->buttomShadedLeftCornerBitmap_ );
+ m.translate( 0, h - BOTTOMSHADEDLEFTMASKHEIGHT );
+ mask -= TQRegion( m );
- for ( int i = 0 ; i < rep ; i++ )
+ // bottom mid
+ if ( BOTTOMSHADEDMIDMASKWIDTH >= 1 )
{
+ int pos = BOTTOMSHADEDLEFTMASKWIDTH;
+ int rep = ( w - BOTTOMSHADEDLEFTMASKWIDTH - BOTTOMSHADEDRIGHTMASKWIDTH ) / BOTTOMSHADEDMIDMASKWIDTH;
+ int hm = h - BOTTOMSHADEDMIDMASKHEIGHT;
+ m = TQRegion( decoFactory_->buttomShadedMidBitmap_ );
+ TQRegion mBak = m;
+
+ for ( int i = 0 ; i < rep ; i++ )
+ {
+ m = mBak;
+ m.translate( BOTTOMSHADEDLEFTMASKWIDTH + ( i * BOTTOMSHADEDMIDMASKWIDTH ), hm );
+ mask -= TQRegion( m );
+ pos += BOTTOMSHADEDMIDMASKWIDTH;
+ }
+
m = mBak;
- m.translate( BOTTOMLEFTMASKWIDTH + ( i * BOTTOMMIDMASKWIDTH ), hm );
- mask -= TQRegion( m );
- pos += BOTTOMMIDMASKWIDTH;
+ mtr = mBak;
+ mtr.translate( w - pos - BOTTOMSHADEDRIGHTMASKWIDTH, 0 );
+ m -= mtr;
+ m.translate( pos, hm );
+ mask -= m;
}
- m = mBak;
- mtr = mBak;
- mtr.translate( w - pos - BOTTOMRIGHTMASKWIDTH, 0 );
- m -= mtr;
- m.translate( pos, hm );
- mask -= m;
+ //buttom right
+ m = TQRegion( decoFactory_->buttomShadedRightCornerBitmap_ );
+ m.translate( width() - BOTTOMSHADEDRIGHTMASKWIDTH, h - BOTTOMSHADEDRIGHTMASKHEIGHT );
+ mask -= TQRegion( m );
}
+ else
+ {
+ //buttom left
+ m = TQRegion( decoFactory_->buttomLeftCornerBitmap_ );
+ m.translate( 0, h - BOTTOMLEFTMASKHEIGHT );
+ mask -= TQRegion( m );
+
+ // bottom mid
+ if ( BOTTOMMIDMASKWIDTH >= 1 )
+ {
+ int pos = BOTTOMLEFTMASKWIDTH;
+ int rep = ( w - BOTTOMLEFTMASKWIDTH - BOTTOMRIGHTMASKWIDTH ) / BOTTOMMIDMASKWIDTH;
+ int hm = h - BOTTOMMIDMASKHEIGHT;
+ m = TQRegion( decoFactory_->buttomMidBitmap_ );
+ TQRegion mBak = m;
+
+ for ( int i = 0 ; i < rep ; i++ )
+ {
+ m = mBak;
+ m.translate( BOTTOMLEFTMASKWIDTH + ( i * BOTTOMMIDMASKWIDTH ), hm );
+ mask -= TQRegion( m );
+ pos += BOTTOMMIDMASKWIDTH;
+ }
- //buttom right
- m = TQRegion( decoFactory_->buttomRightCornerBitmap_ );
- m.translate( width() - BOTTOMRIGHTMASKWIDTH, h - BOTTOMRIGHTMASKHEIGHT );
- mask -= TQRegion( m );
+ m = mBak;
+ mtr = mBak;
+ mtr.translate( w - pos - BOTTOMRIGHTMASKWIDTH, 0 );
+ m -= mtr;
+ m.translate( pos, hm );
+ mask -= m;
+ }
+
+ //buttom right
+ m = TQRegion( decoFactory_->buttomRightCornerBitmap_ );
+ m.translate( width() - BOTTOMRIGHTMASKWIDTH, h - BOTTOMRIGHTMASKHEIGHT );
+ mask -= TQRegion( m );
+ }
}
mask_ = mask;
}
diff --git a/client/deKoratorclient.h b/client/deKoratorclient.h
index e74774a..63a0db6 100644
--- a/client/deKoratorclient.h
+++ b/client/deKoratorclient.h
@@ -68,22 +68,28 @@ namespace DeKorator
class DeKoratorClient;
enum decoType {
- topLeftCorner = 0,
- leftButtons,
- leftTitle,
- midTitle,
- rightTitle,
- rightButtons,
- topRightCorner,
+ leftTopCornerFrame = 0,
+ buttonsLeft,
+ titleLeft,
+ titleMid,
+ titleRight,
+ buttonsRight,
+ rightTopCornerFrame,
+ leftTopFrame,
+ leftMidFrame,
+ leftBottomCornerFrame,
+ bottomLeftFrame,
+ bottomMidFrame,
+ bottomRightFrame,
+ rightTopFrame,
+ rightMidFrame,
+ rightBottomCornerFrame,
topLeftFrame,
- midLeftFrame,
- buttomLeftFrame,
- leftButtomFrame,
- midButtomFrame,
- rightButtomFrame,
+ topMidFrame,
topRightFrame,
- midRightFrame,
- buttomRightFrame,
+ bottomShadedLeftFrame,
+ bottomShadedMidFrame,
+ bottomShadedRightFrame,
decoCount
};
@@ -144,7 +150,7 @@ public:
virtual bool reset( unsigned long changed );
static void colorizePixmap( TQPixmap *pix, TQColor col, TQString colorizeMethod );
static bool initialized();
- TQBitmap topLeftCornerBitmap_, topMidBitmap_, topRightCornerBitmap_, buttomLeftCornerBitmap_, buttomMidBitmap_, buttomRightCornerBitmap_;
+ TQBitmap topLeftCornerBitmap_, topMidBitmap_, topRightCornerBitmap_, buttomLeftCornerBitmap_, buttomMidBitmap_, buttomRightCornerBitmap_, buttomShadedLeftCornerBitmap_, buttomShadedMidBitmap_, buttomShadedRightCornerBitmap_;
private:
bool readConfig();
@@ -309,7 +315,7 @@ private:
TQVBoxLayout *mainLayout_;
TQHBoxLayout *titleLayout_ ;
TQHBoxLayout *midLayout_;
- TQSpacerItem *leftTitleBarSpacer_, *titleBarSpacer_, *rightTitleBarSpacer_, *leftSpacer_, *rightSpacer_, *bottomSpacer_;
+ TQSpacerItem *topSpacer_, *leftTitleBarSpacer_, *titleBarSpacer_, *rightTitleBarSpacer_, *leftSpacer_, *rightSpacer_, *bottomSpacer_;
TQTimer repaintTimer;
bool closing_;
TQPixmap *captionBufferPix_;