summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-01 01:04:24 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-01 01:04:24 +0300
commit51126f28cb4b258ba9711fa294652ed87f2451b8 (patch)
tree33fe16e876074f72c5f46a31f9735c3cf83fd70b /src/gui/widgets
parent3a54cf61c4ea127a16ca11c515906a5f419b97df (diff)
downloadmanaverse-51126f28cb4b258ba9711fa294652ed87f2451b8.tar.gz
manaverse-51126f28cb4b258ba9711fa294652ed87f2451b8.tar.bz2
manaverse-51126f28cb4b258ba9711fa294652ed87f2451b8.tar.xz
manaverse-51126f28cb4b258ba9711fa294652ed87f2451b8.zip
Fix some resize issues in setup window.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/setuptab.cpp3
-rw-r--r--src/gui/widgets/setuptab.h5
-rw-r--r--src/gui/widgets/setuptabscroll.cpp6
-rw-r--r--src/gui/widgets/setuptabscroll.h2
4 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/widgets/setuptab.cpp b/src/gui/widgets/setuptab.cpp
index 690b09f49..227b74d98 100644
--- a/src/gui/widgets/setuptab.cpp
+++ b/src/gui/widgets/setuptab.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/setuptab.h"
+#include "logger.h"
+
#include "debug.h"
SetupTab::SetupTab(const Widget2 *const widget) :
@@ -29,6 +31,7 @@ SetupTab::SetupTab(const Widget2 *const widget) :
gcn::ActionListener()
{
setOpaque(false);
+ addWidgetListener(this);
}
void SetupTab::externalUpdated()
diff --git a/src/gui/widgets/setuptab.h b/src/gui/widgets/setuptab.h
index 8ffab10d1..7d0c45d17 100644
--- a/src/gui/widgets/setuptab.h
+++ b/src/gui/widgets/setuptab.h
@@ -26,6 +26,7 @@
#include "gui/widgets/container.h"
#include <guichan/actionlistener.hpp>
+#include <guichan/widgetlistener.hpp>
#include <string>
@@ -34,7 +35,9 @@
/**
* A container for the contents of a tab in the setup window.
*/
-class SetupTab : public Container, public gcn::ActionListener
+class SetupTab : public Container,
+ public gcn::ActionListener,
+ public gcn::WidgetListener
{
public:
SetupTab(const Widget2 *const widget);
diff --git a/src/gui/widgets/setuptabscroll.cpp b/src/gui/widgets/setuptabscroll.cpp
index aac5cf0e8..64060aaad 100644
--- a/src/gui/widgets/setuptabscroll.cpp
+++ b/src/gui/widgets/setuptabscroll.cpp
@@ -118,3 +118,9 @@ void SetupTabScroll::externalUpdated()
widget->externalUpdated((*iter).first);
}
}
+
+void SetupTabScroll::widgetResized(const gcn::Event &event)
+{
+ mScroll->setWidth(getWidth() - 12);
+ mScroll->setHeight(getHeight() - 12 - 12);
+}
diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h
index 70ac756cb..e90ce28c2 100644
--- a/src/gui/widgets/setuptabscroll.h
+++ b/src/gui/widgets/setuptabscroll.h
@@ -60,6 +60,8 @@ class SetupTabScroll : public SetupTab
int getPreferredFirstItemSize() A_WARN_UNUSED
{ return mPreferredFirstItemSize; }
+ void widgetResized(const gcn::Event &event) override;
+
protected:
VertContainer *mContainer;
ScrollArea *mScroll;