diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/button.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/button.h | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/client.cpp b/src/client.cpp index d50257f2..538ecb54 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -581,7 +581,9 @@ int Client::exec() mDesktop = new Desktop; top->add(mDesktop); - mSetupButton = new Button(_("Setup"), "Setup", this); + mSetupButton = new Button("", "Setup", this); + mSetupButton->setButtonPopupText(_("Setup")); + mSetupButton->setButtonIcon("button-icon-setup.png"); mSetupButton->setPosition(top->getWidth() - mSetupButton->getWidth() - 3, 3); top->add(mSetupButton); diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 00e781e0..4a31fa63 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -118,7 +118,7 @@ bool Button::setButtonIcon(const std::string& iconFile) return (mButtonIcon); } -void Button::removeButtonIcon() +void Button::removeButtonIcon(bool adjustButtonSize) { if (!mButtonIcon) return; @@ -132,7 +132,8 @@ void Button::removeButtonIcon() delete[] mButtonIcon; mButtonIcon = 0; - adjustSize(); + if (adjustButtonSize) + adjustSize(); } void Button::init() @@ -190,7 +191,8 @@ Button::~Button() delete mTextPopup; mTextPopup = 0; } - removeButtonIcon(); + // Don' try to readjust the size when it's about to be deleted. + removeButtonIcon(false); } void Button::updateAlpha() diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 467a9125..f07bb913 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -89,7 +89,7 @@ class Button : public gcn::Button private: void init(); - void removeButtonIcon(); + void removeButtonIcon(bool adjustButtonSize = true); static ImageRect* mButton; /**< Button state graphics */ static int mInstances; /**< Number of button instances */ |