From 86c4819bee1bcd990b6be20f36dcb26938acac8e Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Fri, 3 Feb 2012 10:53:19 +0100 Subject: Changed the setup button at login stage to use the icon. I also made the button not readjust its size when deleted to avoid a crash. Reviewed-by: Erik Schilling --- src/gui/widgets/button.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gui/widgets/button.cpp') 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() -- cgit v1.2.3-70-g09d2