cleaned up code for use of fonts for BrowserDialog

This commit is contained in:
thrust26 2020-12-27 09:14:41 +01:00
parent 1e70fb50bc
commit b56f81e8b5
9 changed files with 5 additions and 16 deletions

View File

@ -35,7 +35,6 @@
#include "PromptWidget.hxx"
#include "RomWidget.hxx"
#include "ProgressDialog.hxx"
#include "BrowserDialog.hxx"
#include "TimerManager.hxx"
#include "Vec.hxx"

View File

@ -17,7 +17,6 @@
#include "bspf.hxx"
#include "Bankswitch.hxx"
#include "BrowserDialog.hxx"
#include "ContextMenu.hxx"
#include "DialogContainer.hxx"
#include "Dialog.hxx"

View File

@ -22,7 +22,6 @@ class ButtonWidget;
class CommandSender;
class ContextMenu;
class DialogContainer;
class BrowserDialog;
class OptionsDialog;
class HighScoresDialog;
class GlobalPropsDialog;
@ -168,7 +167,6 @@ class LauncherDialog : public Dialog
unique_ptr<StellaSettingsDialog> myStellaSettingsDialog;
unique_ptr<ContextMenu> myMenu;
unique_ptr<GlobalPropsDialog> myGlobalProps;
unique_ptr<BrowserDialog> myRomDir;
unique_ptr<WhatsNewDialog> myWhatsNewDialog;
// automatically sized font for ROM info viewer

View File

@ -37,7 +37,6 @@
RomAuditDialog::RomAuditDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent, font, "Audit ROMs"),
myFont{font},
myMaxWidth{max_w},
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("audit, click 'OK', otherwise click 'Cancel'.");
myConfirmMsg = make_unique<GUI::MessageBox>
(this, myFont, msg, myMaxWidth, myMaxHeight, kConfirmAuditCmd,
(this, _font, msg, myMaxWidth, myMaxHeight, kConfirmAuditCmd,
"OK", "Cancel", "ROM Audit", false);
}
myConfirmMsg->show();
@ -229,7 +228,7 @@ void RomAuditDialog::createBrowser(const string& title)
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
myBrowser = make_unique<BrowserDialog>(this, _font, w, h, title);
else
myBrowser->setTitle(title);
}

View File

@ -54,7 +54,6 @@ class RomAuditDialog : public Dialog
// Select a new ROM audit path
unique_ptr<BrowserDialog> myBrowser;
const GUI::Font& myFont;
// ROM audit path
EditTextWidget* myRomPath{nullptr};

View File

@ -28,8 +28,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SnapshotDialog::SnapshotDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, int max_w, int max_h)
: Dialog(osystem, parent, font, "Snapshot settings"),
myFont{font}
: Dialog(osystem, parent, font, "Snapshot settings")
{
const int lineHeight = font.getLineHeight(),
fontHeight = _font.getFontHeight(),
@ -189,7 +188,7 @@ void SnapshotDialog::createBrowser(const string& title)
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
myBrowser = make_unique<BrowserDialog>(this, _font, w, h, title);
else
myBrowser->setTitle(title);
}

View File

@ -52,8 +52,6 @@ class SnapshotDialog : public Dialog
kSnapshotInterval = 'SnIn' // snap chosen (load files)
};
const GUI::Font& myFont;
// Config paths
EditTextWidget* mySnapSavePath{nullptr};

View File

@ -42,7 +42,6 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
const GUI::Font& font, GuiObject* boss, int max_w, int max_h)
: Dialog(osystem, parent, font, "User interface settings"),
CommandSender(boss),
myFont{font},
myIsGlobal{boss != nullptr}
{
const GUI::Font& ifont = instance().frameBuffer().infoFont();
@ -712,7 +711,7 @@ void UIDialog::createBrowser(const string& title)
// Create file browser dialog
if(!myBrowser || uInt32(myBrowser->getWidth()) != w ||
uInt32(myBrowser->getHeight()) != h)
myBrowser = make_unique<BrowserDialog>(this, myFont, w, h, title);
myBrowser = make_unique<BrowserDialog>(this, _font, w, h, title);
else
myBrowser->setTitle(title);
}

View File

@ -50,7 +50,6 @@ class UIDialog : public Dialog, public CommandSender
kSnapLoadDirChosenCmd = 'UIsc' // snap chosen (load files)
};
const GUI::Font& myFont;
TabWidget* myTab{nullptr};
// Launcher options