[Scummvm-git-logs] scummvm branch-2-8 -> 6885d67a0628bf2725cdaff0e1bf92c4623d02e0
sev-
noreply at scummvm.org
Thu Dec 14 16:17:25 UTC 2023
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
88430218b0 MACOSX: Fix bundle ID for generated bundle and dock plugin
3e2b2c33ff GUI: Refactored HelpDialog to let easy extension
ab1aeb7da9 GUI: Fix layout for HelpDialog tab content
8806184f99 GUI: Add inner margin in RichTextWidget
229cdd247b GUI: Bump theme version and regenerate themes
6885d67a06 GUI: Fix resizing RichTextWidget
Commit: 88430218b03972e3ca33e061a50827105f6144ea
https://github.com/scummvm/scummvm/commit/88430218b03972e3ca33e061a50827105f6144ea
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-12-14T16:59:40+01:00
Commit Message:
MACOSX: Fix bundle ID for generated bundle and dock plugin
Changed paths:
backends/taskbar/macosx/dockplugin/dockplugin.m
dists/macosx/dockplugin/Info.plist
dists/macosx/dockplugin/Info.plist.in
ports.mk
diff --git a/backends/taskbar/macosx/dockplugin/dockplugin.m b/backends/taskbar/macosx/dockplugin/dockplugin.m
index 25028bc7aa5..ae7563dc2c8 100644
--- a/backends/taskbar/macosx/dockplugin/dockplugin.m
+++ b/backends/taskbar/macosx/dockplugin/dockplugin.m
@@ -54,8 +54,8 @@
- (NSMenu*)dockMenu {
// Get the list or recent games
- CFPreferencesAppSynchronize(CFSTR("org.scummvm.scummvm"));
- NSArray *array = CFPreferencesCopyAppValue(CFSTR("recentGames"), CFSTR("org.scummvm.scummvm"));
+ CFPreferencesAppSynchronize(CFSTR("org.scummvm.app"));
+ NSArray *array = CFPreferencesCopyAppValue(CFSTR("recentGames"), CFSTR("org.scummvm.app"));
if (array == nil)
return nil;
@@ -109,7 +109,7 @@
- (IBAction) startGame {
NSLog(@"Starting Game %@...", game);
- NSString *scummVMPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"org.scummvm.scummvm"];
+ NSString *scummVMPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"org.scummvm.app"];
if (scummVMPath == nil) {
NSLog(@"Cannot find ScummVM.app!");
return;
diff --git a/dists/macosx/dockplugin/Info.plist b/dists/macosx/dockplugin/Info.plist
index 8c76b12bbba..209c2fa6167 100644
--- a/dists/macosx/dockplugin/Info.plist
+++ b/dists/macosx/dockplugin/Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleIdentifier</key>
- <string>org.scummvm.scummvm.DockTilePlugin</string>
+ <string>org.scummvm.app.DockTilePlugin</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
diff --git a/dists/macosx/dockplugin/Info.plist.in b/dists/macosx/dockplugin/Info.plist.in
index 2dbb2a20d27..991eb0d0263 100644
--- a/dists/macosx/dockplugin/Info.plist.in
+++ b/dists/macosx/dockplugin/Info.plist.in
@@ -9,7 +9,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleIdentifier</key>
- <string>org.scummvm.scummvm.DockTilePlugin</string>
+ <string>org.scummvm.app.DockTilePlugin</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
diff --git a/ports.mk b/ports.mk
index faef1752519..085090c4313 100644
--- a/ports.mk
+++ b/ports.mk
@@ -140,7 +140,7 @@ bundle-pack:
mkdir -p $(bundle_name)/Contents/MacOS
mkdir -p $(bundle_name)/Contents/Resources
echo "APPL????" > $(bundle_name)/Contents/PkgInfo
- sed -e 's/$$(PRODUCT_BUNDLE_IDENTIFIER)/org.scummvm.scummvm/' $(srcdir)/dists/macosx/Info.plist >$(bundle_name)/Contents/Info.plist
+ sed -e 's/$$(PRODUCT_BUNDLE_IDENTIFIER)/org.scummvm.app/' $(srcdir)/dists/macosx/Info.plist >$(bundle_name)/Contents/Info.plist
ifdef USE_SPARKLE
mkdir -p $(bundle_name)/Contents/Frameworks
cp $(srcdir)/dists/macosx/dsa_pub.pem $(bundle_name)/Contents/Resources/
Commit: 3e2b2c33ffd37215d0e9360e79005a9472bdc4bd
https://github.com/scummvm/scummvm/commit/3e2b2c33ffd37215d0e9360e79005a9472bdc4bd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-12-14T17:15:44+01:00
Commit Message:
GUI: Refactored HelpDialog to let easy extension
Changed paths:
gui/helpdialog.cpp
gui/helpdialog.h
diff --git a/gui/helpdialog.cpp b/gui/helpdialog.cpp
index ed7727aabc1..5164454e835 100644
--- a/gui/helpdialog.cpp
+++ b/gui/helpdialog.cpp
@@ -32,10 +32,12 @@ namespace GUI {
HelpDialog::HelpDialog()
: Dialog("HelpDialog") {
- TabWidget *tab = new TabWidget(this, "HelpDialog.TabWidget");
+ _tab = new TabWidget(this, "HelpDialog.TabWidget");
- tab->addTab(_("General"), "HelpDialog", false);
- Common::U32String helpText1 = _(
+static const char * const helpTabs[] = {
+_s("General"),
+"",
+_s(
"## Where to get the games\n"
"\n"
"Visit [our Wiki](https://wiki.scummvm.org/index.php?title=Where_to_get_the_games) for a list of supported games and where they can be purchased.\n"
@@ -51,38 +53,43 @@ HelpDialog::HelpDialog()
"\n"
"For other (out of print) games, try Amazon, eBay, Game Trading Zone or other auction "
"sites. Beware of faulty games and illegal game copies.\n"
- );
+),
- new RichTextWidget(tab, "HelpDialog.TabWidget", helpText1);
+0,
+ };
+ addTabs(helpTabs);
// Now add backend-specific tabs if any
const char * const *backendTabs = g_system->buildHelpDialogData();
- if (backendTabs) {
- while (*backendTabs) {
- Common::U32String tabName(_(*backendTabs++));
- const char *imagePack = nullptr;
+ if (backendTabs)
+ addTabs(backendTabs);
- if (*backendTabs && **backendTabs)
- imagePack = *backendTabs;
+ _tab->setActiveTab(0);
- backendTabs++;
+ new ButtonWidget(this, "HelpDialog.Close", Common::U32String("Close"), Common::U32String(), kCloseCmd);
+}
- Common::U32String tabText(_(*backendTabs++));
+void HelpDialog::addTabs(const char * const *tabData) {
+ while (*tabData) {
+ Common::U32String tabName(_(*tabData++));
+ const char *imagePack = nullptr;
- tab->addTab(tabName, "HelpDialog", false);
+ if (*tabData && **tabData)
+ imagePack = *tabData;
- RichTextWidget *rt = new RichTextWidget(tab, "HelpDialog.TabWidget", tabText);
+ tabData++;
- if (imagePack)
- rt->setImageArchive(imagePack);
- }
- }
+ Common::U32String tabText(_(*tabData++));
- tab->setActiveTab(0);
+ _tab->addTab(tabName, "HelpDialog", false);
- new ButtonWidget(this, "HelpDialog.Close", Common::U32String("Close"), Common::U32String(), kCloseCmd);
+ RichTextWidget *rt = new RichTextWidget(_tab, "HelpDialog.TabWidget", tabText);
+
+ if (imagePack)
+ rt->setImageArchive(imagePack);
+ }
}
void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
diff --git a/gui/helpdialog.h b/gui/helpdialog.h
index cdf0786cfd5..59ed5208ffb 100644
--- a/gui/helpdialog.h
+++ b/gui/helpdialog.h
@@ -29,7 +29,7 @@
namespace GUI {
class CommandSender;
-class StaticTextWidget;
+class TabWidget;
/**
* Multitab help dialog
@@ -39,6 +39,10 @@ public:
HelpDialog();
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
+
+private:
+ void addTabs(const char * const *tabs);
+ TabWidget *_tab;
};
Commit: ab1aeb7da9be2c71942cf73cd7749e3009ca5c94
https://github.com/scummvm/scummvm/commit/ab1aeb7da9be2c71942cf73cd7749e3009ca5c94
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-12-14T17:16:46+01:00
Commit Message:
GUI: Fix layout for HelpDialog tab content
No specific layout was defined for the rich text widget. It tried
to use the layout of the tab widget, but that did not work properly.
The rich text widget was at the correct location, but did not have
the correct size. It was bigger than the parent tab widget, which
can be clearly seen when the scrollbar is visible.
Changed paths:
gui/helpdialog.cpp
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
diff --git a/gui/helpdialog.cpp b/gui/helpdialog.cpp
index 5164454e835..7e14fcd27ea 100644
--- a/gui/helpdialog.cpp
+++ b/gui/helpdialog.cpp
@@ -83,9 +83,9 @@ void HelpDialog::addTabs(const char * const *tabData) {
Common::U32String tabText(_(*tabData++));
- _tab->addTab(tabName, "HelpDialog", false);
+ _tab->addTab(tabName, "HelpContentDialog", false);
- RichTextWidget *rt = new RichTextWidget(_tab, "HelpDialog.TabWidget", tabText);
+ RichTextWidget *rt = new RichTextWidget(_tab, "HelpContentDialog.RichTextWidget", tabText);
if (imagePack)
rt->setImageArchive(imagePack);
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 4d73f046fee..58793113d25 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -461,6 +461,12 @@
</layout>
</dialog>
+ <dialog name = 'HelpContentDialog' overlays = 'Dialog.HelpDialog.TabWidget'>
+ <layout type = 'vertical' padding = '0, 0, 0, 0'>
+ <widget name = 'RichTextWidget'/>
+ </layout>
+ </dialog>
+
<dialog name = 'Browser' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8'>
<widget name = 'Headline'
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 6c8a2521355..5110cc3ae98 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -320,6 +320,12 @@
</layout>
</dialog>
+ <dialog name = 'HelpContentDialog' overlays = 'Dialog.HelpDialog.TabWidget'>
+ <layout type = 'vertical' padding = '0, 0, 0, 0'>
+ <widget name = 'RichTextWidget'/>
+ </layout>
+ </dialog>
+
<dialog name = 'Browser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 0, 4'>
<widget name = 'Headline'
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 5160cf87460..4031898239f 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1622,6 +1622,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
+"<dialog name = 'HelpContentDialog' overlays = 'Dialog.HelpDialog.TabWidget'>"
+"<layout type = 'vertical' padding = '0, 0, 0, 0'>"
+"<widget name = 'RichTextWidget'/>"
+"</layout>"
+"</dialog>"
"<dialog name='Browser' overlays='Dialog.Launcher.GameList' shading='dim'>"
"<layout type='vertical' padding='8,8,8,8'>"
"<widget name='Headline' "
@@ -3756,6 +3761,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
+"<dialog name = 'HelpContentDialog' overlays = 'Dialog.HelpDialog.TabWidget'>"
+"<layout type = 'vertical' padding = '0, 0, 0, 0'>"
+"<widget name = 'RichTextWidget'/>"
+"</layout>"
+"</dialog>"
"<dialog name='Browser' overlays='screen' inset='8' shading='dim'>"
"<layout type='vertical' padding='8,8,0,4'>"
"<widget name='Headline' "
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 160aea12765..0695908d9df 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -219,6 +219,12 @@
</layout>
</dialog>
+ <dialog name = 'HelpContentDialog' overlays = 'Dialog.HelpDialog.TabWidget'>
+ <layout type = 'vertical' padding = '0, 0, 0, 0'>
+ <widget name = 'RichTextWidget'/>
+ </layout>
+ </dialog>
+
<dialog name = 'Browser' overlays = 'Dialog.Launcher.GameList' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8'>
<widget name = 'Headline'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index f81c7037a09..cce0625fbaa 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -227,6 +227,12 @@
</layout>
</dialog>
+ <dialog name = 'HelpContentDialog' overlays = 'Dialog.HelpDialog.TabWidget'>
+ <layout type = 'vertical' padding = '0, 0, 0, 0'>
+ <widget name = 'RichTextWidget'/>
+ </layout>
+ </dialog>
+
<dialog name = 'Browser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 0, 4'>
<widget name = 'Headline'
Commit: 8806184f99d6b1bb2d0b3fcb802193ba06a17826
https://github.com/scummvm/scummvm/commit/8806184f99d6b1bb2d0b3fcb802193ba06a17826
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-12-14T17:16:56+01:00
Commit Message:
GUI: Add inner margin in RichTextWidget
Changed paths:
gui/themes/common/highres_layout.stx
gui/themes/common/lowres_layout.stx
gui/themes/default.inc
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/widgets/richtext.cpp
gui/widgets/richtext.h
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 58793113d25..ac78647fc7a 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -33,6 +33,8 @@
<def var = 'TabWidget.TitleSpacing' value = '10' scalable = 'yes'/>
+ <def var = 'RichTextWidget.InnerMargin' value = '10' scalable = 'yes'/>
+
<def var = 'Layout.Spacing' value = '4' scalable = 'yes'/>
<def var = 'ListWidget.hlLeftPadding' value = '0'/>
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 5110cc3ae98..acc39fdfb23 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -28,6 +28,8 @@
<def var = 'TabWidget.TitleSpacing' value = '10' scalable = 'yes'/>
+ <def var = 'RichTextWidget.InnerMargin' value = '10' scalable = 'yes'/>
+
<def var = 'Layout.Spacing' value = '4' scalable = 'yes'/>
<def var = 'ShowLauncherLogo' value = '0'/>
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 4031898239f..dca70e64a8b 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1446,6 +1446,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<def var='Font.Height' value='12' scalable='yes'/>"
"<def var='About.OuterBorder' value='80' scalable='yes'/>"
"<def var='TabWidget.TitleSpacing' value='10' scalable='yes'/>"
+"<def var = 'RichTextWidget.InnerMargin' value = '10' scalable = 'yes'/>"
"<def var='Layout.Spacing' value='8' scalable='yes'/>"
"<def var='ShowLauncherLogo' value='0'/>"
"<def var='ShowGlobalMenuLogo' value='0'/>"
@@ -3577,6 +3578,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<def var='Font.Height' value='10' scalable='yes'/>"
"<def var='About.OuterBorder' value='10' scalable='yes'/>"
"<def var='TabWidget.TitleSpacing' value='10' scalable='yes'/>"
+"<def var = 'RichTextWidget.InnerMargin' value = '10' scalable = 'yes'/>"
"<def var='Layout.Spacing' value='8' scalable='yes'/>"
"<def var='ShowLauncherLogo' value='0'/>"
"<def var='ShowGlobalMenuLogo' value='0'/>"
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 0695908d9df..843f0d7540e 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -28,6 +28,8 @@
<def var = 'TabWidget.TitleSpacing' value = '10' scalable = 'yes'/>
+ <def var = 'RichTextWidget.InnerMargin' value = '10' scalable = 'yes'/>
+
<def var = 'Layout.Spacing' value = '8' scalable = 'yes'/>
<def var = 'ShowLauncherLogo' value = '0'/>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index cce0625fbaa..b04c2a9c38c 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -28,6 +28,8 @@
<def var = 'TabWidget.TitleSpacing' value = '10' scalable = 'yes'/>
+ <def var = 'RichTextWidget.InnerMargin' value = '10' scalable = 'yes'/>
+
<def var = 'Layout.Spacing' value = '8' scalable = 'yes'/>
<def var = 'ShowLauncherLogo' value = '0'/>
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index a3fd36985f9..b19e375f9c9 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -59,14 +59,16 @@ void RichTextWidget::init() {
_type = kRichTextWidget;
- _verticalScroll = new ScrollBarWidget(this, _w, 0, 16, _h);
+ _verticalScroll = new ScrollBarWidget(this, _w - 16, 0, 16, _h);
_verticalScroll->setTarget(this);
_scrolledX = 0;
_scrolledY = 0;
+ _innerMargin = g_gui.xmlEval()->getVar("Globals.RichTextWidget.InnerMargin", 0);
_scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
- _textWidth = _w - _scrollbarWidth - _x;
+ _textWidth = MAX(1, _w - _scrollbarWidth - 2 * _innerMargin);
+ _textHeight = MAX(1, _h - 2 * _innerMargin);
_limitH = 140;
}
@@ -99,7 +101,7 @@ void RichTextWidget::handleMouseUp(int x, int y, int button, int clickCount) {
_mouseDownY = _mouseDownStartY = 0;
- Common::String link = _txtWnd->getMouseLink(x + _x + _scrolledX, y + _y + _scrolledY).encode();
+ Common::String link = _txtWnd->getMouseLink(x - _innerMargin + _scrolledX, y - _innerMargin + _scrolledY).encode();
if (link.hasPrefixIgnoreCase("http"))
g_system->openUrl(link);
@@ -125,7 +127,7 @@ void RichTextWidget::handleMouseMoved(int x, int y, int button) {
}
void RichTextWidget::handleTooltipUpdate(int x, int y) {
- _tooltip = _txtWnd->getMouseLink(x + _x + _scrolledX, y + _y + _scrolledY);
+ _tooltip = _txtWnd->getMouseLink(x - _innerMargin + _scrolledX, y - _innerMargin + _scrolledY);
}
void RichTextWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
@@ -142,9 +144,11 @@ void RichTextWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
}
void RichTextWidget::recalc() {
+ _innerMargin = g_gui.xmlEval()->getVar("Globals.RichTextWidget.InnerMargin", 0);
_scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
- _limitH = _h;
- _textWidth = _w - _scrollbarWidth - _x;
+ _textWidth = MAX(1, _w - _scrollbarWidth - 2 * _innerMargin);
+ _textHeight = MAX(1, _h - 2 * _innerMargin);
+ _limitH = _textHeight;
int h = _txtWnd->getTextHeight();
@@ -155,8 +159,8 @@ void RichTextWidget::recalc() {
_verticalScroll->_currentPos = _scrolledY;
_verticalScroll->_entriesPerPage = _limitH;
_verticalScroll->_singleStep = _h / 4;
- _verticalScroll->setPos(_textWidth, 0);
- _verticalScroll->setSize(_scrollbarWidth, _limitH-1);
+ _verticalScroll->setPos(_w - _scrollbarWidth, 0);
+ _verticalScroll->setSize(_scrollbarWidth, _h - 1);
_txtWnd->setMaxWidth(_textWidth);
}
@@ -179,7 +183,7 @@ void RichTextWidget::createWidget() {
_txtWnd->setMarkdownText(_text);
- _surface = new Graphics::ManagedSurface(_w, _h, wm->_pixelformat);
+ _surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
recalc();
}
@@ -204,9 +208,9 @@ void RichTextWidget::drawWidget() {
_surface->clear(g_gui.getWM()->_pixelformat.ARGBToColor(0, 0xff, 0xff, 0xff)); // transparent
- _txtWnd->draw(_surface, 0, _scrolledY, _w - _scrollbarWidth, _h, 0, 0);
+ _txtWnd->draw(_surface, 0, _scrolledY, _textWidth, _textHeight, 0, 0);
- g_gui.theme()->drawManagedSurface(Common::Point(_x, _y), *_surface);
+ g_gui.theme()->drawManagedSurface(Common::Point(_x + _innerMargin, _y + _innerMargin), *_surface);
}
void RichTextWidget::draw() {
@@ -232,7 +236,7 @@ bool RichTextWidget::containsWidget(Widget *w) const {
}
Widget *RichTextWidget::findWidget(int x, int y) {
- if (_verticalScroll->isVisible() && x >= _w - _scrollbarWidth - _x)
+ if (_verticalScroll->isVisible() && x >= _w - _scrollbarWidth)
return _verticalScroll;
return this;
diff --git a/gui/widgets/richtext.h b/gui/widgets/richtext.h
index 6df09ffb8f4..6a3888f7301 100644
--- a/gui/widgets/richtext.h
+++ b/gui/widgets/richtext.h
@@ -45,9 +45,11 @@ protected:
int16 _scrolledX, _scrolledY;
int _mouseDownY = 0;
int _mouseDownStartY = 0;
+ int _innerMargin;
int _scrollbarWidth;
uint16 _limitH;
int _textWidth;
+ int _textHeight;
Common::String _imageArchive;
Commit: 229cdd247bfc0dc5f1318ccaa82283984b2a1ea8
https://github.com/scummvm/scummvm/commit/229cdd247bfc0dc5f1318ccaa82283984b2a1ea8
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-12-14T17:17:07+01:00
Commit Message:
GUI: Bump theme version and regenerate themes
Changed paths:
gui/ThemeEngine.h
gui/themes/residualvm.zip
gui/themes/residualvm/THEMERC
gui/themes/scummclassic.zip
gui/themes/scummclassic/THEMERC
gui/themes/scummmodern.zip
gui/themes/scummmodern/THEMERC
gui/themes/scummremastered.zip
gui/themes/scummremastered/THEMERC
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 7a1e1b3a5a7..269e8b09466 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -36,7 +36,7 @@
#include "graphics/pixelformat.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.14"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.15"
class OSystem;
diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 5ff51ab12c1..c607f94367b 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/residualvm/THEMERC b/gui/themes/residualvm/THEMERC
index 5c2edb156c2..a249028486e 100644
--- a/gui/themes/residualvm/THEMERC
+++ b/gui/themes/residualvm/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.14:ResidualVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.15:ResidualVM Modern Theme Remastered:No Author]
%using ../common
%using ../common-svg
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 3f950f54d7f..e1254a27e7c 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index ea4b9f73ff6..43910d47daf 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.9.14:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.9.15:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 2954891d18f..0aba5e53e83 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 5318e123d5f..a61788da058 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1,2 +1,2 @@
-[SCUMMVM_STX0.9.14:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.9.15:ScummVM Modern Theme:No Author]
%using ../common
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index 401551369e2..79bae579190 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index 4e750345b70..b973a46c7da 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.14:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.15:ScummVM Modern Theme Remastered:No Author]
%using ../common
%using ../common-svg
Commit: 6885d67a0628bf2725cdaff0e1bf92c4623d02e0
https://github.com/scummvm/scummvm/commit/6885d67a0628bf2725cdaff0e1bf92c4623d02e0
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-12-14T17:17:17+01:00
Commit Message:
GUI: Fix resizing RichTextWidget
There were two main issues:
1. The intermediate surface on which the rich text is drawn was not
resized when the widget was resized. This resulted in text being
cut.
2. The Graphics::MacText does not properly handle width changes,
Resize is not handled at all if there is a table, but even when
there is no table it can have issues with the font.
As a workaround it is now recreated instead of being resized.
Changed paths:
gui/widgets/richtext.cpp
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index b19e375f9c9..9b11b9d5aeb 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -150,6 +150,23 @@ void RichTextWidget::recalc() {
_textHeight = MAX(1, _h - 2 * _innerMargin);
_limitH = _textHeight;
+ // Workaround: Currently Graphics::MacText::setMaxWidth does not work well.
+ // There is a known limitation that the size is skipped when the text contains table,
+ // and there is also an issue with the font.
+ // So for now we recreate the widget.
+// if (_txtWnd) {
+// _txtWnd->setMaxWidth(_textWidth);
+// if (_surface->w != _textWidth || _surface->h != _textHeight)
+// _surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
+// } else {
+// createWidget();
+// }
+ if (!_surface || _surface->w != _textWidth) {
+ delete _txtWnd;
+ createWidget();
+ } else if (_surface->h != _textHeight)
+ _surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
+
int h = _txtWnd->getTextHeight();
if (h <= _limitH) _scrolledY = 0;
@@ -161,8 +178,6 @@ void RichTextWidget::recalc() {
_verticalScroll->_singleStep = _h / 4;
_verticalScroll->setPos(_w - _scrollbarWidth, 0);
_verticalScroll->setSize(_scrollbarWidth, _h - 1);
-
- _txtWnd->setMaxWidth(_textWidth);
}
void RichTextWidget::createWidget() {
@@ -183,17 +198,15 @@ void RichTextWidget::createWidget() {
_txtWnd->setMarkdownText(_text);
- _surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
-
- recalc();
+ if (_surface)
+ _surface->create(_textWidth, _textHeight, g_gui.getWM()->_pixelformat);
+ else
+ _surface = new Graphics::ManagedSurface(_textWidth, _textHeight, wm->_pixelformat);
}
void RichTextWidget::reflowLayout() {
Widget::reflowLayout();
- if (!_txtWnd)
- createWidget();
-
recalc();
_verticalScroll->setVisible(_verticalScroll->_numEntries > _limitH); //show when there is something to scroll
@@ -202,7 +215,7 @@ void RichTextWidget::reflowLayout() {
void RichTextWidget::drawWidget() {
if (!_txtWnd)
- createWidget();
+ recalc();
g_gui.theme()->drawWidgetBackground(Common::Rect(_x, _y, _x + _w, _y + _h), ThemeEngine::kWidgetBackgroundPlain);
More information about the Scummvm-git-logs
mailing list