Modified to remove any global objects - everything global is simply
a pointer now. Forgot to say "added sticky button" in last commit :) svn path=/trunk/kdebase/kwin/; revision=93431icc-effect-5.14.5
parent
6e83477642
commit
0b810e5444
|
@ -81,8 +81,8 @@ static unsigned char pinup_dgray_bits[] = {
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Titlebar button positions
|
// Titlebar button positions
|
||||||
QString quartzButtonsLeft;
|
QString* quartzButtonsLeft;
|
||||||
QString quartzButtonsRight;
|
QString* quartzButtonsRight;
|
||||||
bool stickyButtonOnLeft = true;
|
bool stickyButtonOnLeft = true;
|
||||||
|
|
||||||
KPixmap* titleBlocks = NULL;
|
KPixmap* titleBlocks = NULL;
|
||||||
|
@ -99,6 +99,9 @@ QuartzHandler* clientHandler;
|
||||||
|
|
||||||
QuartzHandler::QuartzHandler()
|
QuartzHandler::QuartzHandler()
|
||||||
{
|
{
|
||||||
|
quartzButtonsLeft = new QString();
|
||||||
|
quartzButtonsRight = new QString();
|
||||||
|
|
||||||
readConfig();
|
readConfig();
|
||||||
createPixmaps();
|
createPixmaps();
|
||||||
connect( options, SIGNAL(resetClients()), this, SLOT(slotReset()) );
|
connect( options, SIGNAL(resetClients()), this, SLOT(slotReset()) );
|
||||||
|
@ -107,6 +110,9 @@ QuartzHandler::QuartzHandler()
|
||||||
|
|
||||||
QuartzHandler::~QuartzHandler()
|
QuartzHandler::~QuartzHandler()
|
||||||
{
|
{
|
||||||
|
delete quartzButtonsLeft;
|
||||||
|
delete quartzButtonsRight;
|
||||||
|
|
||||||
freePixmaps();
|
freePixmaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,17 +137,17 @@ void QuartzHandler::readConfig()
|
||||||
if( conf->readBoolEntry("CustomButtonPositions", false) )
|
if( conf->readBoolEntry("CustomButtonPositions", false) )
|
||||||
{
|
{
|
||||||
// Read the positions from the config file...
|
// Read the positions from the config file...
|
||||||
quartzButtonsLeft = conf->readEntry("ButtonsOnLeft", "MS");
|
*quartzButtonsLeft = conf->readEntry("ButtonsOnLeft", "MS");
|
||||||
quartzButtonsRight = conf->readEntry("ButtonsOnRight", "HIAX");
|
*quartzButtonsRight = conf->readEntry("ButtonsOnRight", "HIAX");
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// Use defaults
|
// Use defaults
|
||||||
quartzButtonsLeft = "MS";
|
*quartzButtonsLeft = "MS";
|
||||||
quartzButtonsRight = "HIAX";
|
*quartzButtonsRight = "HIAX";
|
||||||
}
|
}
|
||||||
|
|
||||||
// A small hack to make the sticky button look nicer
|
// A small hack to make the sticky button look nicer
|
||||||
stickyButtonOnLeft = (bool)quartzButtonsLeft.contains( 'S' );
|
stickyButtonOnLeft = (bool)quartzButtonsLeft->contains( 'S' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -453,13 +459,13 @@ QuartzClient::QuartzClient( Workspace *ws, WId w, QWidget *parent,
|
||||||
hb->setResizeMode( QLayout::FreeResize );
|
hb->setResizeMode( QLayout::FreeResize );
|
||||||
g->addLayout ( hb, 1, 1 );
|
g->addLayout ( hb, 1, 1 );
|
||||||
|
|
||||||
addClientButtons( quartzButtonsLeft );
|
addClientButtons( *quartzButtonsLeft );
|
||||||
|
|
||||||
titlebar = new QSpacerItem( 10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
titlebar = new QSpacerItem( 10, titleHeight, QSizePolicy::Expanding, QSizePolicy::Minimum );
|
||||||
hb->addItem(titlebar);
|
hb->addItem(titlebar);
|
||||||
hb->addSpacing(2);
|
hb->addSpacing(2);
|
||||||
|
|
||||||
addClientButtons( quartzButtonsRight, false );
|
addClientButtons( *quartzButtonsRight, false );
|
||||||
|
|
||||||
hb->addSpacing(2);
|
hb->addSpacing(2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue