mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-31 22:45:33 +00:00
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->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(skillValueWidget);
|
||||
|
||||
|
|
Loading…
Reference in a new issue