diff options
-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 */ |