mirror of https://github.com/stella-emu/stella.git
cleaned up code for use of fonts for BrowserDialog
This commit is contained in:
parent
1e70fb50bc
commit
b56f81e8b5
|
@ -35,7 +35,6 @@
|
||||||
#include "PromptWidget.hxx"
|
#include "PromptWidget.hxx"
|
||||||
#include "RomWidget.hxx"
|
#include "RomWidget.hxx"
|
||||||
#include "ProgressDialog.hxx"
|
#include "ProgressDialog.hxx"
|
||||||
#include "BrowserDialog.hxx"
|
|
||||||
#include "TimerManager.hxx"
|
#include "TimerManager.hxx"
|
||||||
#include "Vec.hxx"
|
#include "Vec.hxx"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
#include "Bankswitch.hxx"
|
#include "Bankswitch.hxx"
|
||||||
#include "BrowserDialog.hxx"
|
|
||||||
#include "ContextMenu.hxx"
|
#include "ContextMenu.hxx"
|
||||||
#include "DialogContainer.hxx"
|
#include "DialogContainer.hxx"
|
||||||
#include "Dialog.hxx"
|
#include "Dialog.hxx"
|
||||||
|
|
|
@ -22,7 +22,6 @@ class ButtonWidget;
|
||||||
class CommandSender;
|
class CommandSender;
|
||||||
class ContextMenu;
|
class ContextMenu;
|
||||||
class DialogContainer;
|
class DialogContainer;
|
||||||
class BrowserDialog;
|
|
||||||
class OptionsDialog;
|
class OptionsDialog;
|
||||||
class HighScoresDialog;
|
class HighScoresDialog;
|
||||||
class GlobalPropsDialog;
|
class GlobalPropsDialog;
|
||||||
|
@ -168,7 +167,6 @@ class LauncherDialog : public Dialog
|
||||||
unique_ptr<StellaSettingsDialog> myStellaSettingsDialog;
|
unique_ptr<StellaSettingsDialog> myStellaSettingsDialog;
|
||||||
unique_ptr<ContextMenu> myMenu;
|
unique_ptr<ContextMenu> myMenu;
|
||||||
unique_ptr<GlobalPropsDialog> myGlobalProps;
|
unique_ptr<GlobalPropsDialog> myGlobalProps;
|
||||||
unique_ptr<BrowserDialog> myRomDir;
|
|
||||||
unique_ptr<WhatsNewDialog> myWhatsNewDialog;
|
unique_ptr<WhatsNewDialog> myWhatsNewDialog;
|
||||||
|
|
||||||
// automatically sized font for ROM info viewer
|
// automatically sized font for ROM info viewer
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
|
RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, font, "Audit ROMs"),
|
: Dialog(osystem, parent, font, "Audit ROMs"),
|
||||||
myFont{font},
|
|
||||||
myMaxWidth{max_w},
|
myMaxWidth{max_w},
|
||||||
myMaxHeight{max_h}
|
myMaxHeight{max_h}
|
||||||
{
|
{
|
||||||
|
@ -186,7 +185,7 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
msg.push_back("If you're sure you want to proceed with the");
|
msg.push_back("If you're sure you want to proceed with the");
|
||||||
msg.push_back("audit, click 'OK', otherwise click 'Cancel'.");
|
msg.push_back("audit, click 'OK', otherwise click 'Cancel'.");
|
||||||
myConfirmMsg = make_unique<GUI::MessageBox>
|
myConfirmMsg = make_unique<GUI::MessageBox>
|
||||||
(this, myFont, msg, myMaxWidth, myMaxHeight, kConfirmAuditCmd,
|
(this, _font, msg, myMaxWidth, myMaxHeight, kConfirmAuditCmd,
|
||||||
"OK", "Cancel", "ROM Audit", false);
|
"OK", "Cancel", "ROM Audit", false);
|
||||||
}
|
}
|
||||||
myConfirmMsg->show();
|
myConfirmMsg->show();
|
||||||
|
@ -229,7 +228,7 @@ void RomAuditDialog::createBrowser(const string& title)
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
|
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
|
||||||
uInt32(myBrowser->getHeight()) != h)
|
uInt32(myBrowser->getHeight()) != h)
|
||||||
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
|
myBrowser = make_unique<BrowserDialog>(this, _font, w, h, title);
|
||||||
else
|
else
|
||||||
myBrowser->setTitle(title);
|
myBrowser->setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,6 @@ class RomAuditDialog : public Dialog
|
||||||
|
|
||||||
// Select a new ROM audit path
|
// Select a new ROM audit path
|
||||||
unique_ptr<BrowserDialog> myBrowser;
|
unique_ptr<BrowserDialog> myBrowser;
|
||||||
const GUI::Font& myFont;
|
|
||||||
|
|
||||||
// ROM audit path
|
// ROM audit path
|
||||||
EditTextWidget* myRomPath{nullptr};
|
EditTextWidget* myRomPath{nullptr};
|
||||||
|
|
|
@ -28,8 +28,7 @@
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, int max_w, int max_h)
|
const GUI::Font& font, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, font, "Snapshot settings"),
|
: Dialog(osystem, parent, font, "Snapshot settings")
|
||||||
myFont{font}
|
|
||||||
{
|
{
|
||||||
const int lineHeight = font.getLineHeight(),
|
const int lineHeight = font.getLineHeight(),
|
||||||
fontHeight = _font.getFontHeight(),
|
fontHeight = _font.getFontHeight(),
|
||||||
|
@ -189,7 +188,7 @@ void SnapshotDialog::createBrowser(const string& title)
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
|
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
|
||||||
uInt32(myBrowser->getHeight()) != h)
|
uInt32(myBrowser->getHeight()) != h)
|
||||||
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
|
myBrowser = make_unique<BrowserDialog>(this, _font, w, h, title);
|
||||||
else
|
else
|
||||||
myBrowser->setTitle(title);
|
myBrowser->setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,8 +52,6 @@ class SnapshotDialog : public Dialog
|
||||||
kSnapshotInterval = 'SnIn' // snap chosen (load files)
|
kSnapshotInterval = 'SnIn' // snap chosen (load files)
|
||||||
};
|
};
|
||||||
|
|
||||||
const GUI::Font& myFont;
|
|
||||||
|
|
||||||
// Config paths
|
// Config paths
|
||||||
EditTextWidget* mySnapSavePath{nullptr};
|
EditTextWidget* mySnapSavePath{nullptr};
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
const GUI::Font& font, GuiObject* boss, int max_w, int max_h)
|
const GUI::Font& font, GuiObject* boss, int max_w, int max_h)
|
||||||
: Dialog(osystem, parent, font, "User interface settings"),
|
: Dialog(osystem, parent, font, "User interface settings"),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
myFont{font},
|
|
||||||
myIsGlobal{boss != nullptr}
|
myIsGlobal{boss != nullptr}
|
||||||
{
|
{
|
||||||
const GUI::Font& ifont = instance().frameBuffer().infoFont();
|
const GUI::Font& ifont = instance().frameBuffer().infoFont();
|
||||||
|
@ -712,7 +711,7 @@ void UIDialog::createBrowser(const string& title)
|
||||||
// Create file browser dialog
|
// Create file browser dialog
|
||||||
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
|
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
|
||||||
uInt32(myBrowser->getHeight()) != h)
|
uInt32(myBrowser->getHeight()) != h)
|
||||||
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
|
myBrowser = make_unique<BrowserDialog>(this, _font, w, h, title);
|
||||||
else
|
else
|
||||||
myBrowser->setTitle(title);
|
myBrowser->setTitle(title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,6 @@ class UIDialog : public Dialog, public CommandSender
|
||||||
kSnapLoadDirChosenCmd = 'UIsc' // snap chosen (load files)
|
kSnapLoadDirChosenCmd = 'UIsc' // snap chosen (load files)
|
||||||
};
|
};
|
||||||
|
|
||||||
const GUI::Font& myFont;
|
|
||||||
TabWidget* myTab{nullptr};
|
TabWidget* myTab{nullptr};
|
||||||
|
|
||||||
// Launcher options
|
// Launcher options
|
||||||
|
|
Loading…
Reference in New Issue