Misc GFX tweaks.

svn-id: r33883
This commit is contained in:
Vicent Marti 2008-08-14 23:17:41 +00:00
parent 8eaa982c41
commit 8e60e6c558
5 changed files with 19 additions and 5 deletions

View File

@ -85,6 +85,11 @@ public:
* Widgets are always added to the active tab.
*/
void setActiveTab(int tabID);
void setTabTitle(int tabID, const String &title) {
assert(0 <= tabID && tabID < (int)_tabs.size());
_tabs[tabID].title = title;
}
virtual void handleMouseDown(int x, int y, int button, int clickCount);
virtual bool handleKeyDown(Common::KeyState state);

View File

@ -195,7 +195,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
//
// 3) The graphics tab
//
tab->addTab("Graphics");
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
_globalGraphicsOverride = new CheckboxWidget(tab, "GameOptions_Graphics.EnableTabCheckbox", "Override global graphic settings", kCmdGlobalGraphicsOverride, 0);
@ -257,6 +257,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc)
// Activate the first tab
tab->setActiveTab(0);
_tabWidget = tab;
// Add OK & Cancel buttons
new ButtonWidget(this, "GameOptions.Cancel", "Cancel", kCloseCmd, 0);

View File

@ -94,7 +94,7 @@ NewGui::NewGui() : _redrawStatus(kRedrawDisabled),
if (themefile.compareToIgnoreCase("default") == 0)
themefile = "builtin";
if (!themefile.hasSuffix(".zip"))
if (themefile != "builtin" && !themefile.hasSuffix(".zip"))
themefile += ".zip";
loadNewTheme(themefile);

View File

@ -73,12 +73,12 @@ static const int outputRateValues[] = { 0, 22050, 8000, 11025, 44100, 48000, -1
OptionsDialog::OptionsDialog(const String &domain, int x, int y, int w, int h)
: Dialog(x, y, w, h), _domain(domain) {
: Dialog(x, y, w, h), _domain(domain), _graphicsTabId(-1), _tabWidget(0) {
init();
}
OptionsDialog::OptionsDialog(const String &domain, const String &name)
: Dialog(name), _domain(domain) {
: Dialog(name), _domain(domain), _graphicsTabId(-1), _tabWidget(0) {
init();
}
@ -644,6 +644,9 @@ void OptionsDialog::reflowLayout() {
Dialog::reflowLayout();
int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth");
if (_graphicsTabId != -1 && _tabWidget)
_tabWidget->setTabTitle(_graphicsTabId, g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
if (_midiPopUp)
_midiPopUp->changeLabelWidth(labelWidth);
@ -667,7 +670,7 @@ GlobalOptionsDialog::GlobalOptionsDialog()
//
// 1) The graphics tab
//
tab->addTab(g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
_graphicsTabId = tab->addTab(g_system->getOverlayWidth() > 320 ? "Graphics" : "GFX");
addGraphicControls(tab, "GlobalOptions_Graphics.");
//
@ -735,6 +738,7 @@ GlobalOptionsDialog::GlobalOptionsDialog()
// Activate the first tab
tab->setActiveTab(0);
_tabWidget = tab;
// Add OK & Cancel buttons
new ButtonWidget(this, "GlobalOptions.Cancel", "Cancel", kCloseCmd, 0);

View File

@ -26,6 +26,7 @@
#define OPTIONS_DIALOG_H
#include "gui/dialog.h"
#include "gui/TabWidget.h"
#include "common/str.h"
#ifdef SMALL_SCREEN_DEVICE
@ -80,6 +81,9 @@ protected:
void setMIDISettingsState(bool enabled);
void setVolumeSettingsState(bool enabled);
void setSubtitleSettingsState(bool enabled);
TabWidget *_tabWidget;
int _graphicsTabId;
private:
//