Maelstrom: If the UI manager is resized, auto-size any panels along with it.

https://github.com/libsdl-org/Maelstrom/commit/1e99240f9eb07574b379257c6a1df1f62a226eb9

From 1e99240f9eb07574b379257c6a1df1f62a226eb9 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Fri, 14 Sep 2012 00:16:38 -0700
Subject: [PATCH] If the UI manager is resized, auto-size any panels along with
 it.

---
 screenlib/UIManager.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/screenlib/UIManager.h b/screenlib/UIManager.h
index 8f279c49..f126993c 100644
--- a/screenlib/UIManager.h
+++ b/screenlib/UIManager.h
@@ -93,6 +93,15 @@ class UIManager : public UIArea, public UIFontInterface, public UISoundInterface
 	void Draw(bool fullUpdate = true);
 	bool HandleEvent(const SDL_Event &event);
 
+	virtual void OnRectChanged() {
+		UIArea::OnRectChanged();
+
+		for (int i = 0; i < m_panels.length(); ++i) {
+			UIPanel *panel = m_panels[i];
+			panel->AutoSize(Width(), Height());
+		}
+	}
+
 public:
 	/* These should be implemented to load UI from XMl */
 	virtual UIPanel *CreatePanel(const char *type, const char *name) {