[Scummvm-cvs-logs] CVS: scummvm/gui launcher.cpp,1.121,1.122 options.cpp,1.86,1.87

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Thu May 19 06:13:40 CEST 2005


Update of /cvsroot/scummvm/scummvm/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17999

Modified Files:
	launcher.cpp options.cpp 
Log Message:
More scaling work. It's still more about infrastructure than layout: I want
to give each widget the opportunity to scale itself.

There's a slight regression this time, though: In the small version of the
GUI, some of the buttons (e.g. "SoundFont") have their text truncated. Not
good.


Index: launcher.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/launcher.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- launcher.cpp	18 May 2005 14:11:52 -0000	1.121
+++ launcher.cpp	19 May 2005 13:10:57 -0000	1.122
@@ -143,7 +143,6 @@
 	const int screenH = g_system->getOverlayHeight();
 	
 	_w = screenW - 2 * 10;
-	_h = screenH - 2 * 40;	// TODO/FIXME
 
 	GUI::WidgetSize ws;
 	int buttonHeight;
@@ -151,10 +150,12 @@
 
 	if (screenW >= 400 && screenH >= 300) {
 		ws = GUI::kBigWidgetSize;
+		_h = screenH - 2 * 40;	// TODO/FIXME
 		buttonHeight = kBigButtonHeight;
 		buttonWidth = kBigButtonWidth;
 	} else {
 		ws = GUI::kNormalWidgetSize;
+		_h = screenH - 2 * 30;	// TODO/FIXME
 		buttonHeight = kButtonHeight;
 		buttonWidth = kButtonWidth;
 	}
@@ -222,7 +223,7 @@
 	// GUI:  Button + Label for the game path
 	addButton(tab, x, yoffset, "Game Path:", kCmdGameBrowser, 0, ws);
 	_gamePathWidget = new StaticTextWidget(tab, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, gamePath, kTextAlignLeft, ws);
-	yoffset += buttonHeight + 2;
+	yoffset += buttonHeight + 4;
 
 	// GUI:  Button + Label for the additional path
 	addButton(tab, x, yoffset, "Extra Path:", kCmdExtraBrowser, 0, ws);
@@ -230,7 +231,7 @@
 	if (extraPath.isEmpty() || !ConfMan.hasKey("extrapath", _domain)) {
 		_extraPathWidget->setLabel("None");
 	}
-	yoffset += buttonHeight + 2;
+	yoffset += buttonHeight + 4;
 
 	// GUI:  Button + Label for the save path
 	addButton(tab, x, yoffset, "Save Path:", kCmdSaveBrowser, 0, ws);
@@ -238,7 +239,7 @@
 	if (savePath.isEmpty() || !ConfMan.hasKey("savepath", _domain)) {
 		_savePathWidget->setLabel("Default");
 	}
-	yoffset += buttonHeight + 2;
+	yoffset += buttonHeight + 4;
 
 	//
 	// 3) The graphics tab

