summaryrefslogtreecommitdiff
path: root/src/gui/windowmenu.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-07-09 15:32:05 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-28 18:32:51 +0200
commit7bdae3a386c07e553e1d5667709bb78acaf51223 (patch)
treedf2b64e1551f2bfa2a20ab90c80f3606a6a0ee43 /src/gui/windowmenu.cpp
parent8842689ccbfdef8da1f651e8493dc4dff7474433 (diff)
downloadmana-7bdae3a386c07e553e1d5667709bb78acaf51223.tar.gz
mana-7bdae3a386c07e553e1d5667709bb78acaf51223.tar.bz2
mana-7bdae3a386c07e553e1d5667709bb78acaf51223.tar.xz
mana-7bdae3a386c07e553e1d5667709bb78acaf51223.zip
Made the button icon only shown when the icon file is valid.
And falls back to the text based caption otherwise.
Diffstat (limited to 'src/gui/windowmenu.cpp')
-rw-r--r--src/gui/windowmenu.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index a200427f..2595c819 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -160,10 +160,9 @@ void WindowMenu::addButton(const std::string& text, int &x, int &h,
const std::string& iconPath)
{
Button *btn = new Button("", text, this);
- if (!iconPath.empty())
+ if (!iconPath.empty() && btn->setButtonIcon(iconPath))
{
btn->setButtonPopupText(gettext(text.c_str()));
- btn->setButtonIcon(iconPath);
}
else
{