forked from mirror/openmw-tes3mp
Dynamically resize skill widgets to fit their contents (Fixes #1610)
This commit is contained in:
parent
1a1f5dfc4a
commit
d5381e1bc4
1 changed files with 5 additions and 0 deletions
|
@ -321,6 +321,11 @@ namespace MWGui
|
||||||
skillValueWidget->_setWidgetState(state);
|
skillValueWidget->_setWidgetState(state);
|
||||||
skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||||
|
|
||||||
|
// resize dynamically according to text size
|
||||||
|
int textWidthPlusMargin = skillValueWidget->getTextSize().width + 12;
|
||||||
|
skillValueWidget->setCoord(coord2.left + coord2.width - textWidthPlusMargin, coord2.top, textWidthPlusMargin, coord2.height);
|
||||||
|
skillNameWidget->setSize(skillNameWidget->getSize() + MyGUI::IntSize(coord2.width - textWidthPlusMargin, 0));
|
||||||
|
|
||||||
mSkillWidgets.push_back(skillNameWidget);
|
mSkillWidgets.push_back(skillNameWidget);
|
||||||
mSkillWidgets.push_back(skillValueWidget);
|
mSkillWidgets.push_back(skillValueWidget);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue