From c77a4202fb1658bf575fbdb50c89229c5e9ea5b4 Mon Sep 17 00:00:00 2001 From: Sandro Giessl Date: Sat, 19 Mar 2005 15:44:10 +0000 Subject: [PATCH] inform buttons of state change svn path=/trunk/kdebase/kwin/; revision=398989 --- lib/kcommondecoration.cpp | 8 ++++++++ lib/kcommondecoration.h | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/kcommondecoration.cpp b/lib/kcommondecoration.cpp index d9f3661284..9669b75969 100644 --- a/lib/kcommondecoration.cpp +++ b/lib/kcommondecoration.cpp @@ -405,6 +405,7 @@ void KCommonDecoration::maximizeChange() m_button[MaxButton]->setTipText( (maximizeMode()!=MaximizeFull) ? i18n("Maximize") : i18n("Restore")); + m_button[MaxButton]->reset(KCommonDecorationButton::StateChange); } } @@ -415,6 +416,7 @@ void KCommonDecoration::desktopChange() m_button[OnAllDesktopsButton]->setTipText( isOnAllDesktops() ? i18n("Not on all desktops") : i18n("On all desktops")); + m_button[OnAllDesktopsButton]->reset(KCommonDecorationButton::StateChange); } } @@ -426,6 +428,7 @@ void KCommonDecoration::shadeChange() m_button[ShadeButton]->setTipText( shaded ? i18n("Unshade") : i18n("Shade")); + m_button[ShadeButton]->reset(KCommonDecorationButton::StateChange); } } @@ -434,6 +437,7 @@ void KCommonDecoration::iconChange() if (m_button[MenuButton]) { m_button[MenuButton]->update(); + m_button[MenuButton]->reset(KCommonDecorationButton::IconChange); } } @@ -454,12 +458,14 @@ void KCommonDecoration::keepAboveChange(bool above) { m_button[AboveButton]->setOn(above); m_button[AboveButton]->setTipText( above?i18n("Do not keep above others"):i18n("Keep above others") ); + m_button[AboveButton]->reset(KCommonDecorationButton::StateChange); } if (m_button[BelowButton] && m_button[BelowButton]->isOn()) { m_button[BelowButton]->setOn(false); m_button[BelowButton]->setTipText( i18n("Keep below others") ); + m_button[BelowButton]->reset(KCommonDecorationButton::StateChange); } } @@ -469,12 +475,14 @@ void KCommonDecoration::keepBelowChange(bool below) { m_button[BelowButton]->setOn(below); m_button[BelowButton]->setTipText( below?i18n("Do not keep below others"):i18n("Keep below others") ); + m_button[BelowButton]->reset(KCommonDecorationButton::StateChange); } if (m_button[AboveButton] && m_button[AboveButton]->isOn()) { m_button[AboveButton]->setOn(false); m_button[AboveButton]->setTipText( i18n("Keep above others") ); + m_button[AboveButton]->reset(KCommonDecorationButton::StateChange); } } diff --git a/lib/kcommondecoration.h b/lib/kcommondecoration.h index dd6b25cef0..a3c3c736e0 100644 --- a/lib/kcommondecoration.h +++ b/lib/kcommondecoration.h @@ -289,7 +289,8 @@ class KWIN_EXPORT KCommonDecorationButton : public QButton SizeChange = 1 << 1, ///< The button size changed @see setSize() ToggleChange = 1 << 2, ///< The button toggle state has changed @see setToggleButton() StateChange = 1 << 3, ///< The button has been set pressed or not... @see setOn() - DecorationReset = 1 << 4 ///< E.g. when decoration colors have changed + IconChange = 1 << 4, ///< The window icon has been changed + DecorationReset = 1 << 5 ///< E.g. when decoration colors have changed }; /** * Initialize the button after size change etc.