From bc4c9a33066e26bcdd3c564c90294777a839a5be Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 23 Sep 2012 15:11:03 +0300 Subject: Fix unused empty space in onscreen buttons. --- src/gui/windowmenu.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index f33fe3e87..e0bd1c843 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -239,10 +239,15 @@ void WindowMenu::addButton(const char *const text, add(btn); btn->setFocusable(false); if (!visible) + { btn->setVisible(false); + } + else + { + x += btn->getWidth() + 3; + h = btn->getHeight(); + } mButtons.push_back(btn); - x += btn->getWidth() + 3; - h = btn->getHeight(); mButtonNames[text] = btn; } -- cgit v1.2.3-70-g09d2