mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-20 19:21:46 +00:00
GUI: add optional 'alignment' parameter to 'MessageDialog'
This commit is contained in:
parent
aca4ff425c
commit
f3082a5588
@ -35,9 +35,10 @@ enum {
|
||||
};
|
||||
|
||||
|
||||
|
||||
// TODO: The default button should be visibly distinct from the alternate button
|
||||
|
||||
MessageDialog::MessageDialog(const Common::String &message, const char *defaultButton, const char *altButton)
|
||||
MessageDialog::MessageDialog(const Common::String &message, const char *defaultButton, const char *altButton, Graphics::TextAlign alignment)
|
||||
: Dialog(30, 20, 260, 124) {
|
||||
|
||||
const int screenW = g_system->getOverlayWidth();
|
||||
@ -79,7 +80,7 @@ MessageDialog::MessageDialog(const Common::String &message, const char *defaultB
|
||||
// Each line is represented by one static text item.
|
||||
for (int i = 0; i < lineCount; i++) {
|
||||
new StaticTextWidget(this, 10, 10 + i * kLineHeight, maxlineWidth, kLineHeight,
|
||||
lines[i], Graphics::kTextAlignCenter);
|
||||
lines[i], alignment);
|
||||
}
|
||||
|
||||
if (defaultButton && altButton) {
|
||||
|
@ -41,7 +41,7 @@ enum {
|
||||
*/
|
||||
class MessageDialog : public Dialog {
|
||||
public:
|
||||
MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = nullptr);
|
||||
MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = nullptr, Graphics::TextAlign alignment = Graphics::kTextAlignCenter);
|
||||
|
||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user