mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 12:39:55 +00:00
Closes #1060: Fix incorrect message box size
This commit is contained in:
parent
cf378ec31e
commit
358cc3c62f
@ -287,24 +287,6 @@ namespace MWGui
|
|||||||
else {
|
else {
|
||||||
mainWidgetSize.width = textSize.width + 3*textPadding;
|
mainWidgetSize.width = textSize.width + 3*textPadding;
|
||||||
}
|
}
|
||||||
mainWidgetSize.height = textSize.height + 2*textPadding + textButtonPadding + buttonHeight * buttons.size() + buttonMainPadding;
|
|
||||||
|
|
||||||
mMainWidget->setSize(mainWidgetSize);
|
|
||||||
|
|
||||||
MyGUI::IntCoord absCoord;
|
|
||||||
absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2;
|
|
||||||
absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2;
|
|
||||||
|
|
||||||
mMainWidget->setCoord(absCoord);
|
|
||||||
mMainWidget->setSize(mainWidgetSize);
|
|
||||||
|
|
||||||
|
|
||||||
MyGUI::IntCoord messageWidgetCoord;
|
|
||||||
messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
|
|
||||||
messageWidgetCoord.top = textPadding;
|
|
||||||
mMessageWidget->setCoord(messageWidgetCoord);
|
|
||||||
|
|
||||||
mMessageWidget->setSize(textSize);
|
|
||||||
|
|
||||||
MyGUI::IntCoord buttonCord;
|
MyGUI::IntCoord buttonCord;
|
||||||
MyGUI::IntSize buttonSize(0, buttonHeight);
|
MyGUI::IntSize buttonSize(0, buttonHeight);
|
||||||
@ -326,6 +308,21 @@ namespace MWGui
|
|||||||
top += buttonSize.height + 2*buttonTopPadding;
|
top += buttonSize.height + 2*buttonTopPadding;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mainWidgetSize.height = top + buttonMainPadding;
|
||||||
|
mMainWidget->setSize(mainWidgetSize);
|
||||||
|
|
||||||
|
MyGUI::IntPoint absPos;
|
||||||
|
absPos.left = (gameWindowSize.width - mainWidgetSize.width)/2;
|
||||||
|
absPos.top = (gameWindowSize.height - mainWidgetSize.height)/2;
|
||||||
|
|
||||||
|
mMainWidget->setPosition(absPos);
|
||||||
|
|
||||||
|
MyGUI::IntCoord messageWidgetCoord;
|
||||||
|
messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
|
||||||
|
messageWidgetCoord.top = textPadding;
|
||||||
|
messageWidgetCoord.width = textSize.width;
|
||||||
|
messageWidgetCoord.height = textSize.height;
|
||||||
|
mMessageWidget->setCoord(messageWidgetCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set key focus to "Ok" button
|
// Set key focus to "Ok" button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user