summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-24 20:17:48 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-01-24 20:17:48 +0100
commita201bc68ba8d95b470ca3faeb6f8f0cf17cf24c0 (patch)
treed16b99e9bd01b1c0f0bed8da406ab6b38ebb59d4
parenta18d4dcf1eb9abb9b4ed8060aefd14088ccb9680 (diff)
downloadmana-a201bc68ba8d95b470ca3faeb6f8f0cf17cf24c0.tar.gz
mana-a201bc68ba8d95b470ca3faeb6f8f0cf17cf24c0.tar.bz2
mana-a201bc68ba8d95b470ca3faeb6f8f0cf17cf24c0.tar.xz
mana-a201bc68ba8d95b470ca3faeb6f8f0cf17cf24c0.zip
Fix adjustment of labels and button sizes in trade window
-rw-r--r--src/gui/trade.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 1e58c409..66df55b8 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -128,10 +128,15 @@ void TradeWindow::widgetResized(const gcn::Event &event)
mMoneyField->getX() + mMoneyField->getWidth() + 6,
mMoneyLabel2->getY());
- mCancelButton->setPosition(width - 54, height - 8 - mCancelButton->getHeight());
- mTradeButton->setPosition(mCancelButton->getX() - 41, mCancelButton->getY());
- mOkButton->setPosition(mTradeButton->getX() - 24, mCancelButton->getY());
- mAddButton->setPosition(mOkButton->getX() - 31, mCancelButton->getY());
+ mCancelButton->setPosition(width - 8 - mCancelButton->getWidth(),
+ height - 8 - mCancelButton->getHeight());
+ mTradeButton->setPosition(
+ mCancelButton->getX() - 4 - mTradeButton->getWidth(),
+ mCancelButton->getY());
+ mOkButton->setPosition(mTradeButton->getX() - 4 - mOkButton->getWidth(),
+ mCancelButton->getY());
+ mAddButton->setPosition(mOkButton->getX() - 4 - mAddButton->getWidth(),
+ mCancelButton->getY());
mItemDescriptionLabel->setPosition(8,
mOkButton->getY() - mItemDescriptionLabel->getHeight() - 4);
@@ -263,8 +268,10 @@ void TradeWindow::valueChanged(const gcn::SelectionEvent &event)
ItemInfo const *info = item ? &item->getInfo() : NULL;
mItemNameLabel->setCaption(strprintf(_("Name: %s"),
info ? info->getName().c_str() : ""));
+ mItemNameLabel->adjustSize();
mItemDescriptionLabel->setCaption(strprintf(_("Description: %s"),
info ? info->getDescription().c_str() : ""));
+ mItemDescriptionLabel->adjustSize();
}
void TradeWindow::action(const gcn::ActionEvent &event)