diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-09-30 19:19:47 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-09-30 19:19:47 +0000 |
commit | 5cf5f65fd67cbae98a54479f0cba8be0f2876bd3 (patch) | |
tree | 27d88a06cbbd36765ce5c3af05f35adcc6e7b4c2 | |
parent | 232c094b842e1540e9fd4b719894c4b3a4136659 (diff) | |
download | mana-5cf5f65fd67cbae98a54479f0cba8be0f2876bd3.tar.gz mana-5cf5f65fd67cbae98a54479f0cba8be0f2876bd3.tar.bz2 mana-5cf5f65fd67cbae98a54479f0cba8be0f2876bd3.tar.xz mana-5cf5f65fd67cbae98a54479f0cba8be0f2876bd3.zip |
Made the inventory Win behave normally when resized by default size functions.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | src/gui/inventorywindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/inventorywindow.h | 10 | ||||
-rw-r--r-- | src/gui/setup.cpp | 1 | ||||
-rw-r--r-- | src/gui/window.h | 6 |
5 files changed, 34 insertions, 7 deletions
@@ -1,3 +1,9 @@ +2005-09-30 Yohann Ferreira <bertram@cegetel.net> + + * src/gui/inventorywindow.cpp, src/gui/inventorywindow.h, + src/gui/window.h src/gui/window.cpp src/gui/setup.cpp: Made the + inventory Win behave normally when resized by default size functions. + 2005-09-29 Yohann Ferreira <bertram@cegetel.net> * src/game.cpp, src/gui/window.h, src/gui/window.cpp, src/gui/setup.h, diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index af6c437e..3c373165 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -80,7 +80,6 @@ InventoryWindow::InventoryWindow(): add(itemEffectLabel); add(weightLabel); - updateWidgets(); useButton->setSize(48, useButton->getHeight()); loadWindowState(); @@ -235,3 +234,20 @@ Item* InventoryWindow::getItem() { return items->getItem(); } + +void InventoryWindow::loadWindowState() +{ + Window::loadWindowState(); + updateWidgets(); +} + +void InventoryWindow::setDefaultSize(int defaultX, int defaultY, int defaultWidth, int defaultHeight) +{ + Window::setDefaultSize(defaultX, defaultY, defaultWidth, defaultHeight); +} + +void InventoryWindow::resetToDefaultSize() +{ + Window::resetToDefaultSize(); + updateWidgets(); +} diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index 59275f99..4dbda261 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -65,13 +65,19 @@ class InventoryWindow : public Window, gcn::ActionListener void mouseMotion(int mx, int my); - void updateWidgets(); /** Updates widgets size/position */ - Item* getItem(); + void loadWindowState(); + + void setDefaultSize(int defaultX, int defaultY, int defaultWidth, int defaultHeight); + + void resetToDefaultSize(); + private: void updateButtons(); /** Updates button states */ + void updateWidgets(); /** Updates widgets size/position */ + ItemContainer *items; gcn::Button *useButton, *dropButton; diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index 46cb2452..582670a5 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -354,7 +354,6 @@ void Setup::action(const std::string &eventId) minimap->resetToDefaultSize(); chatWindow->resetToDefaultSize(); inventoryWindow->resetToDefaultSize(); - inventoryWindow->updateWidgets(); equipmentWindow->resetToDefaultSize(); helpWindow->resetToDefaultSize(); skillDialog->resetToDefaultSize(); diff --git a/src/gui/window.h b/src/gui/window.h index a48d3851..c1027518 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -177,20 +177,20 @@ class Window : public gcn::Window * Don't forget to set these default values and resizable before * calling this function. */ - void loadWindowState(); + virtual void loadWindowState(); /** * Set the default win pos and size. * (which can be different of the actual ones.) */ - void setDefaultSize(int defaultX, int defaultY, + virtual void setDefaultSize(int defaultX, int defaultY, int defaultWidth, int defaultHeight); /** * Reset the win pos and size to default. * Don't forget to set defaults first. */ - void resetToDefaultSize(); + virtual void resetToDefaultSize(); protected: gcn::Container *chrome; /**< Contained container */ |