[Scummvm-git-logs] scummvm master -> e012014c2939fb9b9cf83846cf901f1c69736c67

criezy criezy at scummvm.org
Wed Aug 18 21:39:12 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9f46c9a3ac BASE: Add TTS to version information
e012014c29 GUI: Fix computation of MessageDialog width


Commit: 9f46c9a3acd11f7188a114877f2ffe092cc91a1c
    https://github.com/scummvm/scummvm/commit/9f46c9a3acd11f7188a114877f2ffe092cc91a1c
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-18T22:38:55+01:00

Commit Message:
BASE: Add TTS to version information

Changed paths:
    base/version.cpp


diff --git a/base/version.cpp b/base/version.cpp
index b6e2de0f69..dc36cad638 100644
--- a/base/version.cpp
+++ b/base/version.cpp
@@ -167,6 +167,10 @@ const char *gScummVMFeatures = ""
 	"taskbar "
 #endif
 
+#ifdef USE_TTS
+	"TTS "
+#endif
+
 #ifdef USE_CLOUD
 	"cloud ("
 #ifdef USE_LIBCURL


Commit: e012014c2939fb9b9cf83846cf901f1c69736c67
    https://github.com/scummvm/scummvm/commit/e012014c2939fb9b9cf83846cf901f1c69736c67
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-08-18T22:38:55+01:00

Commit Message:
GUI: Fix computation of MessageDialog width

This was a regression introduced in fea19c69a. The code forgot to
add the margin on either side of the text when computing the width
of the dialog.

I also introduced a variable with the mergin value to clarify the
code (and also make it easy to change that margin in the future if
we want to).

Changed paths:
    gui/message.cpp


diff --git a/gui/message.cpp b/gui/message.cpp
index eb4abaabf3..66ba8e2829 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -58,13 +58,14 @@ void MessageDialog::init(const Common::U32String &message,
 	// the real size of the dialog
 	Common::Array<Common::U32String> lines;
 	int lineCount;
-	int maxlineWidth = g_gui.getFont().wordWrapText(message, screenW - 2 * 20, lines);
+	const int horizontalMargin = 10;
+	int maxlineWidth = g_gui.getFont().wordWrapText(message, screenW - 2 * horizontalMargin - 20, lines);
 	const int buttonCount = altButtons.size() + 1;
 	const int buttonSpacing = 10;
 	const int buttonsTotalWidth = buttonCount * buttonWidth + (buttonCount - 1) * buttonSpacing;
 
 	// Calculate the desired dialog size (maxing out at 300*180 for now)
-	_w = MAX(maxlineWidth, buttonsTotalWidth + 20);
+	_w = MAX(maxlineWidth, buttonsTotalWidth) + 2 * horizontalMargin;
 
 	lineCount = lines.size();
 
@@ -84,7 +85,7 @@ void MessageDialog::init(const Common::U32String &message,
 
 	// 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], alignment);
+		new StaticTextWidget(this, horizontalMargin, 10 + i * kLineHeight, maxlineWidth, kLineHeight, lines[i], alignment);
 	}
 
 	// Assume defaultButton is always given




More information about the Scummvm-git-logs mailing list