Implement iconChange()

svn path=/trunk/kdebase/kwin/; revision=83021
This commit is contained in:
Waldo Bastian 2001-02-15 21:40:54 +00:00
parent 6ab086647b
commit e0a5931d84
2 changed files with 23 additions and 15 deletions

View file

@ -515,21 +515,7 @@ KDEClient::KDEClient( Workspace *ws, WId w, QWidget *parent,
th -= 2;
button[BtnMenu] = new KDEDefaultClientButton(this, "menu");
if(!miniIcon().isNull()){
lightIcon = miniIcon();
lightIcon.detach();
lightIcon = KPixmapEffect::intensity(lightIcon, 1.0);
if(miniIcon().mask())
lightIcon.setMask(*miniIcon().mask());
button[BtnMenu]->setPixmap(miniIcon(), lightIcon);
}
else{
lightIcon = *defaultMenuPix;
lightIcon.detach();
lightIcon = KPixmapEffect::intensity(lightIcon, .50);
lightIcon.setMask(*defaultMenuPix->mask());
button[BtnMenu]->setPixmap(*defaultMenuPix, lightIcon);
}
iconChange();
connect(button[BtnMenu], SIGNAL(pressed()), this,
SLOT(menuButtonPressed()));
button[BtnClose] = new KDEDefaultClientButton(this, "close", close_bits);
@ -595,6 +581,27 @@ KDEClient::KDEClient( Workspace *ws, WId w, QWidget *parent,
bufferDirty = true;
}
void KDEClient::iconChange()
{
if(!miniIcon().isNull()){
lightIcon = miniIcon();
lightIcon.detach();
lightIcon = KPixmapEffect::intensity(lightIcon, 1.0);
if(miniIcon().mask())
lightIcon.setMask(*miniIcon().mask());
button[BtnMenu]->setPixmap(miniIcon(), lightIcon);
}
else{
lightIcon = *defaultMenuPix;
lightIcon.detach();
lightIcon = KPixmapEffect::intensity(lightIcon, .50);
lightIcon.setMask(*defaultMenuPix->mask());
button[BtnMenu]->setPixmap(*defaultMenuPix, lightIcon);
}
if (button[BtnMenu]->isVisible())
button[BtnMenu]->repaint(false);
}
void KDEClient::slotMaximize()
{
if ( button[BtnMax]->last_button == MidButton )

View file

@ -62,6 +62,7 @@ protected:
void captionChange( const QString& name );
void stickyChange(bool on);
void maximizeChange(bool m);
void iconChange();
void doShape();
void activeChange(bool);