define and align TV effect defaults for R77

slightly enlarge options dialog for minimal UI
This commit is contained in:
thrust26 2019-05-01 08:49:17 +02:00
parent 174b630c99
commit ae51e9a953
4 changed files with 24 additions and 21 deletions

View File

@ -40,9 +40,9 @@ class NTSCFilter
// Set one of the available preset adjustments (Composite, S-Video, RGB, etc) // Set one of the available preset adjustments (Composite, S-Video, RGB, etc)
enum class Preset { enum class Preset {
OFF, OFF,
COMPOSITE,
SVIDEO,
RGB, RGB,
SVIDEO,
COMPOSITE,
BAD, BAD,
CUSTOM CUSTOM
}; };

View File

@ -54,24 +54,26 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
// do not show basic settings options in debugger // do not show basic settings options in debugger
bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger; bool minSettings = osystem.settings().getBool("minimal_ui") && mode != Menu::AppMode::debugger;
const int buttonHeight = _font.getLineHeight() + 6, const int buttonHeight = _font.getLineHeight() + 6,
rowHeight = _font.getLineHeight() + 10; GAP = buttonHeight > 26 ? 5 : 4,
const int VBORDER = 10 + _th; rowHeight = buttonHeight + GAP;
int buttonWidth = _font.getStringWidth("Game Properties" + ELLIPSIS) + 20; const int VBORDER = GAP * 2 + 2;
const int HBORDER = GAP * 2 + 2;
int buttonWidth = _font.getStringWidth("Game Properties" + ELLIPSIS) + GAP * 5;
_w = 2 * buttonWidth + 30; _w = 2 * buttonWidth + HBORDER * 3;
_h = 7 * rowHeight + 15 + _th; _h = 7 * rowHeight + VBORDER * 2 - GAP + _th;
int xoffset = 10, yoffset = VBORDER; int xoffset = HBORDER, yoffset = VBORDER + _th;
WidgetArray wid; WidgetArray wid;
ButtonWidget* b = nullptr; ButtonWidget* b = nullptr;
if (minSettings) if (minSettings)
{ {
ButtonWidget* bw = new ButtonWidget(this, _font, xoffset, yoffset, ButtonWidget* bw = new ButtonWidget(this, _font, xoffset, yoffset,
_w - 10 * 2, buttonHeight, "Switch to Basic Settings" + ELLIPSIS, kBasSetCmd); _w - HBORDER * 2, buttonHeight, "Switch to Basic Settings" + ELLIPSIS, kBasSetCmd);
wid.push_back(bw); wid.push_back(bw);
yoffset += rowHeight + 8; yoffset += rowHeight + GAP * 2;
_h += rowHeight + 8; _h += rowHeight + GAP * 2;
} }
auto ADD_OD_BUTTON = [&](const string& label, int cmd) auto ADD_OD_BUTTON = [&](const string& label, int cmd)
@ -105,7 +107,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
wid.push_back(b); wid.push_back(b);
// Move to second column // Move to second column
xoffset += buttonWidth + 10; yoffset = minSettings ? VBORDER + rowHeight + 8 : VBORDER; xoffset += buttonWidth + HBORDER;
yoffset = minSettings ? VBORDER + _th + rowHeight + GAP * 2 : VBORDER + _th;
myGameInfoButton = ADD_OD_BUTTON("Game Properties" + ELLIPSIS, kInfoCmd); myGameInfoButton = ADD_OD_BUTTON("Game Properties" + ELLIPSIS, kInfoCmd);
wid.push_back(myGameInfoButton); wid.push_back(myGameInfoButton);
@ -128,8 +131,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
b = ADD_OD_BUTTON("About" + ELLIPSIS, kAboutCmd); b = ADD_OD_BUTTON("About" + ELLIPSIS, kAboutCmd);
wid.push_back(b); wid.push_back(b);
buttonWidth = _font.getStringWidth(" Close ") + 20; buttonWidth = _font.getStringWidth(" Close ") + GAP * 5;
xoffset -= (buttonWidth + 10) / 2; xoffset -= (buttonWidth + HBORDER) / 2;
b = ADD_OD_BUTTON("Close", kExitCmd); b = ADD_OD_BUTTON("Close", kExitCmd);
wid.push_back(b); wid.push_back(b);
addCancelWidget(b); addCancelWidget(b);

View File

@ -29,7 +29,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent, StellaSettingsDialog::StellaSettingsDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h, Menu::AppMode mode) const GUI::Font& font, int max_w, int max_h, Menu::AppMode mode)
: Dialog(osystem, parent, font, "Stella settings"), : Dialog(osystem, parent, font, "Basic settings"),
myMode(mode) myMode(mode)
{ {
const int VBORDER = 8; const int VBORDER = 8;
@ -271,11 +271,11 @@ void StellaSettingsDialog::setDefaults()
myThemePopup->setSelected("standard"); myThemePopup->setSelected("standard");
// TV effects // TV effects
myTVMode->setSelected("0", "0"); myTVMode->setSelected("RGB", static_cast<uInt32>(NTSCFilter::Preset::RGB));
// TV scanline intensity // TV scanline intensity
myTVScanIntense->setValue(0); // = off myTVScanIntense->setValue(3); // 18
// TV phosphor blend // TV phosphor blend
myTVPhosLevel->setValue(0); // = off myTVPhosLevel->setValue(6); // = 45
// Load the default game properties // Load the default game properties
Properties defaultProperties; Properties defaultProperties;

View File

@ -67,10 +67,10 @@ SettingsR77::SettingsR77()
setPermanent("threads", "1"); setPermanent("threads", "1");
// all TV effects off by default (aligned to StellaSettingsDialog defaults!) // all TV effects off by default (aligned to StellaSettingsDialog defaults!)
setPermanent("tv.filter", "0"); setPermanent("tv.filter", "1"); // RGB
setPermanent("tv.phosphor", "always"); setPermanent("tv.phosphor", "always");
setPermanent("tv.phosblend", "0"); setPermanent("tv.phosblend", "45"); // level 6
setPermanent("tv.scanlines", "0"); setPermanent("tv.scanlines", "18"); // level 3
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -