diff --git a/default/kdedefault.cpp b/default/kdedefault.cpp index c1984d0b07..9907eccfdb 100644 --- a/default/kdedefault.cpp +++ b/default/kdedefault.cpp @@ -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 ) diff --git a/default/kdedefault.h b/default/kdedefault.h index 98f721016b..abe99d738e 100644 --- a/default/kdedefault.h +++ b/default/kdedefault.h @@ -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);