From b2b13c21091b516b57b4bf3c91a313f019bf3579 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 7 Aug 2007 17:03:55 +0000 Subject: Fixed my breakage of persistent window dimensions. Cleaned a few things along the way. --- src/gui/inventorywindow.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'src/gui/inventorywindow.cpp') diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index 2822faaa..7b199be4 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -81,7 +81,8 @@ InventoryWindow::InventoryWindow(): mUseButton->setSize(48, mUseButton->getHeight()); - loadWindowState(); + loadWindowState("Inventory"); + updateContentSize(); } void InventoryWindow::logic() @@ -157,17 +158,7 @@ void InventoryWindow::mouseClicked(gcn::MouseEvent &event) } } -void InventoryWindow::mouseDragged(gcn::MouseEvent &event) -{ - int tmpWidth = getWidth(), tmpHeight = getHeight(); - Window::mouseDragged(event); - if (getWidth() != tmpWidth || getHeight() != tmpHeight) - { - updateWidgets(); - } -} - -void InventoryWindow::updateWidgets() +void InventoryWindow::updateContentSize() { gcn::Rectangle area = getChildrenArea(); int width = area.width; @@ -213,14 +204,3 @@ Item* InventoryWindow::getItem() return mItems->getItem(); } -void InventoryWindow::loadWindowState() -{ - Window::loadWindowState(); - updateWidgets(); -} - -void InventoryWindow::resetToDefaultSize() -{ - Window::resetToDefaultSize(); - updateWidgets(); -} -- cgit v1.2.3-70-g09d2