|
|
@ -15,13 +15,13 @@
|
|
|
|
#include <kconfig.h>
|
|
|
|
#include <kconfig.h>
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
#include <kstandarddirs.h>
|
|
|
|
|
|
|
|
|
|
|
|
#include <qlabel.h>
|
|
|
|
#include <ntqlabel.h>
|
|
|
|
#include <qlayout.h>
|
|
|
|
#include <ntqlayout.h>
|
|
|
|
#include <qdrawutil.h>
|
|
|
|
#include <ntqdrawutil.h>
|
|
|
|
#include <qdatetime.h>
|
|
|
|
#include <ntqdatetime.h>
|
|
|
|
#include <qcursor.h>
|
|
|
|
#include <ntqcursor.h>
|
|
|
|
#include <qbitmap.h>
|
|
|
|
#include <ntqbitmap.h>
|
|
|
|
#include <qimage.h>
|
|
|
|
#include <ntqimage.h>
|
|
|
|
|
|
|
|
|
|
|
|
extern "C"
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -43,20 +43,20 @@ bool titlebarResize, titlebarPlain,
|
|
|
|
double titlebarLenseButtonFlare;
|
|
|
|
double titlebarLenseButtonFlare;
|
|
|
|
|
|
|
|
|
|
|
|
static bool pixmaps_created = false;
|
|
|
|
static bool pixmaps_created = false;
|
|
|
|
static QImage left_img[2][2];
|
|
|
|
static TQImage left_img[2][2];
|
|
|
|
static QImage middle_img[2][2];
|
|
|
|
static TQImage middle_img[2][2];
|
|
|
|
static QImage right_img[2][2];
|
|
|
|
static TQImage right_img[2][2];
|
|
|
|
static QImage text_img[2][2];
|
|
|
|
static TQImage text_img[2][2];
|
|
|
|
static QImage bar_img[2][2];
|
|
|
|
static TQImage bar_img[2][2];
|
|
|
|
static QImage kroete_img[2][2];
|
|
|
|
static TQImage kroete_img[2][2];
|
|
|
|
static QImage button_img[2][2];
|
|
|
|
static TQImage button_img[2][2];
|
|
|
|
static QImage button_l_img[2][2];
|
|
|
|
static TQImage button_l_img[2][2];
|
|
|
|
static QImage button_r_img[2][2];
|
|
|
|
static TQImage button_r_img[2][2];
|
|
|
|
|
|
|
|
|
|
|
|
extern QColor *btnForeground;
|
|
|
|
extern TQColor *btnForeground;
|
|
|
|
extern QPixmap *defaultPixmap;
|
|
|
|
extern TQPixmap *defaultPixmap;
|
|
|
|
|
|
|
|
|
|
|
|
static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float bright, float contrast )
|
|
|
|
static TQImage colorize(TQImage img, const TQColor &col1, const TQColor &col2, float bright, float contrast )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int rval, gval, bval, val, val2, i;
|
|
|
|
int rval, gval, bval, val, val2, i;
|
|
|
|
int pixels = (img.depth() > 8) ? img.width()*img.height()
|
|
|
|
int pixels = (img.depth() > 8) ? img.width()*img.height()
|
|
|
@ -66,8 +66,8 @@ static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float
|
|
|
|
|
|
|
|
|
|
|
|
for (i=0; i<pixels; i++)
|
|
|
|
for (i=0; i<pixels; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
val = static_cast<int>(qBlue(data[i]) * contrast);
|
|
|
|
val = static_cast<int>(tqBlue(data[i]) * contrast);
|
|
|
|
val2 = static_cast<int>(qGreen(data[i]) * contrast);
|
|
|
|
val2 = static_cast<int>(tqGreen(data[i]) * contrast);
|
|
|
|
|
|
|
|
|
|
|
|
rval = static_cast<int>( (val2*255*3 + (255-val2)*col2.red())/255 );
|
|
|
|
rval = static_cast<int>( (val2*255*3 + (255-val2)*col2.red())/255 );
|
|
|
|
gval = static_cast<int>( (val2*255*3 + (255-val2)*col2.green())/255 );
|
|
|
|
gval = static_cast<int>( (val2*255*3 + (255-val2)*col2.green())/255 );
|
|
|
@ -76,12 +76,12 @@ static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float
|
|
|
|
gval = static_cast<int>( (val *gval + (255-val)*col1.green())/255 );
|
|
|
|
gval = static_cast<int>( (val *gval + (255-val)*col1.green())/255 );
|
|
|
|
bval = static_cast<int>( (val *bval + (255-val)*col1.blue())/255 );
|
|
|
|
bval = static_cast<int>( (val *bval + (255-val)*col1.blue())/255 );
|
|
|
|
|
|
|
|
|
|
|
|
if ( 255 < rval+qRed(data[i]) ) rval = 255;
|
|
|
|
if ( 255 < rval+tqRed(data[i]) ) rval = 255;
|
|
|
|
else rval += qRed(data[i]);
|
|
|
|
else rval += tqRed(data[i]);
|
|
|
|
if ( 255 < gval+qRed(data[i]) ) gval = 255;
|
|
|
|
if ( 255 < gval+tqRed(data[i]) ) gval = 255;
|
|
|
|
else gval += qRed(data[i]);
|
|
|
|
else gval += tqRed(data[i]);
|
|
|
|
if ( 255 < bval+qRed(data[i]) ) bval = 255;
|
|
|
|
if ( 255 < bval+tqRed(data[i]) ) bval = 255;
|
|
|
|
else bval += qRed(data[i]);
|
|
|
|
else bval += tqRed(data[i]);
|
|
|
|
|
|
|
|
|
|
|
|
if (bright != 1.0)
|
|
|
|
if (bright != 1.0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -90,21 +90,21 @@ static QImage colorize(QImage img, const QColor &col1, const QColor &col2, float
|
|
|
|
bval = static_cast<int>(bright*bval);
|
|
|
|
bval = static_cast<int>(bright*bval);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
data[i] = qRgba(rval, gval, bval, qAlpha(data[i]));
|
|
|
|
data[i] = tqRgba(rval, gval, bval, tqAlpha(data[i]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return img;
|
|
|
|
return img;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active, int mouse )
|
|
|
|
KPixmap create_buttonPixmap( int x, int y, TQPixmap _pix, TQPixmap bg, int active, int mouse )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QImage i;
|
|
|
|
TQImage i;
|
|
|
|
KPixmap _p(QPixmap(x,y));
|
|
|
|
KPixmap _p(TQPixmap(x,y));
|
|
|
|
QPixmap t, pix;
|
|
|
|
TQPixmap t, pix;
|
|
|
|
QPainter p;
|
|
|
|
TQPainter p;
|
|
|
|
|
|
|
|
|
|
|
|
if ( _pix.isNull() )
|
|
|
|
if ( _pix.isNull() )
|
|
|
|
pix = QPixmap(kdelogo);
|
|
|
|
pix = TQPixmap(kdelogo);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
pix = _pix;
|
|
|
|
pix = _pix;
|
|
|
|
|
|
|
|
|
|
|
@ -123,9 +123,9 @@ KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active,
|
|
|
|
if ( !(mouse == 1 && titlebarPlain) && !(mouse == 0 && !titlebarPlain) ){ // not standard
|
|
|
|
if ( !(mouse == 1 && titlebarPlain) && !(mouse == 0 && !titlebarPlain) ){ // not standard
|
|
|
|
i=_p;
|
|
|
|
i=_p;
|
|
|
|
if ( (mouse == 0 && titlebarPlain) || (mouse == 1 && !titlebarPlain) ){ // mouse over
|
|
|
|
if ( (mouse == 0 && titlebarPlain) || (mouse == 1 && !titlebarPlain) ){ // mouse over
|
|
|
|
_p.convertFromImage(KImageEffect::blend(Qt::white, i, 0.25 ));
|
|
|
|
_p.convertFromImage(KImageEffect::blend(TQt::white, i, 0.25 ));
|
|
|
|
}else{ // pressed
|
|
|
|
}else{ // pressed
|
|
|
|
_p.convertFromImage(KImageEffect::blend(Qt::black, i, 0.25 ));
|
|
|
|
_p.convertFromImage(KImageEffect::blend(TQt::black, i, 0.25 ));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( mouse == 2 ) { // pressed
|
|
|
|
if ( mouse == 2 ) { // pressed
|
|
|
@ -139,9 +139,9 @@ KPixmap create_buttonPixmap( int x, int y, QPixmap _pix, QPixmap bg, int active,
|
|
|
|
return _p;
|
|
|
|
return _p;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QImage image_convert( const char **b, int h){
|
|
|
|
TQImage image_convert( const char **b, int h){
|
|
|
|
QPixmap p(b);
|
|
|
|
TQPixmap p(b);
|
|
|
|
QImage i;
|
|
|
|
TQImage i;
|
|
|
|
i = p.convertToImage();
|
|
|
|
i = p.convertToImage();
|
|
|
|
if ( p.height()!=h )
|
|
|
|
if ( p.height()!=h )
|
|
|
|
i = i.smoothScale((p.width()*h)/p.height(),h);
|
|
|
|
i = i.smoothScale((p.width()*h)/p.height(),h);
|
|
|
@ -157,8 +157,8 @@ static void create_pixmaps( )
|
|
|
|
|
|
|
|
|
|
|
|
for ( int m=0; m<2; m++ )
|
|
|
|
for ( int m=0; m<2; m++ )
|
|
|
|
for ( int i=0; i<2; i++){
|
|
|
|
for ( int i=0; i<2; i++){
|
|
|
|
QColor ctb = KDecoration::options()->color(KDecoration::ColorTitleBar,i);
|
|
|
|
TQColor ctb = KDecoration::options()->color(KDecoration::ColorTitleBar,i);
|
|
|
|
QColor ctbB = KDecoration::options()->color(KDecoration::ColorTitleBlend,i);
|
|
|
|
TQColor ctbB = KDecoration::options()->color(KDecoration::ColorTitleBlend,i);
|
|
|
|
left_img[i][m] = colorize(image_convert(left_xpm, m ? 12 : PIX_HEIGHT) , ctb,
|
|
|
|
left_img[i][m] = colorize(image_convert(left_xpm, m ? 12 : PIX_HEIGHT) , ctb,
|
|
|
|
ctbB, 0.75 , 0.75 );
|
|
|
|
ctbB, 0.75 , 0.75 );
|
|
|
|
right_img[i][m] = colorize(image_convert(right_xpm, m ? 12 : PIX_HEIGHT) , ctb,
|
|
|
|
right_img[i][m] = colorize(image_convert(right_xpm, m ? 12 : PIX_HEIGHT) , ctb,
|
|
|
@ -182,23 +182,23 @@ static void create_pixmaps( )
|
|
|
|
for ( int m=0; m<2; m++ )
|
|
|
|
for ( int m=0; m<2; m++ )
|
|
|
|
for ( int M=0; M<3; M++ )
|
|
|
|
for ( int M=0; M<3; M++ )
|
|
|
|
for ( int a=0; a<2; a++ ){
|
|
|
|
for ( int a=0; a<2; a++ ){
|
|
|
|
buttonPixmap[0][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(kdelogo), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[0][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(kdelogo), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[1][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(sticky_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[1][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(sticky_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[2][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(question_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[2][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(question_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[3][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(iconify_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[3][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(iconify_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[4][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(maximze_xpm), button_img[a][m], a, M );
|
|
|
|
buttonPixmap[4][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(maximze_xpm), button_img[a][m], a, M );
|
|
|
|
QPixmap i(button_img[a][m]);
|
|
|
|
TQPixmap i(button_img[a][m]);
|
|
|
|
QPainter p(&i);
|
|
|
|
TQPainter p(&i);
|
|
|
|
p.drawPixmap(button_img[a][m].width()-right_img[a][m].width()+BORDER_RIGHT, 0, right_img[a][m]);
|
|
|
|
p.drawPixmap(button_img[a][m].width()-right_img[a][m].width()+BORDER_RIGHT, 0, right_img[a][m]);
|
|
|
|
p.end();
|
|
|
|
p.end();
|
|
|
|
buttonPixmap[5][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, QPixmap(close_xpm), i, a, M );
|
|
|
|
buttonPixmap[5][a][M][m] = create_buttonPixmap( m ? 12 : PIX_HEIGHT, m ? 12 : PIX_HEIGHT, TQPixmap(close_xpm), i, a, M );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Make sure button pixmaps contrast with the current colour scheme.
|
|
|
|
// Make sure button pixmaps contrast with the current colour scheme.
|
|
|
|
if(qGray(KDecoration::options()->color(KDecoration::ColorTitleBar,true).rgb()) > 127)
|
|
|
|
if(tqGray(KDecoration::options()->color(KDecoration::ColorTitleBar,true).rgb()) > 127)
|
|
|
|
btnForeground = new QColor(Qt::black);
|
|
|
|
btnForeground = new TQColor(TQt::black);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
btnForeground = new QColor(Qt::white);
|
|
|
|
btnForeground = new TQColor(TQt::white);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void delete_pixmaps()
|
|
|
|
void delete_pixmaps()
|
|
|
@ -246,7 +246,7 @@ void MachBunt::init()
|
|
|
|
titlebarNoPlainButtons = c.readBoolEntry("TitleBarNoPlainButtons", false);
|
|
|
|
titlebarNoPlainButtons = c.readBoolEntry("TitleBarNoPlainButtons", false);
|
|
|
|
titlebarSidebar = c.readBoolEntry("TitleBarSideBar", false);
|
|
|
|
titlebarSidebar = c.readBoolEntry("TitleBarSideBar", false);
|
|
|
|
titlebarLenseButtonFlare = c.readDoubleNumEntry("titlebarLenseButtonFlare", 1.7);
|
|
|
|
titlebarLenseButtonFlare = c.readDoubleNumEntry("titlebarLenseButtonFlare", 1.7);
|
|
|
|
defaultPixmap = new QPixmap(kdelogo);
|
|
|
|
defaultPixmap = new TQPixmap(kdelogo);
|
|
|
|
create_pixmaps();
|
|
|
|
create_pixmaps();
|
|
|
|
createButtons();
|
|
|
|
createButtons();
|
|
|
|
|
|
|
|
|
|
|
@ -278,7 +278,7 @@ void MachBunt::createButtons()
|
|
|
|
connect( button[i], SIGNAL(shapeMe(int)),this, SLOT(doShape(int)));
|
|
|
|
connect( button[i], SIGNAL(shapeMe(int)),this, SLOT(doShape(int)));
|
|
|
|
connect( button[i], SIGNAL(pressed()),this, SLOT(buttonPressed()));
|
|
|
|
connect( button[i], SIGNAL(pressed()),this, SLOT(buttonPressed()));
|
|
|
|
connect( button[i], SIGNAL(released()),this, SLOT(buttonReleased()));
|
|
|
|
connect( button[i], SIGNAL(released()),this, SLOT(buttonReleased()));
|
|
|
|
connect( button[i], SIGNAL(mousePressedMove(QMouseEvent*)),this, SLOT(mouseMoveOnButtonPressed(QMouseEvent*)));
|
|
|
|
connect( button[i], SIGNAL(mousePressedMove(TQMouseEvent*)),this, SLOT(mouseMoveOnButtonPressed(TQMouseEvent*)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( showContextHelp() ));
|
|
|
|
connect( button[BtnHelp], SIGNAL( clicked() ), this, SLOT( showContextHelp() ));
|
|
|
@ -306,7 +306,7 @@ void MachBunt::reset( unsigned long changed )
|
|
|
|
widget()->repaint();
|
|
|
|
widget()->repaint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int MachBunt::mapButton( const QChar &c)
|
|
|
|
int MachBunt::mapButton( const TQChar &c)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (c.latin1())
|
|
|
|
switch (c.latin1())
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -324,7 +324,7 @@ int MachBunt::mapButton( const QChar &c)
|
|
|
|
return BtnClose;
|
|
|
|
return BtnClose;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// something went wrong
|
|
|
|
// something went wrong
|
|
|
|
qDebug("unknown Button to map \"%c\"", c.latin1() );
|
|
|
|
tqDebug("unknown Button to map \"%c\"", c.latin1() );
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -332,17 +332,17 @@ void MachBunt::doLayout()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
delete windowLayout;
|
|
|
|
delete windowLayout;
|
|
|
|
|
|
|
|
|
|
|
|
windowLayout = new QVBoxLayout(widget(), 0, 0);
|
|
|
|
windowLayout = new TQVBoxLayout(widget(), 0, 0);
|
|
|
|
titlebar = new QSpacerItem ( 0, titleHeight, QSizePolicy::Expanding,
|
|
|
|
titlebar = new TQSpacerItem ( 0, titleHeight, TQSizePolicy::Expanding,
|
|
|
|
QSizePolicy::Fixed);
|
|
|
|
TQSizePolicy::Fixed);
|
|
|
|
QBoxLayout *topLayout = new QBoxLayout(windowLayout, QBoxLayout::LeftToRight, 0, 0);
|
|
|
|
TQBoxLayout *topLayout = new TQBoxLayout(windowLayout, TQBoxLayout::LeftToRight, 0, 0);
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
bool first_left = true;
|
|
|
|
bool first_left = true;
|
|
|
|
for ( unsigned int i = 0; i <options()->titleButtonsLeft().length(); i++)
|
|
|
|
for ( unsigned int i = 0; i <options()->titleButtonsLeft().length(); i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int b = mapButton(options()->titleButtonsLeft()[i]);
|
|
|
|
int b = mapButton(options()->titleButtonsLeft()[i]);
|
|
|
|
if ( b>=0 ){
|
|
|
|
if ( b>=0 ){
|
|
|
|
topLayout->addWidget(button[b], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[b], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[b], 0);
|
|
|
|
topLayout->setStretchFactor(button[b], 0);
|
|
|
|
button[b]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[b]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
if( first_left )
|
|
|
|
if( first_left )
|
|
|
@ -356,26 +356,26 @@ void MachBunt::doLayout()
|
|
|
|
topLayout->addItem(titlebar);
|
|
|
|
topLayout->addItem(titlebar);
|
|
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
topLayout->addWidget(button[BtnMenu], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[BtnMenu], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[BtnMenu], 0);
|
|
|
|
topLayout->setStretchFactor(button[BtnMenu], 0);
|
|
|
|
button[BtnMenu]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnMenu]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnMenu]->setPosition( ButtonLeft );
|
|
|
|
button[BtnMenu]->setPosition( ButtonLeft );
|
|
|
|
|
|
|
|
|
|
|
|
topLayout->addItem(titlebar);
|
|
|
|
topLayout->addItem(titlebar);
|
|
|
|
|
|
|
|
|
|
|
|
topLayout->addWidget(button[BtnHelp], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[BtnHelp], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[BtnHelp], 0);
|
|
|
|
topLayout->setStretchFactor(button[BtnHelp], 0);
|
|
|
|
button[BtnHelp]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnHelp]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
|
|
|
|
|
|
|
|
topLayout->addWidget(button[BtnIconify], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[BtnIconify], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[BtnIconify], 0);
|
|
|
|
topLayout->setStretchFactor(button[BtnIconify], 0);
|
|
|
|
button[BtnIconify]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnIconify]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
|
|
|
|
|
|
|
|
topLayout->addWidget(button[BtnMax], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[BtnMax], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[BtnMax], 0);
|
|
|
|
topLayout->setStretchFactor(button[BtnMax], 0);
|
|
|
|
button[BtnMax]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnMax]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
|
|
|
|
|
|
|
|
topLayout->addWidget(button[BtnClose], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[BtnClose], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[BtnClose], 0);
|
|
|
|
topLayout->setStretchFactor(button[BtnClose], 0);
|
|
|
|
button[BtnClose]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnClose]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[BtnClose]->setPosition( ButtonRight );
|
|
|
|
button[BtnClose]->setPosition( ButtonRight );
|
|
|
@ -391,7 +391,7 @@ void MachBunt::doLayout()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int b = mapButton(options()->titleButtonsRight()[i]);
|
|
|
|
int b = mapButton(options()->titleButtonsRight()[i]);
|
|
|
|
if ( b>=0 ){
|
|
|
|
if ( b>=0 ){
|
|
|
|
topLayout->addWidget(button[b], Qt::AlignVCenter);
|
|
|
|
topLayout->addWidget(button[b], TQt::AlignVCenter);
|
|
|
|
topLayout->setStretchFactor(button[b], 0);
|
|
|
|
topLayout->setStretchFactor(button[b], 0);
|
|
|
|
button[b]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
button[b]->setFixedSize(titleHeight, titleHeight);
|
|
|
|
last_right = button[b];
|
|
|
|
last_right = button[b];
|
|
|
@ -401,12 +401,12 @@ void MachBunt::doLayout()
|
|
|
|
last_right->setPosition( ButtonRight );
|
|
|
|
last_right->setPosition( ButtonRight );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
QHBoxLayout * midLayout = new QHBoxLayout(windowLayout, 0, 0);
|
|
|
|
TQHBoxLayout * midLayout = new TQHBoxLayout(windowLayout, 0, 0);
|
|
|
|
midLayout->addSpacing(BORDER_LEFT);
|
|
|
|
midLayout->addSpacing(BORDER_LEFT);
|
|
|
|
if( isPreview())
|
|
|
|
if( isPreview())
|
|
|
|
midLayout->addWidget(new QLabel( i18n( "<center><b>MachBunt</b></center>" ), widget()));
|
|
|
|
midLayout->addWidget(new TQLabel( i18n( "<center><b>MachBunt</b></center>" ), widget()));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
midLayout->addItem( new QSpacerItem( 0, 0 )); // no widget in the middle
|
|
|
|
midLayout->addItem( new TQSpacerItem( 0, 0 )); // no widget in the middle
|
|
|
|
midLayout->addSpacing(BORDER_RIGHT);
|
|
|
|
midLayout->addSpacing(BORDER_RIGHT);
|
|
|
|
|
|
|
|
|
|
|
|
windowLayout->addSpacing(BORDER_BOTTOM);
|
|
|
|
windowLayout->addSpacing(BORDER_BOTTOM);
|
|
|
@ -422,18 +422,18 @@ void MachBunt::borders(int& left, int& right, int& top, int& bottom) const
|
|
|
|
bottom = BORDER_BOTTOM;
|
|
|
|
bottom = BORDER_BOTTOM;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::mouseMoveOnButtonPressed( QMouseEvent *e )
|
|
|
|
void MachBunt::mouseMoveOnButtonPressed( TQMouseEvent *e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
if ( buttonPressedPosition.x() >= 0 ){
|
|
|
|
if ( buttonPressedPosition.x() >= 0 ){
|
|
|
|
QPoint p( buttonPressedPosition.x() - geometry().x(),
|
|
|
|
TQPoint p( buttonPressedPosition.x() - geometry().x(),
|
|
|
|
buttonPressedPosition.y() - geometry().y());
|
|
|
|
buttonPressedPosition.y() - geometry().y());
|
|
|
|
|
|
|
|
|
|
|
|
if ( mousePosition(p) == KDecoration::TopLeft ||
|
|
|
|
if ( mousePosition(p) == KDecoration::TopLeft ||
|
|
|
|
mousePosition(p) == KDecoration::TopRight )
|
|
|
|
mousePosition(p) == KDecoration::TopRight )
|
|
|
|
performMouseCommand(Options::MouseResize, QCursor::pos());
|
|
|
|
performMouseCommand(Options::MouseResize, TQCursor::pos());
|
|
|
|
else if ( mousePosition(p) == KDecoration::Top ){
|
|
|
|
else if ( mousePosition(p) == KDecoration::Top ){
|
|
|
|
QPoint m(geometry().x()+geometry().width()/2, geometry().y());
|
|
|
|
TQPoint m(geometry().x()+geometry().width()/2, geometry().y());
|
|
|
|
performMouseCommand(Options::MouseResize, m );
|
|
|
|
performMouseCommand(Options::MouseResize, m );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buttonPressedPosition.setX( -1 );
|
|
|
|
buttonPressedPosition.setX( -1 );
|
|
|
@ -445,13 +445,13 @@ void MachBunt::mouseMoveOnButtonPressed( QMouseEvent *e )
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::buttonPressed()
|
|
|
|
void MachBunt::buttonPressed()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QPoint p( QCursor::pos().x() - geometry().x(),
|
|
|
|
TQPoint p( TQCursor::pos().x() - geometry().x(),
|
|
|
|
QCursor::pos().y() - geometry().y());
|
|
|
|
TQCursor::pos().y() - geometry().y());
|
|
|
|
|
|
|
|
|
|
|
|
if ( mousePosition(p) == KDecorationDefines::PositionTopLeft ||
|
|
|
|
if ( mousePosition(p) == KDecorationDefines::PositionTopLeft ||
|
|
|
|
mousePosition(p) == KDecorationDefines::PositionTopRight ||
|
|
|
|
mousePosition(p) == KDecorationDefines::PositionTopRight ||
|
|
|
|
mousePosition(p) == KDecorationDefines::PositionTop )
|
|
|
|
mousePosition(p) == KDecorationDefines::PositionTop )
|
|
|
|
buttonPressedPosition = QCursor::pos();
|
|
|
|
buttonPressedPosition = TQCursor::pos();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::buttonReleased()
|
|
|
|
void MachBunt::buttonReleased()
|
|
|
@ -461,7 +461,7 @@ void MachBunt::buttonReleased()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KDecoration::Position
|
|
|
|
KDecoration::Position
|
|
|
|
MachBunt::mousePosition(const QPoint & p) const
|
|
|
|
MachBunt::mousePosition(const TQPoint & p) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int x = p.x();
|
|
|
|
int x = p.x();
|
|
|
|
int y = p.y();
|
|
|
|
int y = p.y();
|
|
|
@ -496,14 +496,14 @@ void MachBunt::slotMaximize()
|
|
|
|
maximize(maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull);
|
|
|
|
maximize(maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::resize( const QSize& s )
|
|
|
|
void MachBunt::resize( const TQSize& s )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
widget()->resize( s );
|
|
|
|
widget()->resize( s );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QSize MachBunt::minimumSize() const
|
|
|
|
TQSize MachBunt::minimumSize() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return QSize( 200, 50 );
|
|
|
|
return TQSize( 200, 50 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
|
|
|
|
const int SUPPORTED_WINDOW_TYPES_MASK = NET::NormalMask | NET::DesktopMask | NET::DockMask
|
|
|
@ -516,23 +516,23 @@ bool MachBunt::isTool()
|
|
|
|
return ((type==NET::Toolbar)||(type==NET::NET::Utility)||(type==NET::Menu));
|
|
|
|
return ((type==NET::Toolbar)||(type==NET::NET::Utility)||(type==NET::Menu));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MachBunt::eventFilter( QObject* o, QEvent* e )
|
|
|
|
bool MachBunt::eventFilter( TQObject* o, TQEvent* e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( o != widget())
|
|
|
|
if( o != widget())
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
switch( e->type())
|
|
|
|
switch( e->type())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case QEvent::Resize:
|
|
|
|
case TQEvent::Resize:
|
|
|
|
resizeEvent(static_cast< QResizeEvent* >( e ) );
|
|
|
|
resizeEvent(static_cast< TQResizeEvent* >( e ) );
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
case QEvent::Paint:
|
|
|
|
case TQEvent::Paint:
|
|
|
|
paintEvent(static_cast< QPaintEvent* >( e ) );
|
|
|
|
paintEvent(static_cast< TQPaintEvent* >( e ) );
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
case QEvent::MouseButtonDblClick:
|
|
|
|
case TQEvent::MouseButtonDblClick:
|
|
|
|
mouseDoubleClickEvent(static_cast< QMouseEvent* >( e ) );
|
|
|
|
mouseDoubleClickEvent(static_cast< TQMouseEvent* >( e ) );
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
case QEvent::MouseButtonPress:
|
|
|
|
case TQEvent::MouseButtonPress:
|
|
|
|
processMousePressEvent(static_cast< QMouseEvent* >( e ) );
|
|
|
|
processMousePressEvent(static_cast< TQMouseEvent* >( e ) );
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -572,13 +572,13 @@ bool BuntFactory::reset(unsigned long changed)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QValueList< BuntFactory::BorderSize > BuntFactory::borderSizes() const
|
|
|
|
TQValueList< BuntFactory::BorderSize > BuntFactory::borderSizes() const
|
|
|
|
{ // the list must be sorted
|
|
|
|
{ // the list must be sorted
|
|
|
|
return QValueList< BorderSize >() << BorderNormal;
|
|
|
|
return TQValueList< BorderSize >() << BorderNormal;
|
|
|
|
// TODO << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized;
|
|
|
|
// TODO << BorderLarge << BorderVeryLarge << BorderHuge << BorderVeryHuge << BorderOversized;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::resizeEvent( QResizeEvent*)
|
|
|
|
void MachBunt::resizeEvent( TQResizeEvent*)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doShape();
|
|
|
|
doShape();
|
|
|
|
|
|
|
|
|
|
|
@ -596,10 +596,10 @@ void MachBunt::resizeEvent( QResizeEvent*)
|
|
|
|
int dy = 0;
|
|
|
|
int dy = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if ( e->oldSize().width() != width() )
|
|
|
|
if ( e->oldSize().width() != width() )
|
|
|
|
dx = 32 + QABS( e->oldSize().width() - width() );
|
|
|
|
dx = 32 + TQABS( e->oldSize().width() - width() );
|
|
|
|
|
|
|
|
|
|
|
|
if ( e->oldSize().height() != height() )
|
|
|
|
if ( e->oldSize().height() != height() )
|
|
|
|
dy = 8 + QABS( e->oldSize().height() - height() );
|
|
|
|
dy = 8 + TQABS( e->oldSize().height() - height() );
|
|
|
|
|
|
|
|
|
|
|
|
if ( dy )
|
|
|
|
if ( dy )
|
|
|
|
update( 0, height() - dy + 1, width(), dy );
|
|
|
|
update( 0, height() - dy + 1, width(), dy );
|
|
|
@ -607,10 +607,10 @@ void MachBunt::resizeEvent( QResizeEvent*)
|
|
|
|
if ( dx )
|
|
|
|
if ( dx )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
update( width() - dx + 1, 0, dx, height() );
|
|
|
|
update( width() - dx + 1, 0, dx, height() );
|
|
|
|
update( QRect( QPoint(4,4), titlebar->geometry().bottomLeft() - QPoint(1,0) ) );
|
|
|
|
update( TQRect( TQPoint(4,4), titlebar->geometry().bottomLeft() - TQPoint(1,0) ) );
|
|
|
|
update( QRect( titlebar->geometry().topRight(), QPoint( width() - 4, titlebar->geometry().bottom() ) ) );
|
|
|
|
update( TQRect( titlebar->geometry().topRight(), TQPoint( width() - 4, titlebar->geometry().bottom() ) ) );
|
|
|
|
// Titlebar needs no paint event
|
|
|
|
// Titlebar needs no paint event
|
|
|
|
QApplication::postEvent( widget(), new QPaintEvent( titlebar->geometry(), FALSE ) );
|
|
|
|
TQApplication::postEvent( widget(), new TQPaintEvent( titlebar->geometry(), FALSE ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -624,23 +624,23 @@ void MachBunt::captionChange()
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::iconChange()
|
|
|
|
void MachBunt::iconChange()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
button[BtnMenu]->setPixmap( icon().pixmap( QIconSet::Small, QIconSet::Normal ));
|
|
|
|
button[BtnMenu]->setPixmap( icon().pixmap( TQIconSet::Small, TQIconSet::Normal ));
|
|
|
|
|
|
|
|
|
|
|
|
if (button[BtnMenu]->isVisible())
|
|
|
|
if (button[BtnMenu]->isVisible())
|
|
|
|
button[BtnMenu]->repaint(false);
|
|
|
|
button[BtnMenu]->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::paintEvent( QPaintEvent *pe )
|
|
|
|
void MachBunt::paintEvent( TQPaintEvent *pe )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// bool hicolor = QPixmap::defaultDepth() > 8;
|
|
|
|
// bool hicolor = TQPixmap::defaultDepth() > 8;
|
|
|
|
int fontoffset = 1;
|
|
|
|
int fontoffset = 1;
|
|
|
|
|
|
|
|
|
|
|
|
QPainter p(widget());
|
|
|
|
TQPainter p(widget());
|
|
|
|
p.setClipRegion(pe->region());
|
|
|
|
p.setClipRegion(pe->region());
|
|
|
|
|
|
|
|
|
|
|
|
// Obtain widget bounds.
|
|
|
|
// Obtain widget bounds.
|
|
|
|
QRect r(widget()->rect());
|
|
|
|
TQRect r(widget()->rect());
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
int x = r.x();
|
|
|
|
int x = r.x();
|
|
|
|
int y = r.y();
|
|
|
|
int y = r.y();
|
|
|
@ -649,7 +649,7 @@ void MachBunt::paintEvent( QPaintEvent *pe )
|
|
|
|
int w = r.width();
|
|
|
|
int w = r.width();
|
|
|
|
int ps = smallButtons ? PIX_SIDE/2 : PIX_SIDE;
|
|
|
|
int ps = smallButtons ? PIX_SIDE/2 : PIX_SIDE;
|
|
|
|
|
|
|
|
|
|
|
|
QColorGroup g = options()->colorGroup(KDecorationDefines::ColorFrame, isActive());
|
|
|
|
TQColorGroup g = options()->colorGroup(KDecorationDefines::ColorFrame, isActive());
|
|
|
|
|
|
|
|
|
|
|
|
p.setPen( g.dark() );
|
|
|
|
p.setPen( g.dark() );
|
|
|
|
// the dark outer drawings
|
|
|
|
// the dark outer drawings
|
|
|
@ -676,7 +676,7 @@ void MachBunt::paintEvent( QPaintEvent *pe )
|
|
|
|
|
|
|
|
|
|
|
|
// draw the title bar.
|
|
|
|
// draw the title bar.
|
|
|
|
r = titlebar->geometry();
|
|
|
|
r = titlebar->geometry();
|
|
|
|
// QFontMetrics fm(options()->font(true));
|
|
|
|
// TQFontMetrics fm(options()->font(true));
|
|
|
|
|
|
|
|
|
|
|
|
KPixmap titleBuffer;
|
|
|
|
KPixmap titleBuffer;
|
|
|
|
if ( titlebarSidebar )
|
|
|
|
if ( titlebarSidebar )
|
|
|
@ -685,7 +685,7 @@ void MachBunt::paintEvent( QPaintEvent *pe )
|
|
|
|
titleBuffer.resize(w, titleHeight);
|
|
|
|
titleBuffer.resize(w, titleHeight);
|
|
|
|
KIconEffect kie;
|
|
|
|
KIconEffect kie;
|
|
|
|
|
|
|
|
|
|
|
|
QPainter p2( &titleBuffer, widget());
|
|
|
|
TQPainter p2( &titleBuffer, widget());
|
|
|
|
|
|
|
|
|
|
|
|
p2.drawTiledPixmap( ps, 0, titleBuffer.width()-2*ps, titleHeight, middle_img[isActive()][smallButtons]);
|
|
|
|
p2.drawTiledPixmap( ps, 0, titleBuffer.width()-2*ps, titleHeight, middle_img[isActive()][smallButtons]);
|
|
|
|
p2.drawTiledPixmap( 0, 0, ps, titleHeight, left_img[isActive()][smallButtons]);
|
|
|
|
p2.drawTiledPixmap( 0, 0, ps, titleHeight, left_img[isActive()][smallButtons]);
|
|
|
@ -706,11 +706,11 @@ void MachBunt::paintEvent( QPaintEvent *pe )
|
|
|
|
p2.drawTiledPixmap(l-titleHeight/2, 0, titleHeight-(titleHeight/2), titleHeight, button_img[isActive()][smallButtons], titleHeight/2, 0);
|
|
|
|
p2.drawTiledPixmap(l-titleHeight/2, 0, titleHeight-(titleHeight/2), titleHeight, button_img[isActive()][smallButtons], titleHeight/2, 0);
|
|
|
|
|
|
|
|
|
|
|
|
// Reduce the font size and weight for toolwindows.
|
|
|
|
// Reduce the font size and weight for toolwindows.
|
|
|
|
QFont font = options()->font(true);
|
|
|
|
TQFont font = options()->font(true);
|
|
|
|
if ( smallButtons )
|
|
|
|
if ( smallButtons )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
font.setPointSize( font.pointSize() - 2 );
|
|
|
|
font.setPointSize( font.pointSize() - 2 );
|
|
|
|
font.setWeight( QFont::Normal );
|
|
|
|
font.setWeight( TQFont::Normal );
|
|
|
|
fontoffset = 0;
|
|
|
|
fontoffset = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
p2.setFont( font );
|
|
|
|
p2.setFont( font );
|
|
|
@ -731,13 +731,13 @@ void MachBunt::paintEvent( QPaintEvent *pe )
|
|
|
|
p.drawPixmap( 0, 0, titleBuffer );
|
|
|
|
p.drawPixmap( 0, 0, titleBuffer );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::showEvent(QShowEvent *)
|
|
|
|
void MachBunt::showEvent(TQShowEvent *)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
doShape();
|
|
|
|
doShape();
|
|
|
|
widget()->repaint();
|
|
|
|
widget()->repaint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::mouseDoubleClickEvent( QMouseEvent * e )
|
|
|
|
void MachBunt::mouseDoubleClickEvent( TQMouseEvent * e )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (titlebar->geometry().contains( e->pos() ) )
|
|
|
|
if (titlebar->geometry().contains( e->pos() ) )
|
|
|
|
titlebarDblClickOperation();
|
|
|
|
titlebarDblClickOperation();
|
|
|
@ -821,7 +821,7 @@ void MachBunt::calcHiddenButtons()
|
|
|
|
void MachBunt::menuButtonPressed()
|
|
|
|
void MachBunt::menuButtonPressed()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// KS - move the menu left by 3 pixels, and down 2 pixels.
|
|
|
|
// KS - move the menu left by 3 pixels, and down 2 pixels.
|
|
|
|
QPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3,
|
|
|
|
TQPoint menupoint ( button[BtnMenu]->rect().bottomLeft().x()-3,
|
|
|
|
button[BtnMenu]->rect().bottomLeft().y()+2 );
|
|
|
|
button[BtnMenu]->rect().bottomLeft().y()+2 );
|
|
|
|
KDecorationFactory* f = factory();
|
|
|
|
KDecorationFactory* f = factory();
|
|
|
|
showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ));
|
|
|
|
showWindowMenu( button[BtnMenu]->mapToGlobal( menupoint ));
|
|
|
@ -832,7 +832,7 @@ void MachBunt::menuButtonPressed()
|
|
|
|
|
|
|
|
|
|
|
|
void MachBunt::doShape(int x)
|
|
|
|
void MachBunt::doShape(int x)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QRegion mask(0, 0, width(), height());
|
|
|
|
TQRegion mask(0, 0, width(), height());
|
|
|
|
|
|
|
|
|
|
|
|
int bWidth = smallButtons ? 12 : PIX_HEIGHT;
|
|
|
|
int bWidth = smallButtons ? 12 : PIX_HEIGHT;
|
|
|
|
int i, bl=0, br=0, p=0;
|
|
|
|
int i, bl=0, br=0, p=0;
|
|
|
@ -845,40 +845,40 @@ void MachBunt::doShape(int x)
|
|
|
|
p=2;
|
|
|
|
p=2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
mask -= QRegion(0, 0, bl+3, 1);
|
|
|
|
mask -= TQRegion(0, 0, bl+3, 1);
|
|
|
|
mask -= QRegion(0, 1, bl+1, 1);
|
|
|
|
mask -= TQRegion(0, 1, bl+1, 1);
|
|
|
|
|
|
|
|
|
|
|
|
// Remove top-right corner.
|
|
|
|
// Remove top-right corner.
|
|
|
|
if ( smallButtons ){
|
|
|
|
if ( smallButtons ){
|
|
|
|
mask -= QRegion(r-3-br, 0, 3+br, 1+p);
|
|
|
|
mask -= TQRegion(r-3-br, 0, 3+br, 1+p);
|
|
|
|
mask -= QRegion(r-2-br, 1, 2+br, 1+p);
|
|
|
|
mask -= TQRegion(r-2-br, 1, 2+br, 1+p);
|
|
|
|
mask -= QRegion(r-1-br, 2, 1+br, 1+p);
|
|
|
|
mask -= TQRegion(r-1-br, 2, 1+br, 1+p);
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
mask -= QRegion(r-7-br, 0, 7+br, 1+p);
|
|
|
|
mask -= TQRegion(r-7-br, 0, 7+br, 1+p);
|
|
|
|
mask -= QRegion(r-5-br, 1, 5+br, 1+p);
|
|
|
|
mask -= TQRegion(r-5-br, 1, 5+br, 1+p);
|
|
|
|
mask -= QRegion(r-4-br, 2, 4+br, 1+p);
|
|
|
|
mask -= TQRegion(r-4-br, 2, 4+br, 1+p);
|
|
|
|
mask -= QRegion(r-3-br, 3, 3+br, 1+p);
|
|
|
|
mask -= TQRegion(r-3-br, 3, 3+br, 1+p);
|
|
|
|
mask -= QRegion(r-2-br, 4, 2+br, 1+p);
|
|
|
|
mask -= TQRegion(r-2-br, 4, 2+br, 1+p);
|
|
|
|
mask -= QRegion(r-1-br, 5, 1+br, 2+p);
|
|
|
|
mask -= TQRegion(r-1-br, 5, 1+br, 2+p);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for ( i=0; i<br; i++)
|
|
|
|
for ( i=0; i<br; i++)
|
|
|
|
mask -= QRegion(r-i-1, 0, 1, PIX_CORNER_RADIUS+bl+br-i);
|
|
|
|
mask -= TQRegion(r-i-1, 0, 1, PIX_CORNER_RADIUS+bl+br-i);
|
|
|
|
|
|
|
|
|
|
|
|
// the buttons
|
|
|
|
// the buttons
|
|
|
|
for ( i=0; i<BtnCount; i++){
|
|
|
|
for ( i=0; i<BtnCount; i++){
|
|
|
|
if ( button[i] && button[i]->isShown() ){
|
|
|
|
if ( button[i] && button[i]->isShown() ){
|
|
|
|
// top left corner of this button and right part of the button before
|
|
|
|
// top left corner of this button and right part of the button before
|
|
|
|
mask -= QRegion( button[i]->x() - 3, 0, 4, 1 );
|
|
|
|
mask -= TQRegion( button[i]->x() - 3, 0, 4, 1 );
|
|
|
|
mask -= QRegion( button[i]->x() - 1, 0, 1, 2 );
|
|
|
|
mask -= TQRegion( button[i]->x() - 1, 0, 1, 2 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// the pressed button
|
|
|
|
// the pressed button
|
|
|
|
if ( x != 0 ){
|
|
|
|
if ( x != 0 ){
|
|
|
|
mask -= QRegion( x, 0, bWidth, 2 );
|
|
|
|
mask -= TQRegion( x, 0, bWidth, 2 );
|
|
|
|
mask -= QRegion( x, 0, 1, 3 );
|
|
|
|
mask -= TQRegion( x, 0, 1, 3 );
|
|
|
|
mask -= QRegion( x + bWidth -3 , 0, 3, 3 );
|
|
|
|
mask -= TQRegion( x + bWidth -3 , 0, 3, 3 );
|
|
|
|
mask -= QRegion( x + bWidth -1 , 0, 1, 4 );
|
|
|
|
mask -= TQRegion( x + bWidth -1 , 0, 1, 4 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
setMask(mask);
|
|
|
|
setMask(mask);
|
|
|
|