summaryrefslogtreecommitdiff
path: root/src/gui/buyselldialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-06 21:27:07 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-06 21:27:07 +0300
commit551e9f611c391e3df4e7635a624336586a39fdfc (patch)
tree18d101fc0ebc2ecaccbae221c0bc6c4b83ab77fb /src/gui/buyselldialog.cpp
parent50029e25816b261dd5d9659d6da76cef7e392c27 (diff)
downloadplus-551e9f611c391e3df4e7635a624336586a39fdfc.tar.gz
plus-551e9f611c391e3df4e7635a624336586a39fdfc.tar.bz2
plus-551e9f611c391e3df4e7635a624336586a39fdfc.tar.xz
plus-551e9f611c391e3df4e7635a624336586a39fdfc.zip
improve buyselldialog class.
Diffstat (limited to 'src/gui/buyselldialog.cpp')
-rw-r--r--src/gui/buyselldialog.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/buyselldialog.cpp b/src/gui/buyselldialog.cpp
index 32e762c1d..1c8c81b52 100644
--- a/src/gui/buyselldialog.cpp
+++ b/src/gui/buyselldialog.cpp
@@ -45,7 +45,7 @@ BuySellDialog::BuySellDialog(const int npcId) :
init();
}
-BuySellDialog::BuySellDialog(std::string nick) :
+BuySellDialog::BuySellDialog(const std::string &nick) :
// TRANSLATORS: shop window name
Window(_("Shop"), false, nullptr, "buysell.xml"),
gcn::ActionListener(),
@@ -84,9 +84,11 @@ void BuySellDialog::init()
add(btn);
x += btn->getWidth() + buttonPadding;
}
- mBuyButton->requestFocus();
-
- setContentSize(x, 2 * y + mBuyButton->getHeight());
+ if (mBuyButton)
+ {
+ mBuyButton->requestFocus();
+ setContentSize(x, 2 * y + mBuyButton->getHeight());
+ }
center();
setDefaultSize();