summaryrefslogtreecommitdiff
path: root/src/gui/itempopup.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 13:25:04 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-27 13:25:24 +0100
commitdd05447445dc1766e532130318af2cb6bb72a994 (patch)
treec8b2cbac64ccf9545a39c143088b57fe2cb8e678 /src/gui/itempopup.cpp
parent05e753294c1a603252d2eed4b1731c3f50543a7e (diff)
parent2aab736bc5d77ffda789d7de56cef100fac207e1 (diff)
downloadmana-dd05447445dc1766e532130318af2cb6bb72a994.tar.gz
mana-dd05447445dc1766e532130318af2cb6bb72a994.tar.bz2
mana-dd05447445dc1766e532130318af2cb6bb72a994.tar.xz
mana-dd05447445dc1766e532130318af2cb6bb72a994.zip
Merge branch 'aethyra/master'
Conflicts: src/beingmanager.cpp src/gui/confirm_dialog.cpp src/gui/inventorywindow.cpp src/gui/inventorywindow.h src/gui/label.cpp src/gui/label.h src/gui/popup.cpp src/gui/popup.h src/gui/scrollarea.cpp src/gui/skin.cpp src/gui/skin.h src/gui/speechbubble.cpp src/gui/window.cpp src/gui/window.h src/localplayer.h src/main.cpp src/net/ea/playerhandler.cpp src/resources/ambientoverlay.h src/resources/dye.cpp src/resources/imagewriter.cpp src/resources/itemdb.cpp src/shopitem.cpp
Diffstat (limited to 'src/gui/itempopup.cpp')
-rw-r--r--src/gui/itempopup.cpp51
1 files changed, 24 insertions, 27 deletions
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp
index 379e6029..66729605 100644
--- a/src/gui/itempopup.cpp
+++ b/src/gui/itempopup.cpp
@@ -40,7 +40,7 @@
#include "../utils/stringutils.h"
ItemPopup::ItemPopup():
- Popup()
+ Popup("ItemPopup")
{
// Item Name
mItemName = new gcn::Label;
@@ -67,7 +67,8 @@ ItemPopup::ItemPopup():
mItemEffectScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mItemEffectScroll->setDimension(gcn::Rectangle(0, 0, 196, getFont()->getHeight()));
mItemEffectScroll->setOpaque(false);
- mItemEffectScroll->setPosition(2, (2 * getFont()->getHeight()) + 5);
+ mItemEffectScroll->setPosition(2, (2 * getFont()->getHeight()) +
+ (2 * getPadding()));
// Item Weight
mItemWeight = new TextBox;
@@ -78,12 +79,15 @@ ItemPopup::ItemPopup():
mItemWeightScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mItemWeightScroll->setDimension(gcn::Rectangle(0, 0, 196, getFont()->getHeight()));
mItemWeightScroll->setOpaque(false);
- mItemWeightScroll->setPosition(2, (3 * getFont()->getHeight()) + 10);
+ mItemWeightScroll->setPosition(2, (3 * getFont()->getHeight()) +
+ (4 * getPadding()));
add(mItemName);
add(mItemDescScroll);
add(mItemEffectScroll);
add(mItemWeightScroll);
+
+ loadPopupConfiguration();
}
ItemPopup::~ItemPopup()
@@ -124,43 +128,36 @@ void ItemPopup::setItem(const ItemInfo &item)
minWidth += 8;
setWidth(minWidth);
- int numRowsDesc = mItemDesc->getNumberOfRows();
- int numRowsEffect = mItemEffect->getNumberOfRows();
- int numRowsWeight = mItemWeight->getNumberOfRows();
+ const int numRowsDesc = mItemDesc->getNumberOfRows();
+ const int numRowsEffect = mItemEffect->getNumberOfRows();
+ const int numRowsWeight = mItemWeight->getNumberOfRows();
+ const int height = getFont()->getHeight();
- mItemDescScroll->setDimension(gcn::Rectangle(2, 0, minWidth,
- numRowsDesc * getFont()->getHeight()));
+ mItemDescScroll->setDimension(gcn::Rectangle(2, 0, minWidth, numRowsDesc *
+ height));
- mItemEffectScroll->setDimension(gcn::Rectangle(2, 0, minWidth,
- numRowsEffect * getFont()->getHeight()));
+ mItemEffectScroll->setDimension(gcn::Rectangle(2, 0, minWidth, numRowsEffect
+ * height));
- mItemWeightScroll->setDimension(gcn::Rectangle(2, 0, minWidth,
- numRowsWeight * getFont()->getHeight()));
+ mItemWeightScroll->setDimension(gcn::Rectangle(2, 0, minWidth, numRowsWeight
+ * height));
if (item.getEffect().empty())
{
- setContentSize(minWidth, (numRowsDesc * getFont()->getHeight() +
- (3 * getFont()->getHeight())));
+ setContentSize(minWidth, (numRowsDesc + 3) * height);
- mItemWeightScroll->setPosition(2,
- (numRowsDesc * getFont()->getHeight()) +
- (2 * getFont()->getHeight()));
+ mItemWeightScroll->setPosition(2, (numRowsDesc + 2) * height);
}
else
{
- setContentSize(minWidth, (numRowsDesc * getFont()->getHeight()) +
- (numRowsEffect * getFont()->getHeight()) +
- (3 * getFont()->getHeight()));
-
- mItemWeightScroll->setPosition(2,
- (numRowsDesc * getFont()->getHeight()) +
- (numRowsEffect * getFont()->getHeight()) +
- (2 * getFont()->getHeight()));
+ setContentSize(minWidth, (numRowsDesc + numRowsEffect + 3) * height);
+
+ mItemWeightScroll->setPosition(2, (numRowsDesc + numRowsEffect + 2) *
+ height);
}
mItemDescScroll->setPosition(2, 20);
- mItemEffectScroll->setPosition(2, (numRowsDesc * getFont()->getHeight()) +
- (2 * getFont()->getHeight()));
+ mItemEffectScroll->setPosition(2, (numRowsDesc + 2) * height);
}
void ItemPopup::updateColors()