Add hotkey to toggle screen emphasis

Toggles which screen is emphasized when the screen sizing is set to
emphasize top or bottom. (Closes issue #1565)
This commit is contained in:
Nadia Holmquist Pedersen
2023-02-17 04:21:52 +01:00
parent 00edeb3c3c
commit 382155e6fe
5 changed files with 23 additions and 3 deletions

View File

@ -426,6 +426,7 @@ EmuThread::EmuThread(QObject* parent) : QThread(parent)
connect(this, SIGNAL(screenLayoutChange()), mainWindow->panelWidget, SLOT(onScreenLayoutChanged()));
connect(this, SIGNAL(windowFullscreenToggle()), mainWindow, SLOT(onFullscreenToggled()));
connect(this, SIGNAL(swapScreensToggle()), mainWindow->actScreenSwap, SLOT(trigger()));
connect(this, SIGNAL(screenEmphasisToggle()), mainWindow, SLOT(onScreenEmphasisToggled()));
static_cast<ScreenPanelGL*>(mainWindow->panel)->transferLayout(this);
}
@ -596,6 +597,7 @@ void EmuThread::run()
if (Input::HotkeyPressed(HK_FullscreenToggle)) emit windowFullscreenToggle();
if (Input::HotkeyPressed(HK_SwapScreens)) emit swapScreensToggle();
if (Input::HotkeyPressed(HK_SwapScreenEmphasis)) emit screenEmphasisToggle();
if (Input::HotkeyPressed(HK_SolarSensorDecrease))
{
@ -3287,6 +3289,17 @@ void MainWindow::onFullscreenToggled()
ToggleFullscreen(this);
}
void MainWindow::onScreenEmphasisToggled() {
int currentSizing = Config::ScreenSizing;
if (currentSizing == screenSizing_EmphTop) {
Config::ScreenSizing = screenSizing_EmphBot;
} else if (currentSizing == screenSizing_EmphBot) {
Config::ScreenSizing = screenSizing_EmphTop;
}
emit screenLayoutChange();
}
void MainWindow::onEmuStart()
{
for (int i = 1; i < 9; i++)