diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-09 01:23:14 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-09 01:23:14 -0600 |
commit | 40883938ceb60b0999f9b693dadbe2239e83f139 (patch) | |
tree | 594edf50f129f6e6a09b8f139495fdc4bf587684 /src/gui/storagewindow.cpp | |
parent | 5fa3f62d0d6d9cbffeef0f6a2497aae023dbadcf (diff) | |
download | mana-40883938ceb60b0999f9b693dadbe2239e83f139.tar.gz mana-40883938ceb60b0999f9b693dadbe2239e83f139.tar.bz2 mana-40883938ceb60b0999f9b693dadbe2239e83f139.tar.xz mana-40883938ceb60b0999f9b693dadbe2239e83f139.zip |
Got rid of an ugly and unified interface breaking cancel button in favor
of adding overridable close functionality to the Window class. Now, if
you need a close button, but need to do something different, or in
addition to the Window close functionality, you can override it and do
that action.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/storagewindow.cpp')
-rw-r--r-- | src/gui/storagewindow.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gui/storagewindow.cpp b/src/gui/storagewindow.cpp index 856f9166..d3bc7ef8 100644 --- a/src/gui/storagewindow.cpp +++ b/src/gui/storagewindow.cpp @@ -59,11 +59,11 @@ StorageWindow::StorageWindow(Network *network, int invSize): { setWindowName("Storage"); setResizable(true); + setCloseButton(true); // If you adjust these defaults, don't forget to adjust the trade window's. setDefaultSize(115, 25, 375, 300); - mCancelButton = new Button(_("Close"), "close", this); mStoreButton = new Button(_("Store"), "store", this); mRetrieveButton = new Button(_("Retrieve"), "retrieve", this); @@ -85,7 +85,6 @@ StorageWindow::StorageWindow(Network *network, int invSize): place(0, 0, mSlotsLabel).setPadding(3); place(1, 0, mSlotsBar, 3); place(0, 1, mInvenScroll, 4, 4); - place(0, 5, mCancelButton); place(2, 5, mStoreButton); place(3, 5, mRetrieveButton); @@ -121,11 +120,7 @@ void StorageWindow::logic() void StorageWindow::action(const gcn::ActionEvent &event) { - if (event.getId() == "close") - { - close(); - } - else if (event.getId() == "store") + if (event.getId() == "store") { Item *item = inventoryWindow->getSelectedItem(); |