summaryrefslogtreecommitdiff
path: root/src/gui/buysell.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-18 14:20:14 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-18 14:20:14 -0600
commitf64903f3f139ba83e94c6260c39f88b8d31b793b (patch)
tree39ab7a883bf8e3fb6e920ab47659086c96a6d139 /src/gui/buysell.cpp
parent203e995140e710475e1d8a3b512c8fe16a1acd96 (diff)
downloadmana-client-f64903f3f139ba83e94c6260c39f88b8d31b793b.tar.gz
mana-client-f64903f3f139ba83e94c6260c39f88b8d31b793b.tar.bz2
mana-client-f64903f3f139ba83e94c6260c39f88b8d31b793b.tar.xz
mana-client-f64903f3f139ba83e94c6260c39f88b8d31b793b.zip
Fix up the NPC interraction widnows a bit
Diffstat (limited to 'src/gui/buysell.cpp')
-rw-r--r--src/gui/buysell.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp
index 0550a822..75c49b1f 100644
--- a/src/gui/buysell.cpp
+++ b/src/gui/buysell.cpp
@@ -32,6 +32,7 @@
BuySellDialog::BuySellDialog(Network *network):
Window(_("Shop")), mNetwork(network)
{
+ setWindowName("BuySell");
Button *buyButton = 0;
static const char *buttonNames[] = {
N_("Buy"), N_("Sell"), N_("Cancel"), 0
@@ -48,16 +49,25 @@ BuySellDialog::BuySellDialog(Network *network):
}
buyButton->requestFocus();
- setContentSize(x, 2 * y + buyButton->getHeight());
+ loadWindowState();
- requestFocus();
+ setContentSize(x, 2 * y + buyButton->getHeight());
}
void BuySellDialog::logic()
{
Window::logic();
- if (!current_npc) setVisible(false);
+ if (isVisible() && !current_npc) {
+ setVisible(false);
+ }
+}
+
+void BuySellDialog::setVisible(bool visible)
+{
+ Window::setVisible(visible);
+
+ if (visible) requestFocus();
}
void BuySellDialog::action(const gcn::ActionEvent &event)