diff options
author | Max Horn | 2009-01-18 14:42:26 +0000 |
---|---|---|
committer | Max Horn | 2009-01-18 14:42:26 +0000 |
commit | 5e1cf1e166099c4beb3f5d19729a17558e748f7b (patch) | |
tree | 7555a55aa74fc6f6a1c0aea5d9a9bcc707258f73 /gui | |
parent | 964a451e42568f014124c2899efbb81d9faee018 (diff) | |
download | scummvm-rg350-5e1cf1e166099c4beb3f5d19729a17558e748f7b.tar.gz scummvm-rg350-5e1cf1e166099c4beb3f5d19729a17558e748f7b.tar.bz2 scummvm-rg350-5e1cf1e166099c4beb3f5d19729a17558e748f7b.zip |
GUI: Renamed Globals.TabLabelWidth to Globals.PopUpWidget.labelWidth (that's what it really is); changed PopUpWidget to use that value directly
svn-id: r35895
Diffstat (limited to 'gui')
-rw-r--r-- | gui/PopUpWidget.cpp | 9 | ||||
-rw-r--r-- | gui/PopUpWidget.h | 6 | ||||
-rw-r--r-- | gui/launcher.cpp | 19 | ||||
-rw-r--r-- | gui/options.cpp | 29 | ||||
-rw-r--r-- | gui/themes/scummclassic/classic_layout.stx | 2 | ||||
-rw-r--r-- | gui/themes/scummclassic/classic_layout_lowres.stx | 4 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout.stx | 15 | ||||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout_lowres.stx | 2 |
8 files changed, 32 insertions, 54 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp index 4792833580..9be652b8d6 100644 --- a/gui/PopUpWidget.cpp +++ b/gui/PopUpWidget.cpp @@ -356,15 +356,13 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) { // PopUpWidget // -PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth) - : Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) { +PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label) + : Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(0) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_IGNORE_DRAG); _type = kPopUpWidget; _selectedItem = -1; - - if (!_label.empty() && _labelWidth == 0) - _labelWidth = g_gui.getStringWidth(_label); + _labelWidth = g_gui.xmlEval()->getVar("Globals.PopUpWidget.labelWidth"); } void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) { @@ -396,6 +394,7 @@ void PopUpWidget::handleMouseWheel(int x, int y, int direction) { } void PopUpWidget::reflowLayout() { + _labelWidth = g_gui.xmlEval()->getVar("Globals.PopUpWidget.labelWidth"); _leftPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Left", 0); _rightPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Right", 0); _labelSpacing = g_gui.xmlEval()->getVar("Globals.PopUpWidget.labelSpacing", 10); diff --git a/gui/PopUpWidget.h b/gui/PopUpWidget.h index 3f65106ac1..23d5757992 100644 --- a/gui/PopUpWidget.h +++ b/gui/PopUpWidget.h @@ -56,16 +56,14 @@ protected: int _selectedItem; String _label; - uint _labelWidth; + int _labelWidth; int _leftPadding; int _rightPadding; int _labelSpacing; public: - PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth = 0); - - void changeLabelWidth(uint newWidth) { _labelWidth = newWidth; } + PopUpWidget(GuiObject *boss, const String &name, const String &label); void handleMouseDown(int x, int y, int button, int clickCount); void handleMouseWheel(int x, int y, int direction); diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 119e3596f8..4d54a60eb0 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -121,8 +121,6 @@ class EditGameDialog : public OptionsDialog { public: EditGameDialog(const String &domain, const String &desc); - virtual void reflowLayout(); - void open(); void close(); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); @@ -147,8 +145,6 @@ protected: EditGameDialog::EditGameDialog(const String &domain, const String &desc) : OptionsDialog(domain, "GameOptions") { - int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth"); - // GAME: Path to game data (r/o), extra data (r/o), and save data (r/w) String gamePath(ConfMan.get("path", _domain)); String extraPath(ConfMan.get("extrapath", _domain)); @@ -177,7 +173,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) _descriptionWidget = new EditTextWidget(tab, "GameOptions_Game.Desc", description); // Language popup - _langPopUp = new PopUpWidget(tab, "GameOptions_Game.Lang", "Language:", labelWidth); + _langPopUp = new PopUpWidget(tab, "GameOptions_Game.Lang", "Language:"); _langPopUp->appendEntry("<default>"); _langPopUp->appendEntry(""); const Common::LanguageDescription *l = Common::g_languages; @@ -186,7 +182,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) } // Platform popup - _platformPopUp = new PopUpWidget(tab, "GameOptions_Game.Platform", "Platform:", labelWidth); + _platformPopUp = new PopUpWidget(tab, "GameOptions_Game.Platform", "Platform:"); _platformPopUp->appendEntry("<default>"); _platformPopUp->appendEntry(""); const Common::PlatformDescription *p = Common::g_platforms; @@ -260,17 +256,6 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) new ButtonWidget(this, "GameOptions.Ok", "OK", kOKCmd, 0); } -void EditGameDialog::reflowLayout() { - OptionsDialog::reflowLayout(); - - int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth"); - - if (_langPopUp) - _langPopUp->changeLabelWidth(labelWidth); - if (_platformPopUp) - _platformPopUp->changeLabelWidth(labelWidth); -} - void EditGameDialog::open() { OptionsDialog::open(); diff --git a/gui/options.cpp b/gui/options.cpp index 77d564fdb4..78010e351a 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -515,10 +515,8 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) { void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) { const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes(); - int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth"); - // The GFX mode popup - _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode:", labelWidth); + _gfxPopUp = new PopUpWidget(boss, prefix + "grModePopup", "Graphics mode:"); _gfxPopUp->appendEntry("<default>"); _gfxPopUp->appendEntry(""); @@ -528,7 +526,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) { } // RenderMode popup - _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode:", labelWidth); + _renderModePopUp = new PopUpWidget(boss, prefix + "grRenderPopup", "Render mode:"); _renderModePopUp->appendEntry("<default>", Common::kRenderDefault); _renderModePopUp->appendEntry(""); const Common::RenderModeDescription *rm = Common::g_renderModes; @@ -546,10 +544,8 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const String &prefix) { } void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) { - int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth"); - // The MIDI mode popup & a label - _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver:", labelWidth); + _midiPopUp = new PopUpWidget(boss, prefix + "auMidiPopup", "Music driver:"); // Populate it const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers(); @@ -559,7 +555,7 @@ void OptionsDialog::addAudioControls(GuiObject *boss, const String &prefix) { } // Sample rate settings - _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate:", labelWidth); + _outputRatePopUp = new PopUpWidget(boss, prefix + "auSampleRatePopup", "Output rate:"); for (int i = 0; outputRateLabels[i]; i++) { _outputRatePopUp->appendEntry(outputRateLabels[i], outputRateValues[i]); @@ -652,19 +648,8 @@ int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) { 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); - if (_outputRatePopUp) - _outputRatePopUp->changeLabelWidth(labelWidth); - if (_gfxPopUp) - _gfxPopUp->changeLabelWidth(labelWidth); - if (_renderModePopUp) - _renderModePopUp->changeLabelWidth(labelWidth); } #pragma mark - @@ -731,14 +716,12 @@ GlobalOptionsDialog::GlobalOptionsDialog() _curTheme = new StaticTextWidget(tab, "GlobalOptions_Misc.CurTheme", g_gui.theme()->getThemeName()); - int labelWidth = g_gui.xmlEval()->getVar("Globals.TabLabelWidth"); - - _rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.Renderer", "GUI Renderer:", labelWidth); + _rendererPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.Renderer", "GUI Renderer:"); for (uint i = 1; i < GUI::ThemeEngine::_rendererModesSize; ++i) _rendererPopUp->appendEntry(GUI::ThemeEngine::_rendererModes[i].name, GUI::ThemeEngine::_rendererModes[i].mode); - _autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriod", "Autosave:", labelWidth); + _autosavePeriodPopUp = new PopUpWidget(tab, "GlobalOptions_Misc.AutosavePeriod", "Autosave:"); for (int i = 0; savePeriodLabels[i]; i++) { _autosavePeriodPopUp->appendEntry(savePeriodLabels[i], savePeriodValues[i]); diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index 2508ff4a5b..015d989db1 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -27,10 +27,10 @@ <globals> <def var = 'Line.Height' value = '16' /> <def var = 'Font.Height' value = '16' /> - <def var = 'TabLabelWidth' value = '110' /> <def var = 'About.OuterBorder' value = '80'/> <def var = 'PopUpWidget.labelSpacing' value = '10' /> + <def var = 'PopUpWidget.labelWidth' value = '110' /> <def var = 'Layout.Spacing' value = '8' /> <def var = 'ShowLauncherLogo' value = '0'/> diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 0914385667..b1fd9e3f43 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -27,11 +27,11 @@ <globals> <def var = 'Line.Height' value = '12' /> <def var = 'Font.Height' value = '10' /> - <def var = 'TabLabelWidth' value = '100' /> <def var = 'About.OuterBorder' value = '10'/> <def var = 'PopUpWidget.labelSpacing' value = '6' /> - + <def var = 'PopUpWidget.labelWidth' value = '100' /> + <def var = 'Layout.Spacing' value = '8'/> <def var = 'ShowLauncherLogo' value = '0'/> diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx index 96d3f69663..ee027526e4 100644 --- a/gui/themes/scummmodern/scummmodern_layout.stx +++ b/gui/themes/scummmodern/scummmodern_layout.stx @@ -27,7 +27,6 @@ <globals> <def var = 'Line.Height' value = '16' /> <def var = 'Font.Height' value = '16' /> - <def var = 'TabLabelWidth' value = '110' /> <def var = 'Padding.Bottom' value = '16' /> <def var = 'Padding.Left' value = '16' /> @@ -39,6 +38,7 @@ <def var = 'ListWidget.hlLeftPadding' value = '0'/> <def var = 'ListWidget.hlRightPadding' value = '0'/> <def var = 'PopUpWidget.labelSpacing' value = '10' /> + <def var = 'PopUpWidget.labelWidth' value = '110' /> <def var = 'ShowLauncherLogo' value = '1'/> <def var = 'ShowGlobalMenuLogo' value = '1'/> @@ -705,4 +705,17 @@ </layout> </layout> </dialog> + + <dialog name = 'KeyRemapper' overlays = 'screen_center' shading = 'dim'> + <layout type = 'vertical' padding = '8, 8, 32, 8' center = 'true'> + <widget name = 'Popup' + type = 'PopUp' + /> + <widget name = 'KeymapArea' + /> + <widget name = 'Close' + type = 'Button' + /> + </layout> + </dialog> </layout_info> diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index fb4b0a6950..bfa2fab798 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -27,10 +27,10 @@ <globals> <def var = 'Line.Height' value = '12' /> <def var = 'Font.Height' value = '10' /> - <def var = 'TabLabelWidth' value = '100' /> <def var = 'About.OuterBorder' value = '10'/> <def var = 'PopUpWidget.labelSpacing' value = '6' /> + <def var = 'PopUpWidget.labelWidth' value = '100' /> <def var = 'ShowLauncherLogo' value = '0'/> <def var = 'ShowGlobalMenuLogo' value = '0'/> |