aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeLayout.cpp2
-rw-r--r--gui/editgamedialog.cpp4
-rw-r--r--gui/saveload-dialog.cpp20
-rw-r--r--gui/saveload-dialog.h1
4 files changed, 21 insertions, 6 deletions
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 10347f0ab9..618ecdc1e3 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -298,6 +298,7 @@ void ThemeLayoutStacked::reflowLayoutVertical(Widget *widgetChain) {
for (uint i = 0; i < _children.size(); ++i) {
switch (_itemAlign) {
case kItemAlignStart:
+ default:
_children[i]->offsetX(_padding.left);
break;
case kItemAlignCenter:
@@ -385,6 +386,7 @@ void ThemeLayoutStacked::reflowLayoutHorizontal(Widget *widgetChain) {
for (uint i = 0; i < _children.size(); ++i) {
switch (_itemAlign) {
case kItemAlignStart:
+ default:
_children[i]->offsetY(_padding.top);
break;
case kItemAlignCenter:
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index 60feac15d6..449bcc542f 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -341,14 +341,12 @@ void EditGameDialog::open() {
ConfMan.hasKey("speech_volume", _domain);
_globalVolumeOverride->setState(e);
- if (!_guioptions.contains(GUIO_NOMIDI)) {
+ if (!_guioptions.contains(GUIO_NOMIDI) && !_guioptions.contains(GUIO_NOMUSIC)) {
e = ConfMan.hasKey("soundfont", _domain) ||
ConfMan.hasKey("multi_midi", _domain) ||
ConfMan.hasKey("midi_gain", _domain);
_globalMIDIOverride->setState(e);
- }
- if (!_guioptions.contains(GUIO_NOMIDI)) {
e = ConfMan.hasKey("native_mt32", _domain) ||
ConfMan.hasKey("enable_gs", _domain);
_globalMT32Override->setState(e);
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index cca3a4d5b8..d300e91bda 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -372,7 +372,8 @@ enum {
};
SaveLoadChooserSimple::SaveLoadChooserSimple(const String &title, const String &buttonLabel, bool saveMode)
- : SaveLoadChooserDialog("SaveLoadChooser", saveMode), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
+ : SaveLoadChooserDialog("SaveLoadChooser", saveMode), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0),
+ _container(0) {
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
new StaticTextWidget(this, "SaveLoadChooser.Title", title);
@@ -398,7 +399,18 @@ SaveLoadChooserSimple::SaveLoadChooserSimple(const String &title, const String &
_delSupport = _metaInfoSupport = _thumbnailSupport = false;
- _container = new ContainerWidget(this, "SaveLoadChooser.Thumbnail");
+ addThumbnailContainer();
+}
+
+void SaveLoadChooserSimple::addThumbnailContainer() {
+ // When switching layouts, create / remove the thumbnail container as needed
+ if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 1 && !_container) {
+ _container = new ContainerWidget(this, "SaveLoadChooser.Thumbnail");
+ } else if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 0 && _container) {
+ removeWidget(_container);
+ delete _container;
+ _container = nullptr;
+ }
}
int SaveLoadChooserSimple::runIntern() {
@@ -471,6 +483,8 @@ void SaveLoadChooserSimple::handleCommand(CommandSender *sender, uint32 cmd, uin
}
void SaveLoadChooserSimple::reflowLayout() {
+ addThumbnailContainer();
+
SaveLoadChooserDialog::reflowLayout();
if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 1 && (_thumbnailSupport || _saveDateSupport || _playTimeSupport)) {
@@ -531,7 +545,7 @@ void SaveLoadChooserSimple::reflowLayout() {
updateSelection(false);
} else {
- _container->setVisible(false);
+ if (_container) _container->setVisible(false);
_gfxWidget->setVisible(false);
_date->setVisible(false);
_time->setVisible(false);
diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h
index 43721aa270..b4820ff56e 100644
--- a/gui/saveload-dialog.h
+++ b/gui/saveload-dialog.h
@@ -164,6 +164,7 @@ private:
String _resultString;
+ void addThumbnailContainer();
void updateSelection(bool redraw);
};