mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Confirmation dialogs size fix
This commit is contained in:
parent
e5a0f89934
commit
df5a43363a
@ -17,19 +17,26 @@ namespace MWGui
|
||||
}
|
||||
|
||||
void ConfirmationDialog::askForConfirmation(const std::string& message, const std::string& confirmMessage, const std::string& cancelMessage)
|
||||
{
|
||||
mCancelButton->setCaptionWithReplacing(cancelMessage);
|
||||
mOkButton->setCaptionWithReplacing(confirmMessage);
|
||||
|
||||
askForConfirmation(message);
|
||||
}
|
||||
|
||||
void ConfirmationDialog::askForConfirmation(const std::string& message)
|
||||
{
|
||||
setVisible(true);
|
||||
|
||||
mMessage->setCaptionWithReplacing(message);
|
||||
|
||||
mCancelButton->setCaptionWithReplacing(cancelMessage);
|
||||
mOkButton->setCaptionWithReplacing(confirmMessage);
|
||||
int height = mMessage->getTextSize().height + 60;
|
||||
|
||||
int height = mMessage->getTextSize().height + 72;
|
||||
int width = mMessage->getTextSize().width + 24;
|
||||
|
||||
mMainWidget->setSize(mMainWidget->getWidth(), height);
|
||||
mMainWidget->setSize(width, height);
|
||||
|
||||
mMessage->setSize(mMessage->getWidth(), mMessage->getTextSize().height+24);
|
||||
mMessage->setSize(mMessage->getWidth(), mMessage->getTextSize().height + 24);
|
||||
|
||||
center();
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ namespace MWGui
|
||||
{
|
||||
public:
|
||||
ConfirmationDialog();
|
||||
void askForConfirmation(const std::string& message, const std::string& confirmMessage="#{sOk}", const std::string& cancelMessage="#{sCancel}");
|
||||
void askForConfirmation(const std::string& message);
|
||||
void askForConfirmation(const std::string& message, const std::string& confirmMessage, const std::string& cancelMessage);
|
||||
virtual void exit();
|
||||
|
||||
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<MyGUI type="Layout">
|
||||
<Widget type="Window" skin="MW_DialogNoTransp" layer="Windows" position="0 0 300 130" align="Center" name="_Main">
|
||||
<Widget type="Window" skin="MW_DialogNoTransp" layer="Windows" position="0 0 360 130" align="Center" name="_Main">
|
||||
<Property key="Visible" value="false"/>
|
||||
|
||||
<Widget type="EditBox" skin="MW_TextEditClient" position="16 8 268 130" name="Message" align="Center Top">
|
||||
<Widget type="EditBox" skin="MW_TextEditClient" position="16 8 338 130" name="Message" align="Center Top">
|
||||
<Property key="FontName" value="Default"/>
|
||||
<Property key="TextAlign" value="Top HCenter"/>
|
||||
<Property key="Static" value="true"/>
|
||||
@ -12,14 +12,14 @@
|
||||
<Property key="MultiLine" value="true"/>
|
||||
</Widget>
|
||||
|
||||
<Widget type="VBox" position="0 89 292 24" align="Right Bottom">
|
||||
<Widget type="VBox" position="0 89 352 24" align="Center Bottom">
|
||||
<Widget type="HBox">
|
||||
<Property key="Spacing" value="8"/>
|
||||
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton" align="Right Bottom">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton" align="Center Bottom">
|
||||
<Property key="Caption" value="#{sYes}"/>
|
||||
</Widget>
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton" align="Right Bottom">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton" align="Center Bottom">
|
||||
<Property key="Caption" value="#{sNo}"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
|
Loading…
Reference in New Issue
Block a user