diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-07-26 22:20:07 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-07-26 22:23:15 +0200 |
commit | 2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118 (patch) | |
tree | 8e25c930ce9742b919b90f583d37445c1a81fa1d /src/gui/itempopup.cpp | |
parent | 8331284990b8d998a7e323e6fcf3c25f2f7d60d8 (diff) | |
download | mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.tar.gz mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.tar.bz2 mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.tar.xz mana-2fc4e340c82e9e9a6a7b724e6f2411e37d7a1118.zip |
Fixed the dimensions of the popup/tooltip
Diffstat (limited to 'src/gui/itempopup.cpp')
-rw-r--r-- | src/gui/itempopup.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gui/itempopup.cpp b/src/gui/itempopup.cpp index c09a0504..116d29d4 100644 --- a/src/gui/itempopup.cpp +++ b/src/gui/itempopup.cpp @@ -88,7 +88,6 @@ ItemPopup::ItemPopup(): // Item Name mItemName = new Label; mItemName->setFont(boldFont); - mItemName->setPosition(getPadding(), getPadding()); // Item Description mItemDesc = new TextBox; @@ -143,12 +142,12 @@ void ItemPopup::setNoItem() mItemName->adjustSize(); mItemName->setForegroundColor(Theme::getThemeColor(Theme::GENERIC)); - mItemName->setPosition(getPadding(), getPadding()); + mItemName->setPosition(0, 0); mItemDesc->setText(std::string()); mItemEffect->setText(std::string()); - setContentSize(mItemName->getWidth() + 2 * getPadding(), 0); + setContentSize(mItemName->getWidth(), 0); } void ItemPopup::setItem(const ItemInfo &item, bool showImage) @@ -171,12 +170,7 @@ void ItemPopup::setItem(const ItemInfo &item, bool showImage) mIcon->setImage(image); if (image) - { - int x = getPadding(); - int y = getPadding(); - mIcon->setPosition(x, y); space = mIcon->getWidth(); - } } else { @@ -192,7 +186,7 @@ void ItemPopup::setItem(const ItemInfo &item, bool showImage) mItemName->setCaption(caption); mItemName->adjustSize(); mItemName->setForegroundColor(getColorFromItemType(mItemType)); - mItemName->setPosition(getPadding() + space, getPadding()); + mItemName->setPosition(space, 0); mItemDesc->setTextWrapped(item.getDescription(), ITEMPOPUP_WRAP_WIDTH); { @@ -235,7 +229,7 @@ void ItemPopup::setItem(const ItemInfo &item, bool showImage) setContentSize(minWidth, nameHeight + (numRowsDesc + numRowsWeight + 1) * fontHeight); - mItemWeight->setPosition(getPadding(), + mItemWeight->setPosition(0, nameHeight + (numRowsDesc + 1) * fontHeight); } else @@ -243,12 +237,12 @@ void ItemPopup::setItem(const ItemInfo &item, bool showImage) setContentSize(minWidth, nameHeight + (numRowsDesc + numRowsEffect + numRowsWeight + 1) * fontHeight); - mItemWeight->setPosition(getPadding(), nameHeight + (numRowsDesc + + mItemWeight->setPosition(0, nameHeight + (numRowsDesc + numRowsEffect + 1) * fontHeight); } - mItemDesc->setPosition(getPadding(), nameHeight); - mItemEffect->setPosition(getPadding(), nameHeight + + mItemDesc->setPosition(0, nameHeight); + mItemEffect->setPosition(0, nameHeight + (numRowsDesc + 1) * fontHeight); } |