Add Deep Color option to LaunchMenu

This commit is contained in:
Jack Andersen 2018-01-15 20:41:52 -10:00
parent b4972dbad9
commit ac46503212
2 changed files with 19 additions and 1 deletions

View File

@ -37,13 +37,15 @@ LaunchMenu::LaunchMenu(hecl::CVarCommons& commons, QWidget* parent)
initAnisoAction(QStringLiteral("8"));
initAnisoAction(QStringLiteral("16"));
initDeveloperMode();
m_apiMenu.addActions(m_apiGroup.actions());
m_msaaMenu.addActions(m_msaaGroup.actions());
m_anisoMenu.addActions(m_anisoGroup.actions());
addMenu(&m_apiMenu);
addMenu(&m_msaaMenu);
addMenu(&m_anisoMenu);
initDeepColor();
initDeveloperMode();
}
void LaunchMenu::initApiAction(const QString& action)
@ -73,6 +75,14 @@ void LaunchMenu::initAnisoAction(const QString& action)
act->setChecked(true);
}
void LaunchMenu::initDeepColor()
{
QAction* act = addAction("Deep Color");
act->setCheckable(true);
act->setChecked(m_commons.getDeepColor());
connect(act, SIGNAL(triggered()), this, SLOT(deepColorTriggered()));
}
void LaunchMenu::initDeveloperMode()
{
QAction* act = addAction("&Developer Mode");
@ -101,6 +111,12 @@ void LaunchMenu::anisoTriggered()
m_commons.serialize();
}
void LaunchMenu::deepColorTriggered()
{
m_commons.setDeepColor(qobject_cast<QAction*>(sender())->isChecked());
m_commons.serialize();
}
void LaunchMenu::developerModeTriggered()
{
hecl::CVarManager::instance()->setDeveloperMode(qobject_cast<QAction*>(sender())->isChecked(), true);

View File

@ -20,6 +20,7 @@ class LaunchMenu : public QMenu
void initApiAction(const QString& action);
void initMsaaAction(const QString& action);
void initAnisoAction(const QString& action);
void initDeepColor();
void initDeveloperMode();
public:
@ -29,6 +30,7 @@ public slots:
void apiTriggered();
void msaaTriggered();
void anisoTriggered();
void deepColorTriggered();
void developerModeTriggered();
};