diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-11-11 16:05:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-11-11 16:38:29 +0300 |
commit | 5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77 (patch) | |
tree | 0efeeafab66d3af1876030112fceb579b7aac917 | |
parent | 88961587e6662a858755eb4b4b3172f324b07eae (diff) | |
download | manaverse-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.tar.gz manaverse-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.tar.bz2 manaverse-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.tar.xz manaverse-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.zip |
Fix char create dialog height.
-rw-r--r-- | src/gui/windows/charcreatedialog.cpp | 20 | ||||
-rw-r--r-- | src/gui/windows/charcreatedialog.h | 1 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 9525805d4..e38e1ebae 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -137,6 +137,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, mMaxRace(CharDB::getMaxRace()), mHairStyle(0), mHairColor(0), + mMaxY(0), mSlot(slot), mDefaultGender(Gender::FEMALE), mGender(Gender::UNSPECIFIED), @@ -292,6 +293,7 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, if (mRaceNameLabel) mRaceNameLabel->setPosition(nameX, y); } + mMaxY = y + 29 + getTitlePadding(); updateSliders(); setButtonsPosition(w, h); @@ -556,8 +558,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels, const int w = 480; int h = 350; - const int y = 118 + 29; - + int y = 118 + 29; for (unsigned i = 0, sz = static_cast<unsigned>(labels.size()); i < sz; i++) { @@ -583,13 +584,22 @@ void CharCreateDialog::setAttributes(const StringVect &labels, { mAttributesLeft->setVisible(Visible_false); h = y; - setContentSize(w, h); + } + else + { + h = 290 + mAttributesLeft->getHeight() + getPadding(); } if (serverFeatures->haveCreateCharGender() && y < 160) { - h = 160; - setContentSize(w, h); + if (h < 160) + h = 160; } + if (h < mMaxY) + h = mMaxY; + + h += mCreateButton->getHeight(); + + setContentSize(w, h); setButtonsPosition(w, h); } diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h index 7ecc8a928..aa277607e 100644 --- a/src/gui/windows/charcreatedialog.h +++ b/src/gui/windows/charcreatedialog.h @@ -152,6 +152,7 @@ class CharCreateDialog final : public Window, int mHairStyle; int mHairColor; + int mMaxY; int mSlot; |