Set the current window state when initializing OnAllDesktop buttons. (#71531)
svn path=/trunk/kdebase/kwin/; revision=278218
This commit is contained in:
parent
c1d1b6289f
commit
9268d2acdb
7 changed files with 9 additions and 7 deletions
|
@ -271,7 +271,7 @@ B2Client::B2Client(KDecorationBridge *b, KDecorationFactory *f)
|
||||||
|
|
||||||
void B2Client::init()
|
void B2Client::init()
|
||||||
{
|
{
|
||||||
const QString tips[]= {i18n("Menu"), i18n("On All desktops"),
|
const QString tips[]= {i18n("Menu"), isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All desktops"),
|
||||||
i18n("Minimize"), i18n("Maximize"),
|
i18n("Minimize"), i18n("Maximize"),
|
||||||
i18n("Close"), i18n("Help") };
|
i18n("Close"), i18n("Help") };
|
||||||
|
|
||||||
|
|
|
@ -794,7 +794,7 @@ void KDEDefaultClient::addClientButtons( const QString& s, bool isLeft )
|
||||||
if (!button[BtnSticky])
|
if (!button[BtnSticky])
|
||||||
{
|
{
|
||||||
button[BtnSticky] = new KDEDefaultButton(this, "sticky",
|
button[BtnSticky] = new KDEDefaultButton(this, "sticky",
|
||||||
largeButtons, isLeft, true, NULL, i18n("Sticky"));
|
largeButtons, isLeft, true, NULL, isOnAllDesktops()?i18n("Un-Sticky"):i18n("Sticky"));
|
||||||
button[BtnSticky]->turnOn( isOnAllDesktops() );
|
button[BtnSticky]->turnOn( isOnAllDesktops() );
|
||||||
connect( button[BtnSticky], SIGNAL(clicked()),
|
connect( button[BtnSticky], SIGNAL(clicked()),
|
||||||
this, SLOT(toggleOnAllDesktops()) );
|
this, SLOT(toggleOnAllDesktops()) );
|
||||||
|
|
|
@ -957,7 +957,9 @@ void KeramikClient::addButtons( QBoxLayout *layout, const QString &s )
|
||||||
case 'S' :
|
case 'S' :
|
||||||
if ( !button[OnAllDesktopsButton] ) {
|
if ( !button[OnAllDesktopsButton] ) {
|
||||||
button[OnAllDesktopsButton] = new KeramikButton( this, "on_all_desktops",
|
button[OnAllDesktopsButton] = new KeramikButton( this, "on_all_desktops",
|
||||||
OnAllDesktopsButton, i18n("On All Desktops") );
|
OnAllDesktopsButton, isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All Desktops") );
|
||||||
|
if(isOnAllDesktops())
|
||||||
|
button[OnAllDesktopsButton]->toggle();
|
||||||
connect( button[OnAllDesktopsButton], SIGNAL( clicked() ), SLOT( toggleOnAllDesktops() ) );
|
connect( button[OnAllDesktopsButton], SIGNAL( clicked() ), SLOT( toggleOnAllDesktops() ) );
|
||||||
layout->addWidget( button[OnAllDesktopsButton] );
|
layout->addWidget( button[OnAllDesktopsButton] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@ void LaptopClient::init()
|
||||||
button[BtnClose] = new LaptopButton(btnWidth2, th, this, "close",
|
button[BtnClose] = new LaptopButton(btnWidth2, th, this, "close",
|
||||||
close_bits, i18n("Close"));
|
close_bits, i18n("Close"));
|
||||||
button[BtnSticky] = new LaptopButton(btnWidth1, th, this, "sticky",
|
button[BtnSticky] = new LaptopButton(btnWidth1, th, this, "sticky",
|
||||||
NULL, i18n("On All Desktops"));
|
NULL, isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All Desktops"));
|
||||||
if(isOnAllDesktops())
|
if(isOnAllDesktops())
|
||||||
button[BtnSticky]->setBitmap(unsticky_bits);
|
button[BtnSticky]->setBitmap(unsticky_bits);
|
||||||
else
|
else
|
||||||
|
|
|
@ -384,7 +384,7 @@ void ModernSys::init()
|
||||||
QSizePolicy::Minimum);
|
QSizePolicy::Minimum);
|
||||||
|
|
||||||
button[BtnClose] = new ModernButton(this, "close", close_bits, i18n("Close"));
|
button[BtnClose] = new ModernButton(this, "close", close_bits, i18n("Close"));
|
||||||
button[BtnSticky] = new ModernButton(this, "sticky", NULL, i18n("Sticky"));
|
button[BtnSticky] = new ModernButton(this, "sticky", NULL, isOnAllDesktops()?i18n("Un-Sticky"):i18n("Sticky"));
|
||||||
button[BtnMinimize] = new ModernButton(this, "iconify", iconify_bits, i18n("Minimize"));
|
button[BtnMinimize] = new ModernButton(this, "iconify", iconify_bits, i18n("Minimize"));
|
||||||
button[BtnMaximize] = new ModernButton(this, "maximize", maximize_bits, i18n("Maximize"), LeftButton|MidButton|RightButton);
|
button[BtnMaximize] = new ModernButton(this, "maximize", maximize_bits, i18n("Maximize"), LeftButton|MidButton|RightButton);
|
||||||
button[BtnHelp] = new ModernButton(this, "help", question_bits, i18n("Help"));
|
button[BtnHelp] = new ModernButton(this, "help", question_bits, i18n("Help"));
|
||||||
|
|
|
@ -591,7 +591,7 @@ void QuartzClient::addClientButtons( const QString& s, bool isLeft )
|
||||||
if (!button[BtnOnAllDesktops])
|
if (!button[BtnOnAllDesktops])
|
||||||
{
|
{
|
||||||
button[BtnOnAllDesktops] = new QuartzButton(this, "on_all_desktops",
|
button[BtnOnAllDesktops] = new QuartzButton(this, "on_all_desktops",
|
||||||
largeButtons, isLeft, true, NULL, i18n("On All Desktops"));
|
largeButtons, isLeft, true, NULL, isOnAllDesktops()?i18n("Not On All Desktops"):i18n("On All Desktops"));
|
||||||
button[BtnOnAllDesktops]->turnOn( isOnAllDesktops() );
|
button[BtnOnAllDesktops]->turnOn( isOnAllDesktops() );
|
||||||
connect( button[BtnOnAllDesktops], SIGNAL(clicked()),
|
connect( button[BtnOnAllDesktops], SIGNAL(clicked()),
|
||||||
this, SLOT(toggleOnAllDesktops()) );
|
this, SLOT(toggleOnAllDesktops()) );
|
||||||
|
|
|
@ -34,7 +34,7 @@ static unsigned char unsticky_bits[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
WebButtonSticky::WebButtonSticky(bool sticky, QWidget * parent, WebClient* deco)
|
WebButtonSticky::WebButtonSticky(bool sticky, QWidget * parent, WebClient* deco)
|
||||||
: WebButton(parent, i18n("On All Desktops"), deco)
|
: WebButton(parent, sticky?i18n("Not On All Desktops"):i18n("On All Desktops"), deco)
|
||||||
{
|
{
|
||||||
QBitmap b(8, 8, sticky ? unsticky_bits : sticky_bits, true /* isXBitmap */);
|
QBitmap b(8, 8, sticky ? unsticky_bits : sticky_bits, true /* isXBitmap */);
|
||||||
b.setMask(b);
|
b.setMask(b);
|
||||||
|
|
Loading…
Reference in a new issue