diff options
Diffstat (limited to 'src/gui/itemshortcutwindow.cpp')
-rw-r--r-- | src/gui/itemshortcutwindow.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/gui/itemshortcutwindow.cpp b/src/gui/itemshortcutwindow.cpp index 2ee2cfde..efac9353 100644 --- a/src/gui/itemshortcutwindow.cpp +++ b/src/gui/itemshortcutwindow.cpp @@ -38,7 +38,7 @@ ItemShortcutWindow::ItemShortcutWindow() mItems = new ItemShortcutContainer(); - int border = (SCROLL_PADDING * 2) + (getPadding() * 2); + int border = SCROLL_PADDING * 2 + getPadding() * 2; setMinWidth(mItems->getBoxWidth() + border); setMinHeight(mItems->getBoxHeight() + border); setMaxWidth(mItems->getBoxWidth() * mItems->getMaxItems() + border); @@ -50,6 +50,7 @@ ItemShortcutWindow::ItemShortcutWindow() add(mInvenScroll); + addWindowListener(this); loadWindowState(); } @@ -64,32 +65,11 @@ void ItemShortcutWindow::logic() Window::logic(); } -void ItemShortcutWindow::mouseDragged(gcn::MouseEvent &event) -{ - const int tWidth = getWidth(), tHeight = getHeight(); - Window::mouseDragged(event); - if (getWidth() != tWidth || getHeight() != tHeight) - { - updateWidgets(); - } -} - -void ItemShortcutWindow::updateWidgets() +void ItemShortcutWindow::windowResized(const WindowEvent &event) { const gcn::Rectangle area = getChildrenArea(); - mInvenScroll->setSize(area.width - SCROLL_PADDING, - area.height - SCROLL_PADDING); -} - -void ItemShortcutWindow::loadWindowState() -{ - Window::loadWindowState(); - updateWidgets(); -} - -void ItemShortcutWindow::resetToDefaultSize() -{ - Window::resetToDefaultSize(); - updateWidgets(); + mInvenScroll->setSize( + area.width - SCROLL_PADDING, + area.height - SCROLL_PADDING); } |