diff --git a/backends/keymapper/remap-widget.cpp b/backends/keymapper/remap-widget.cpp index 1f8f5e7000c..46e82f47a44 100644 --- a/backends/keymapper/remap-widget.cpp +++ b/backends/keymapper/remap-widget.cpp @@ -100,6 +100,7 @@ void RemapWidget::reflowActionWidgets() { int keyButtonWidth = g_gui.xmlEval()->getVar("Globals.KeyMapper.ButtonWidth"); int resetButtonWidth = g_gui.xmlEval()->getVar("Globals.KeyMapper.ResetWidth"); int labelWidth = getWidth() - (spacing + keyButtonWidth + spacing); + labelWidth = MAX(0, labelWidth); uint textYOff = (buttonHeight - kLineHeight) / 2; @@ -120,7 +121,8 @@ void RemapWidget::reflowActionWidgets() { KeymapTitleRow keymapTitle = _keymapSeparators[row.keymap]; if (keymapTitle.descriptionText) { - uint descriptionWidth = getWidth() - x - spacing - resetButtonWidth - spacing; + int descriptionWidth = getWidth() - x - spacing - resetButtonWidth - spacing; + descriptionWidth = MAX(0, descriptionWidth); keymapTitle.descriptionText->resize(x, y + textYOff, descriptionWidth, kLineHeight); keymapTitle.resetButton->resize(x + descriptionWidth, y, resetButtonWidth, buttonHeight); diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 14c0cb0c183..6e1f670d97e 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -36,6 +36,7 @@ #include "gui/ThemeEngine.h" #include "gui/ThemeEval.h" #include "gui/widget.h" +#include "gui/widgets/tab.h" #include "graphics/font.h" @@ -55,9 +56,9 @@ protected: public: ConfigDialog(bool subtitleControls); - ~ConfigDialog(); + ~ConfigDialog() override; - virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); + void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) override; }; MainMenuDialog::MainMenuDialog(Engine *engine) @@ -111,14 +112,12 @@ MainMenuDialog::MainMenuDialog(Engine *engine) new GUI::ButtonWidget(this, "GlobalMenu.Quit", _("~Q~uit"), 0, kQuitCmd); _aboutDialog = new GUI::AboutDialog(); - _optionsDialog = new ConfigDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions)); _loadDialog = new GUI::SaveLoadChooser(_("Load game:"), _("Load"), false); _saveDialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); } MainMenuDialog::~MainMenuDialog() { delete _aboutDialog; - delete _optionsDialog; delete _loadDialog; delete _saveDialog; } @@ -134,9 +133,11 @@ void MainMenuDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint3 case kSaveCmd: save(); break; - case kOptionsCmd: - _optionsDialog->runModal(); + case kOptionsCmd: { + ConfigDialog configDialog(_engine->hasFeature(Engine::kSupportsSubtitleOptions)); + configDialog.runModal(); break; + } case kAboutCmd: _aboutDialog->runModal(); break; @@ -283,11 +284,16 @@ enum { ConfigDialog::ConfigDialog(bool subtitleControls) : GUI::OptionsDialog("", "GlobalConfig") { + // GUI: Add tab widget + GUI::TabWidget *tab = new GUI::TabWidget(this, "GlobalConfig.TabWidget"); + + tab->addTab(_("Audio"), "GlobalConfig_Audio"); + // // Sound controllers // - addVolumeControls(this, "GlobalConfig."); + addVolumeControls(tab, "GlobalConfig_Audio."); setVolumeSettingsState(true); // could disable controls by GUI options // @@ -296,10 +302,29 @@ ConfigDialog::ConfigDialog(bool subtitleControls) if (subtitleControls) { // Global talkspeed range of 0-255 - addSubtitleControls(this, "GlobalConfig.", 255); + addSubtitleControls(tab, "GlobalConfig_Audio.", 255); setSubtitleSettingsState(true); // could disable controls by GUI options } + // + // The Keymap tab + // + const Common::String &gameDomain = ConfMan.getActiveDomainName(); + const Plugin *plugin = EngineMan.findPlugin(ConfMan.get("engineid")); + + Common::KeymapArray keymaps; + if (plugin) { + keymaps = plugin->get().initKeymaps(gameDomain.c_str()); + } + + if (!keymaps.empty()) { + tab->addTab(_("Keymaps"), "GlobalConfig_KeyMapper"); + addKeyMapperControls(tab, "GlobalConfig_KeyMapper.", keymaps, gameDomain); + } + + // Activate the first tab + tab->setActiveTab(0); + // // Add the buttons // diff --git a/engines/dialogs.h b/engines/dialogs.h index a38cf2f61ec..941b2555914 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -71,7 +71,6 @@ protected: GUI::ButtonWidget *_helpButton; GUI::Dialog *_aboutDialog; - GUI::Dialog *_optionsDialog; GUI::SaveLoadChooser *_loadDialog; GUI::SaveLoadChooser *_saveDialog; diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h index b550e459d55..208b16260e1 100644 --- a/gui/ThemeEngine.h +++ b/gui/ThemeEngine.h @@ -37,7 +37,7 @@ #include "graphics/pixelformat.h" -#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.33" +#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.34" class OSystem; diff --git a/gui/themes/default.inc b/gui/themes/default.inc index 8e1c12e5cfd..acc7608a0c5 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -2033,8 +2033,27 @@ const char *defaultXML1 = "" "/>" "" "" -"" -"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" "" "" "" @@ -2074,7 +2093,6 @@ const char *defaultXML1 = "" "" "" "" "" @@ -2107,19 +2125,11 @@ const char *defaultXML1 = "" "type='SmallLabel' " "/>" "" -"" -"" -"" -"" -"" -"" "" +"" +"" +"" +"" "" "" "" @@ -3819,7 +3829,26 @@ const char *defaultXML1 = "" "" "" "" -"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" +"" "" "" "" "" "" -"" "" "" "" -"" -"" -"" -"" -"" -"" "" +"" +"" +"" +"" "" "" "" diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip index 93f84841474..48685e6ed2d 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 8f6f4fe443a..7e7c03909e0 100644 --- a/gui/themes/scummclassic/THEMERC +++ b/gui/themes/scummclassic/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.33:ScummVM Classic Theme:No Author] +[SCUMMVM_STX0.8.34:ScummVM Classic Theme:No Author] diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index cca15cc4b38..7f107e71d36 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -1189,8 +1189,28 @@ - - + + + + + + + + + + + + + + + @@ -1231,7 +1251,6 @@ /> @@ -1264,19 +1283,12 @@ type = 'SmallLabel' /> - - - - - - - + + + + + + @@ -1834,17 +1846,15 @@ - + diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 86a77766c9c..7b131f9aae0 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -1200,7 +1200,27 @@ - + + + + + + + + + + + + + + - - - - - - - - + + + + + + diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip index b003e85e1e6..a5459f544c4 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 d040620c288..5fc37c17d58 100644 --- a/gui/themes/scummmodern/THEMERC +++ b/gui/themes/scummmodern/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.33:ScummVM Modern Theme:No Author] +[SCUMMVM_STX0.8.34:ScummVM Modern Theme:No Author] diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 7d1016c9bee..1c00d44082f 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -1202,7 +1202,27 @@ - + + + + + + + + + + + + + + @@ -1244,7 +1264,6 @@ /> @@ -1277,19 +1296,12 @@ type = 'SmallLabel' /> - - - - - - - + + + + + + @@ -1849,17 +1861,15 @@ - + diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 8a058b4c7e1..0b7a74bf73a 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -1198,7 +1198,27 @@ - + + + + + + + + + + + + + + - + - + - - - - - - - + + + + + + diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip index 6f04cb41938..0870ecfafda 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 dbb779fe491..1979c59560d 100644 --- a/gui/themes/scummremastered/THEMERC +++ b/gui/themes/scummremastered/THEMERC @@ -1 +1 @@ -[SCUMMVM_STX0.8.33:ScummVM Modern Theme Remastered:No Author] +[SCUMMVM_STX0.8.34:ScummVM Modern Theme Remastered:No Author] diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx index 009ba139291..76789fb4937 100644 --- a/gui/themes/scummremastered/remastered_layout.stx +++ b/gui/themes/scummremastered/remastered_layout.stx @@ -1202,7 +1202,27 @@ - + + + + + + + + + + + + + + @@ -1244,7 +1264,6 @@ /> @@ -1277,19 +1296,12 @@ type = 'SmallLabel' /> - - - - - - - + + + + + + @@ -1849,17 +1861,15 @@ - + diff --git a/gui/themes/scummremastered/remastered_layout_lowres.stx b/gui/themes/scummremastered/remastered_layout_lowres.stx index 220ad64d889..0f06c3828f9 100644 --- a/gui/themes/scummremastered/remastered_layout_lowres.stx +++ b/gui/themes/scummremastered/remastered_layout_lowres.stx @@ -1198,7 +1198,27 @@ - + + + + + + + + + + + + + + - + - + - - - - - - - + + + + + +