diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-07-31 20:05:33 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-08-01 23:05:45 +0200 |
commit | a61c57070aa618ac749e4a90a2b83c0e3a15e5fd (patch) | |
tree | 797bf52349e73aaeb2d46e421e8a798478deecb7 /src/gui/widgets | |
parent | 9dd1d4339fd186927b35b64024ee88ba615f2a25 (diff) | |
download | mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.tar.gz mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.tar.bz2 mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.tar.xz mana-a61c57070aa618ac749e4a90a2b83c0e3a15e5fd.zip |
Some positioning changes in the game UI
Moved player status bars to the top-right, next to the window menu. Used
the layout for dynamic adjustments to screen resolution.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/container.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/container.h | 7 | ||||
-rw-r--r-- | src/gui/widgets/popup.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/popup.h | 5 |
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); |