Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/frontend/qt_sdl/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ LegacyEntry LegacyFile[] =
{"HKKey_FastForward", 0, "Keyboard.HK_FastForward", true},
{"HKKey_FastForwardToggle", 0, "Keyboard.HK_FrameLimitToggle", true},
{"HKKey_FullscreenToggle", 0, "Keyboard.HK_FullscreenToggle", true},
{"HKKey_MenuBarToggle", 0, "Keyboard.HK_MenuBarToggle", true},
{"HKKey_SwapScreens", 0, "Keyboard.HK_SwapScreens", true},
{"HKKey_SwapScreenEmphasis", 0, "Keyboard.HK_SwapScreenEmphasis", true},
{"HKKey_SolarSensorDecrease", 0, "Keyboard.HK_SolarSensorDecrease", true},
Expand All @@ -182,6 +183,7 @@ LegacyEntry LegacyFile[] =
{"HKJoy_FastForward", 0, "Joystick.HK_FastForward", true},
{"HKJoy_FastForwardToggle", 0, "Joystick.HK_FrameLimitToggle", true},
{"HKJoy_FullscreenToggle", 0, "Joystick.HK_FullscreenToggle", true},
{"HKJoy_MenuBarToggle", 0, "Joystick.HK_MenuBarToggle", true},
{"HKJoy_SwapScreens", 0, "Joystick.HK_SwapScreens", true},
{"HKJoy_SwapScreenEmphasis", 0, "Joystick.HK_SwapScreenEmphasis", true},
{"HKJoy_SolarSensorDecrease", 0, "Joystick.HK_SolarSensorDecrease", true},
Expand Down
1 change: 1 addition & 0 deletions src/frontend/qt_sdl/EmuInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum
HK_GuitarGripRed,
HK_GuitarGripYellow,
HK_GuitarGripBlue,
HK_MenuBarToggle,
HK_MAX
};

Expand Down
1 change: 1 addition & 0 deletions src/frontend/qt_sdl/EmuInstanceInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const char* EmuInstance::hotkeyNames[HK_MAX] =
"HK_FastForward",
"HK_FrameLimitToggle",
"HK_FullscreenToggle",
"HK_MenuBarToggle",
"HK_SwapScreens",
"HK_SwapScreenEmphasis",
"HK_SolarSensorDecrease",
Expand Down
3 changes: 3 additions & 0 deletions src/frontend/qt_sdl/EmuThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void EmuThread::attachWindow(MainWindow* window)
connect(this, SIGNAL(windowEmuReset()), window, SLOT(onEmuReset()));
connect(this, SIGNAL(autoScreenSizingChange(int)), window->panel, SLOT(onAutoScreenSizingChanged(int)));
connect(this, SIGNAL(windowFullscreenToggle()), window, SLOT(onFullscreenToggled()));
connect(this, SIGNAL(windowMenuBarToggle()), window, SLOT(onMenuBarToggled()));
connect(this, SIGNAL(screenEmphasisToggle()), window, SLOT(onScreenEmphasisToggled()));

if (window->winHasMenu())
Expand All @@ -94,6 +95,7 @@ void EmuThread::detachWindow(MainWindow* window)
disconnect(this, SIGNAL(windowEmuReset()), window, SLOT(onEmuReset()));
disconnect(this, SIGNAL(autoScreenSizingChange(int)), window->panel, SLOT(onAutoScreenSizingChanged(int)));
disconnect(this, SIGNAL(windowFullscreenToggle()), window, SLOT(onFullscreenToggled()));
disconnect(this, SIGNAL(windowMenuBarToggle()), window, SLOT(onMenuBarToggled()));
disconnect(this, SIGNAL(screenEmphasisToggle()), window, SLOT(onScreenEmphasisToggled()));

if (window->winHasMenu())
Expand Down Expand Up @@ -164,6 +166,7 @@ void EmuThread::run()
if (emuInstance->hotkeyPressed(HK_FrameStep)) emuFrameStep();

if (emuInstance->hotkeyPressed(HK_FullscreenToggle)) emit windowFullscreenToggle();
if (emuInstance->hotkeyPressed(HK_MenuBarToggle)) emit windowMenuBarToggle();

if (emuInstance->hotkeyPressed(HK_SwapScreens)) emit swapScreensToggle();
if (emuInstance->hotkeyPressed(HK_SwapScreenEmphasis)) emit screenEmphasisToggle();
Expand Down
1 change: 1 addition & 0 deletions src/frontend/qt_sdl/EmuThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class EmuThread : public QThread
void autoScreenSizingChange(int sizing);

void windowFullscreenToggle();
void windowMenuBarToggle();

void swapScreensToggle();
void screenEmphasisToggle();
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/qt_sdl/InputConfig/InputConfigDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static constexpr std::initializer_list<int> hk_general =
HK_SlowMoToggle,
HK_FrameLimitToggle,
HK_FullscreenToggle,
HK_MenuBarToggle,
HK_Lid,
HK_Mic,
HK_SwapScreens,
Expand All @@ -82,6 +83,7 @@ static constexpr std::initializer_list<const char*> hk_general_labels =
"Toggle slow mo",
"Toggle FPS limit",
"Toggle fullscreen",
"Toggle menu bar",
"Close/open lid",
"Microphone",
"Swap screens",
Expand Down
14 changes: 14 additions & 0 deletions src/frontend/qt_sdl/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,20 @@ void MainWindow::onFullscreenToggled()
toggleFullscreen();
}

void MainWindow::onMenuBarToggled()
{
if (!hasMenu) return;
if (menuBar()->maximumHeight() != 0)
{
menuBar()->setFixedHeight(0);
}
else
{
int menuBarHeight = menuBar()->sizeHint().height();
menuBar()->setFixedHeight(menuBarHeight);
}
}

void MainWindow::onScreenEmphasisToggled()
{
int currentSizing = windowCfg.GetInt("ScreenSizing");
Expand Down
1 change: 1 addition & 0 deletions src/frontend/qt_sdl/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private slots:
void onUpdateVideoSettings(bool glchange);

void onFullscreenToggled();
void onMenuBarToggled();
void onScreenEmphasisToggled();

private:
Expand Down