Index: options.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/options.cpp,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- options.cpp	18 May 2005 16:17:25 -0000	1.86
+++ options.cpp	19 May 2005 13:10:57 -0000	1.87
@@ -381,23 +381,35 @@
 
 int OptionsDialog::addMIDIControls(GuiObject *boss, int yoffset, WidgetSize ws) {
 	const int x = 10;
+	int spacing;
+	int buttonWidth, buttonHeight;
+
+	if (ws == kBigWidgetSize) {
+		buttonWidth = kBigButtonWidth;
+		buttonHeight = kBigButtonHeight;
+		spacing = 2;
+	} else {
+		buttonWidth = kButtonWidth;
+		buttonHeight = kButtonHeight;
+		spacing = 1;
+	}
 
 	// SoundFont
-	_soundFontButton = new ButtonWidget(boss, x, yoffset, kButtonWidth + 14, 16, "SoundFont: ", kChooseSoundFontCmd, 0);
-	_soundFont = new StaticTextWidget(boss, x + kButtonWidth + 20, yoffset + 3, _w - (x + kButtonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft);
-	yoffset += 18;
+	_soundFontButton = addButton(boss, x, yoffset, "SoundFont: ", kChooseSoundFontCmd, 0, ws);
+	_soundFont = new StaticTextWidget(boss, x + buttonWidth + 20, yoffset + 3, _w - (x + buttonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft, ws);
+	yoffset += buttonHeight + 2 * spacing;
 
 	// Multi midi setting
 	_multiMidiCheckbox = addCheckbox(boss, x, yoffset, "Mixed Adlib/MIDI mode", 0, 0, ws);
-	yoffset += _multiMidiCheckbox->getHeight();
+	yoffset += _multiMidiCheckbox->getHeight() + spacing;
 	
 	// Native mt32 setting
 	_mt32Checkbox = addCheckbox(boss, x, yoffset, "True Roland MT-32 (disable GM emulation)", 0, 0, ws);
-	yoffset += _mt32Checkbox->getHeight();
+	yoffset += _mt32Checkbox->getHeight() + spacing;
 
 	// GS Extensions setting
 	_enableGSCheckbox = addCheckbox(boss, x, yoffset, "Enable Roland GS Mode", 0, 0, ws);
-	yoffset += _enableGSCheckbox->getHeight();
+	yoffset += _enableGSCheckbox->getHeight() + spacing;
 	
 	_enableMIDISettings = true;
 
@@ -428,10 +440,10 @@
 			textwidth = width;
 	}
 
-	int xoffset = textwidth + 10;
+	int xoffset = textwidth + 15;
 
 	// Volume controllers
-	new StaticTextWidget(boss, 5, yoffset + 2, textwidth, kLineHeight, slider_labels[0], kTextAlignRight, ws);
+	new StaticTextWidget(boss, 10, yoffset + 2, textwidth, kLineHeight, slider_labels[0], kTextAlignRight, ws);
 	_musicVolumeSlider = addSlider(boss, xoffset, yoffset, kMusicVolumeChanged, ws);
 	_musicVolumeLabel = new StaticTextWidget(boss, xoffset + _musicVolumeSlider->getWidth() + 10, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft, ws);
 	_musicVolumeSlider->setMinValue(0);
@@ -439,7 +451,7 @@
 	_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += _musicVolumeSlider->getHeight() + 4;
 
-	new StaticTextWidget(boss, 5, yoffset + 2, textwidth, kLineHeight, slider_labels[1], kTextAlignRight, ws);
+	new StaticTextWidget(boss, 10, yoffset + 2, textwidth, kLineHeight, slider_labels[1], kTextAlignRight, ws);
 	_sfxVolumeSlider = addSlider(boss, xoffset, yoffset, kSfxVolumeChanged, ws);
 	_sfxVolumeLabel = new StaticTextWidget(boss, xoffset + _musicVolumeSlider->getWidth() + 10, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft, ws);
 	_sfxVolumeSlider->setMinValue(0);
@@ -447,7 +459,7 @@
 	_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
 	yoffset += _sfxVolumeSlider->getHeight() + 4;
 
-	new StaticTextWidget(boss, 5, yoffset + 2, textwidth, kLineHeight, slider_labels[2], kTextAlignRight, ws);
+	new StaticTextWidget(boss, 10, yoffset + 2, textwidth, kLineHeight, slider_labels[2], kTextAlignRight, ws);
 	_speechVolumeSlider = addSlider(boss, xoffset, yoffset, kSpeechVolumeChanged, ws);
 	_speechVolumeLabel = new StaticTextWidget(boss, xoffset + _musicVolumeSlider->getWidth() + 10, yoffset + 2, 24, kLineHeight, "100%", kTextAlignLeft, ws);
 	_speechVolumeSlider->setMinValue(0);
@@ -470,15 +482,20 @@
 	const int screenH = g_system->getOverlayHeight();
 
 	GUI::WidgetSize ws;
+	int buttonWidth, buttonHeight;
 	
 	if (screenW >= 400 && screenH >= 300) {
 		ws = GUI::kBigWidgetSize;
+		buttonWidth = kBigButtonWidth;
+		buttonHeight = kBigButtonHeight;
 		_w = screenW - 2 * 10;
 		_h = screenH - 2 * 40;
 		_x = 10;
 		_y = 40;
 	} else {
 		ws = GUI::kNormalWidgetSize;
+		buttonWidth = kButtonWidth;
+		buttonHeight = kButtonHeight;
 		_w = screenW - 2 * 10;
 		_h = screenH - 1 * 20;
 		_x = 10;
@@ -489,7 +506,7 @@
 	int yoffset;
 
 	// The tab widget
-	TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - 24 - 2 * vBorder, ws);
+	TabWidget *tab = new TabWidget(this, 0, vBorder, _w, _h - buttonHeight - 8 - 2 * vBorder, ws);
 
 	//
 	// 1) The graphics tab
@@ -522,19 +539,18 @@
 
 #if !( defined(__DC__) || defined(__GP32__) )
 	// Save game path
-	new ButtonWidget(tab, 5, yoffset, kButtonWidth + 14, 16, "Save Path: ", kChooseSaveDirCmd, 0);
-	_savePath = new StaticTextWidget(tab, 5 + kButtonWidth + 20, yoffset + 3, _w - (5 + kButtonWidth + 20) - 10, kLineHeight, "/foo/bar", kTextAlignLeft);
-
-	yoffset += 18;
+	addButton(tab, 5, yoffset, "Save Path: ", kChooseSaveDirCmd, 0, ws);
+	_savePath = new StaticTextWidget(tab, 5 + buttonWidth + 20, yoffset + 3, _w - (5 + buttonWidth + 20) - 10, kLineHeight, "/foo/bar", kTextAlignLeft, ws);
+	yoffset += buttonHeight + 4;
 
- 	new ButtonWidget(tab, 5, yoffset, kButtonWidth + 14, 16, "Extra Path:", kChooseExtraDirCmd, 0);
-	_extraPath = new StaticTextWidget(tab, 5 + kButtonWidth + 20, yoffset + 3, _w - (5 + kButtonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft);
-	yoffset += 18;
+	addButton(tab, 5, yoffset, "Extra Path:", kChooseExtraDirCmd, 0, ws);
+	_extraPath = new StaticTextWidget(tab, 5 + buttonWidth + 20, yoffset + 3, _w - (5 + buttonWidth + 20) - 10, kLineHeight, "None", kTextAlignLeft, ws);
+	yoffset += buttonHeight + 4;
 #endif
 
 #ifdef _WIN32_WCE
-	new ButtonWidget(tab, 5, yoffset, kButtonWidth + 14, 16, "Keys", kChooseKeyMappingCmd, 0);
-	yoffset += 18;
+	addButton(tab, 5, yoffset, "Keys", kChooseKeyMappingCmd, 0, ws);
+	yoffset += buttonHeight + 4;
 #endif
 
 	// TODO: joystick setting
@@ -544,8 +560,8 @@
 	tab->setActiveTab(0);
 
 	// Add OK & Cancel buttons
-	addButton(_w - 2 * (kButtonWidth + 10), _h - 24, "Cancel", kCloseCmd, 0);
-	addButton(_w - (kButtonWidth + 10), _h - 24, "OK", kOKCmd, 0);
+	addButton(_w - 2 * (buttonWidth + 10), _h - buttonHeight - 8, "Cancel", kCloseCmd, 0, ws);
+	addButton(_w - (buttonWidth + 10), _h - buttonHeight - 8, "OK", kOKCmd, 0, ws);
 
 	// Create file browser dialogs
 	_dirBrowser = new BrowserDialog("Select directory for savegames", true);





More information about the Scummvm-git-logs mailing list