mirror of https://github.com/stella-emu/stella.git
made sure dialogs fit into 2x zoom and 0.8 aspect ration (=512 pixel)
This commit is contained in:
parent
87c59db4e0
commit
1c4345eff3
|
@ -28,7 +28,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
ConfigPathDialog::ConfigPathDialog(
|
ConfigPathDialog::ConfigPathDialog(
|
||||||
OSystem& osystem, DialogContainer& parent,
|
OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss)
|
const GUI::Font& font, GuiObject* boss, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, font, "Configure paths"),
|
: Dialog(osystem, parent, font, "Configure paths"),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myFont(font),
|
myFont(font),
|
||||||
|
@ -48,7 +48,7 @@ ConfigPathDialog::ConfigPathDialog(
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = 64 * fontWidth + HBORDER*2;
|
_w = std::min(64 * fontWidth + HBORDER*2, max_w);
|
||||||
_h = 9 * (lineHeight + V_GAP) + VBORDER;
|
_h = 9 * (lineHeight + V_GAP) + VBORDER;
|
||||||
|
|
||||||
xpos = HBORDER; ypos = VBORDER;
|
xpos = HBORDER; ypos = VBORDER;
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ConfigPathDialog : public Dialog, public CommandSender
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigPathDialog(OSystem& osystem, DialogContainer& parent,
|
ConfigPathDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss);
|
const GUI::Font& font, GuiObject* boss, int max_w, int max_h);
|
||||||
virtual ~ConfigPathDialog();
|
virtual ~ConfigPathDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
#include "ContextMenu.hxx"
|
#include "ContextMenu.hxx"
|
||||||
#include "PopUpWidget.hxx"
|
#include "PopUpWidget.hxx"
|
||||||
|
#include "Settings.hxx"
|
||||||
|
#include "Console.hxx"
|
||||||
|
|
||||||
#include "Vec.hxx"
|
#include "Vec.hxx"
|
||||||
|
|
||||||
|
@ -813,16 +815,20 @@ Widget* Dialog::TabFocus::getNewFocus()
|
||||||
bool Dialog::getResizableBounds(uInt32& w, uInt32& h) const
|
bool Dialog::getResizableBounds(uInt32& w, uInt32& h) const
|
||||||
{
|
{
|
||||||
const GUI::Rect& r = instance().frameBuffer().imageRect();
|
const GUI::Rect& r = instance().frameBuffer().imageRect();
|
||||||
|
|
||||||
|
bool ntsc = instance().console().about().InitialFrameRate == "60";
|
||||||
|
uInt32 aspect = instance().settings().getInt(ntsc ?"tia.aspectn" : "tia.aspectp");
|
||||||
|
|
||||||
if(r.width() <= FrameBuffer::kFBMinW || r.height() <= FrameBuffer::kFBMinH)
|
if(r.width() <= FrameBuffer::kFBMinW || r.height() <= FrameBuffer::kFBMinH)
|
||||||
{
|
{
|
||||||
w = uInt32(0.8 * FrameBuffer::kTIAMinW) * 2;
|
w = uInt32(aspect * FrameBuffer::kTIAMinW) * 2 / 100;
|
||||||
h = FrameBuffer::kTIAMinH * 2;
|
h = FrameBuffer::kTIAMinH * 2;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
w = std::max(uInt32(0.8 * r.width()), uInt32(FrameBuffer::kFBMinW));
|
w = std::max(uInt32(aspect * r.width() / 100), uInt32(FrameBuffer::kFBMinW));
|
||||||
h = std::max(uInt32(0.8 * r.height()), uInt32(FrameBuffer::kFBMinH));
|
h = std::max(uInt32(aspect * r.height() / 100), uInt32(FrameBuffer::kFBMinH));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include "AboutDialog.hxx"
|
#include "AboutDialog.hxx"
|
||||||
#include "OptionsDialog.hxx"
|
#include "OptionsDialog.hxx"
|
||||||
#include "Launcher.hxx"
|
#include "Launcher.hxx"
|
||||||
|
#include "Settings.hxx"
|
||||||
|
|
||||||
#ifdef CHEATCODE_SUPPORT
|
#ifdef CHEATCODE_SUPPORT
|
||||||
#include "CheatCodeDialog.hxx"
|
#include "CheatCodeDialog.hxx"
|
||||||
|
@ -48,7 +49,8 @@
|
||||||
OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
|
OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
GuiObject* boss, int max_w, int max_h, stellaMode mode)
|
GuiObject* boss, int max_w, int max_h, stellaMode mode)
|
||||||
: Dialog(osystem, parent),
|
: Dialog(osystem, parent),
|
||||||
myMode(mode)
|
myMode(mode),
|
||||||
|
_boss(boss)
|
||||||
{
|
{
|
||||||
const GUI::Font& font = instance().frameBuffer().font();
|
const GUI::Font& font = instance().frameBuffer().font();
|
||||||
initTitle(font, "Options");
|
initTitle(font, "Options");
|
||||||
|
@ -131,8 +133,8 @@ OptionsDialog::OptionsDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
myAudioDialog = make_unique<AudioDialog>(osystem, parent, font);
|
myAudioDialog = make_unique<AudioDialog>(osystem, parent, font);
|
||||||
myInputDialog = make_unique<InputDialog>(osystem, parent, font, max_w, max_h);
|
myInputDialog = make_unique<InputDialog>(osystem, parent, font, max_w, max_h);
|
||||||
myUIDialog = make_unique<UIDialog>(osystem, parent, font);
|
myUIDialog = make_unique<UIDialog>(osystem, parent, font);
|
||||||
mySnapshotDialog = make_unique<SnapshotDialog>(osystem, parent, font);
|
mySnapshotDialog = make_unique<SnapshotDialog>(osystem, parent, font, max_w, max_h);
|
||||||
myConfigPathDialog = make_unique<ConfigPathDialog>(osystem, parent, font, boss);
|
myConfigPathDialog = make_unique<ConfigPathDialog>(osystem, parent, font, boss, max_w, max_h);
|
||||||
myRomAuditDialog = make_unique<RomAuditDialog>(osystem, parent, font, max_w, max_h);
|
myRomAuditDialog = make_unique<RomAuditDialog>(osystem, parent, font, max_w, max_h);
|
||||||
myGameInfoDialog = make_unique<GameInfoDialog>(osystem, parent, font, this);
|
myGameInfoDialog = make_unique<GameInfoDialog>(osystem, parent, font, this);
|
||||||
#ifdef CHEATCODE_SUPPORT
|
#ifdef CHEATCODE_SUPPORT
|
||||||
|
@ -190,6 +192,15 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
switch(cmd)
|
switch(cmd)
|
||||||
{
|
{
|
||||||
case kVidCmd:
|
case kVidCmd:
|
||||||
|
// This dialog is resizable under certain conditions, so we need
|
||||||
|
// to re-create it as necessary
|
||||||
|
if(myMode != launcher)
|
||||||
|
{
|
||||||
|
uInt32 w = 0, h = 0;
|
||||||
|
|
||||||
|
getResizableBounds(w, h);
|
||||||
|
myVideoDialog = make_unique<VideoDialog>(instance(), parent(), instance().frameBuffer().font(), w, h);
|
||||||
|
}
|
||||||
myVideoDialog->open();
|
myVideoDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -206,10 +217,29 @@ void OptionsDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kSnapCmd:
|
case kSnapCmd:
|
||||||
|
// This dialog is resizable under certain conditions, so we need
|
||||||
|
// to re-create it as necessary
|
||||||
|
if(myMode != launcher)
|
||||||
|
{
|
||||||
|
uInt32 w = 0, h = 0;
|
||||||
|
|
||||||
|
getResizableBounds(w, h);
|
||||||
|
mySnapshotDialog = make_unique<SnapshotDialog>(instance(), parent(), instance().frameBuffer().font(), w, h);
|
||||||
|
}
|
||||||
mySnapshotDialog->open();
|
mySnapshotDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kCfgPathsCmd:
|
case kCfgPathsCmd:
|
||||||
|
// This dialog is resizable under certain conditions, so we need
|
||||||
|
// to re-create it as necessary
|
||||||
|
if(myMode != launcher)
|
||||||
|
{
|
||||||
|
uInt32 w = 0, h = 0;
|
||||||
|
|
||||||
|
getResizableBounds(w, h);
|
||||||
|
myConfigPathDialog = make_unique<ConfigPathDialog>(instance(), parent(),
|
||||||
|
instance().frameBuffer().font(), _boss, w, h);
|
||||||
|
}
|
||||||
myConfigPathDialog->open();
|
myConfigPathDialog->open();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,8 @@ class OptionsDialog : public Dialog
|
||||||
// Indicates if this dialog is used for global (vs. in-game) settings
|
// Indicates if this dialog is used for global (vs. in-game) settings
|
||||||
stellaMode myMode;
|
stellaMode myMode;
|
||||||
|
|
||||||
|
GuiObject* _boss;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
kVidCmd = 'VIDO',
|
kVidCmd = 'VIDO',
|
||||||
kAudCmd = 'AUDO',
|
kAudCmd = 'AUDO',
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, font, "Snapshot settings"),
|
: Dialog(osystem, parent, font, "Snapshot settings"),
|
||||||
myFont(font)
|
myFont(font)
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,7 @@ SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = 64 * fontWidth + HBORDER * 2;
|
_w = std::min(max_w, 64 * fontWidth + HBORDER * 2);
|
||||||
_h = 10 * (lineHeight + 4) + VBORDER + _th;
|
_h = 10 * (lineHeight + 4) + VBORDER + _th;
|
||||||
|
|
||||||
xpos = HBORDER; ypos = VBORDER + _th;
|
xpos = HBORDER; ypos = VBORDER + _th;
|
||||||
|
|
|
@ -34,7 +34,7 @@ class SnapshotDialog : public Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font);
|
const GUI::Font& font, int max_w, int max_h);
|
||||||
virtual ~SnapshotDialog();
|
virtual ~SnapshotDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -55,8 +55,8 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
VariantList items;
|
VariantList items;
|
||||||
|
|
||||||
// Set real dimensions
|
// Set real dimensions
|
||||||
_w = std::min(57 * fontWidth + HBORDER * 2, max_w);
|
_w = std::min(55 * fontWidth + HBORDER * 2 + 8, max_w);
|
||||||
_h = std::min((16-2) * (lineHeight + VGAP) + 14 + _th, max_h);
|
_h = std::min(14 * (lineHeight + VGAP) + 14 + _th, max_h);
|
||||||
|
|
||||||
// The tab widget
|
// The tab widget
|
||||||
xpos = 2; ypos = 4;
|
xpos = 2; ypos = 4;
|
||||||
|
@ -141,7 +141,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
"(*) Requires application restart");
|
"(*) Requires application restart");
|
||||||
|
|
||||||
// Move over to the next column
|
// Move over to the next column
|
||||||
xpos += myFrameRate->getWidth() + 28;
|
xpos += myFrameRate->getWidth() + 16;
|
||||||
ypos = VBORDER;
|
ypos = VBORDER;
|
||||||
|
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
|
@ -236,7 +236,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ");
|
CREATE_CUSTOM_SLIDERS(Fringe, "Fringing ");
|
||||||
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ");
|
CREATE_CUSTOM_SLIDERS(Bleed, "Bleeding ");
|
||||||
|
|
||||||
xpos += myTVContrast->getWidth() + 40;
|
xpos += myTVContrast->getWidth() + 30;
|
||||||
ypos = VBORDER;
|
ypos = VBORDER;
|
||||||
|
|
||||||
lwidth = font.getStringWidth("Intensity ");
|
lwidth = font.getStringWidth("Intensity ");
|
||||||
|
|
Loading…
Reference in New Issue