summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-11-11 16:05:58 +0300
committerAndrei Karas <akaras@inbox.ru>2015-11-11 16:38:29 +0300
commit5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77 (patch)
tree0efeeafab66d3af1876030112fceb579b7aac917 /src/gui
parent88961587e6662a858755eb4b4b3172f324b07eae (diff)
downloadplus-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.tar.gz
plus-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.tar.bz2
plus-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.tar.xz
plus-5243dd89f5d68a6cc7a463b525b5e7e7bf77bd77.zip
Fix char create dialog height.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/windows/charcreatedialog.cpp20
-rw-r--r--src/gui/windows/charcreatedialog.h1
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;