aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/TabWidget.cpp34
-rw-r--r--gui/options.cpp4
-rw-r--r--gui/saveload.cpp27
3 files changed, 44 insertions, 21 deletions
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp
index 9b77b2f00c..3eb45297f3 100644
--- a/gui/TabWidget.cpp
+++ b/gui/TabWidget.cpp
@@ -91,7 +91,37 @@ int TabWidget::addTab(const String &title) {
int numTabs = _tabs.size();
+ // HACK: Nintendo DS uses a custom config dialog. This dialog does not work with
+ // our default "Globals.TabWidget.Tab.Width" setting.
+ //
+ // TODO: Add proper handling in the theme layout for such cases.
+ //
+ // There are different solutions to this problem:
+ // - offer a "Tab.Width" setting per tab widget and thus let the Ninteno DS
+ // backend set a default value for its special dialog.
+ //
+ // - change our themes to use auto width calculaction by default
+ //
+ // - change "Globals.TabWidget.Tab.Width" to be the minimal tab width setting and
+ // rename it accordingly.
+ // Actually this solution is pretty similar to our HACK for the Nintendo DS
+ // backend. This hack enables auto width calculation by default with the
+ // "Globals.TabWidget.Tab.Width" value as minimal width for the tab buttons.
+ //
+ // - we might also consider letting every tab button having its own width.
+ //
+ // - other solutions you can think of, which are hopefully less evil ;-).
+ //
+ // Of course also the Ninteno DS' dialog should be in our layouting engine, instead
+ // of being hard coded like it is right now.
+ //
+ // There are checks for __DS__ all over this source file to take care of the
+ // aforemnetioned problem.
+#ifdef __DS__
+ if (true) {
+#else
if (g_gui.xmlEval()->getVar("Globals.TabWidget.Tab.Width") == 0) {
+#endif
if (_tabWidth == 0)
_tabWidth = 40;
// Determine the new tab width
@@ -217,6 +247,10 @@ void TabWidget::reflowLayout() {
if (_tabWidth == 0) {
_tabWidth = 40;
+#ifdef __DS__
+ }
+ if (true) {
+#endif
int maxWidth = _w / _tabs.size();
for (uint i = 0; i < _tabs.size(); ++i) {
diff --git a/gui/options.cpp b/gui/options.cpp
index e941cd6244..a0e1f0d9fe 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -744,10 +744,10 @@ int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
}
void OptionsDialog::reflowLayout() {
- Dialog::reflowLayout();
-
if (_graphicsTabId != -1 && _tabWidget)
_tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
+
+ Dialog::reflowLayout();
}
#pragma mark -
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index f859c706fb..ce700c181e 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -235,6 +235,11 @@ void SaveLoadChooser::updateSelection(bool redraw) {
bool isWriteProtected = false;
bool startEditMode = _list->isEditable();
+ _gfxWidget->setGfx(-1, -1, _fillR, _fillG, _fillB);
+ _date->setLabel("No date saved");
+ _time->setLabel("No time saved");
+ _playtime->setLabel("No playtime saved");
+
if (selItem >= 0 && !_list->getSelectedString().empty() && _metaInfoSupport) {
SaveStateDescriptor desc = (*_plugin)->querySaveMetaInfos(_target.c_str(), atoi(_saveList[selItem].save_slot().c_str()));
@@ -250,36 +255,20 @@ void SaveLoadChooser::updateSelection(bool redraw) {
if (thumb) {
_gfxWidget->setGfx(thumb);
_gfxWidget->useAlpha(256);
- } else {
- _gfxWidget->setGfx(-1, -1, _fillR, _fillG, _fillB);
}
}
if (_saveDateSupport) {
- Common::String date = "Date: ";
if (desc.contains("save_date"))
- date += desc.getVal("save_date");
- else
- date = "No date saved";
+ _date->setLabel("Date: " + desc.getVal("save_date"));
- Common::String time = "Time: ";
if (desc.contains("save_time"))
- time += desc.getVal("save_time");
- else
- time = "No time saved";
-
- _date->setLabel(date);
- _time->setLabel(time);
+ _time->setLabel("Time: " + desc.getVal("save_time"));
}
if (_playTimeSupport) {
- Common::String time = "Playtime: ";
if (desc.contains("play_time"))
- time += desc.getVal("play_time");
- else
- time = "No playtime saved";
-
- _playtime->setLabel(time);
+ _playtime->setLabel("Playtime: " + desc.getVal("play_time"));
}
}