summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/container.cpp8
-rw-r--r--src/gui/widgets/container.h7
-rw-r--r--src/gui/widgets/popup.cpp5
-rw-r--r--src/gui/widgets/popup.h5
4 files changed, 14 insertions, 11 deletions
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp
index e1b99af7..a2b3ee78 100644
--- a/src/gui/widgets/container.cpp
+++ b/src/gui/widgets/container.cpp
@@ -54,3 +54,11 @@ ContainerPlacer Container::getPlacer(int x, int y)
{
return ContainerPlacer(this, &getLayout().at(x, y));
}
+
+void Container::updateLayout()
+{
+ const gcn::Rectangle area = getChildrenArea();
+ int w = area.width;
+ int h = area.height;
+ getLayout().reflow(w, h);
+}
diff --git a/src/gui/widgets/container.h b/src/gui/widgets/container.h
index 46b719a1..2b8039f4 100644
--- a/src/gui/widgets/container.h
+++ b/src/gui/widgets/container.h
@@ -44,7 +44,6 @@ class Container : public gcn::Container
Container();
~Container();
- protected:
/**
* Gets the layout handler for this container.
*/
@@ -60,6 +59,12 @@ class Container : public gcn::Container
*/
ContainerPlacer getPlacer(int x, int y);
+ /**
+ * Updates the layout to match the available size in the container
+ * (happens automatically on resizes).
+ */
+ void updateLayout();
+
private:
LayoutHelper *mLayoutHelper;
};
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 3b80fe5e..f71714ed 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -66,11 +66,6 @@ Popup::~Popup()
mSkin->instances--;
}
-void Popup::setWindowContainer(WindowContainer *wc)
-{
- windowContainer = wc;
-}
-
void Popup::draw(gcn::Graphics *graphics)
{
Graphics *g = static_cast<Graphics*>(graphics);
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 5ec6ecd0..0f062ef5 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -65,11 +65,6 @@ class Popup : public Container, public gcn::MouseListener
~Popup();
/**
- * Sets the window container to be used by new popups.
- */
- static void setWindowContainer(WindowContainer *windowContainer);
-
- /**
* Draws the popup.
*/
void draw(gcn::Graphics *graphics);