diff options
author | goaaats <fakecake@icloud.com> | 2018-01-16 15:59:30 +0100 |
---|---|---|
committer | goaaats <fakecake@icloud.com> | 2018-01-16 15:59:30 +0100 |
commit | 8cdc1be0df83b6070aed28be15ed0000cc81c05b (patch) | |
tree | 65d8b5d61324421eed4a1d11ff768a1cb0404b92 /src | |
parent | Merge citra-emu PR#3001 by Styleoshin(citra-qt : Adding fullscreen mode) (diff) | |
download | yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.tar yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.tar.gz yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.tar.bz2 yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.tar.lz yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.tar.xz yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.tar.zst yuzu-8cdc1be0df83b6070aed28be15ed0000cc81c05b.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/main.cpp | 44 | ||||
-rw-r--r-- | src/yuzu/main.h | 2 |
2 files changed, 31 insertions, 15 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5e321095d..51d7f9418 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -420,7 +420,9 @@ void GMainWindow::BootGame(const QString& filename) { render_window->setFocus(); emulation_running = true; - ToggleFullscreen(); + if (ui.action_Fullscreen->isChecked()) { + ShowFullscreen(); + } OnStartGame(); } @@ -572,21 +574,33 @@ void GMainWindow::ToggleFullscreen() { return; } if (ui.action_Fullscreen->isChecked()) { - if (ui.action_Single_Window_Mode->isChecked()) { - ui.menubar->hide(); - statusBar()->hide(); - showFullScreen(); - } else { - render_window->showFullScreen(); - } + ShowFullscreen(); } else { - if (ui.action_Single_Window_Mode->isChecked()) { - statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); - ui.menubar->show(); - showNormal(); - } else { - render_window->showNormal(); - } + HideFullscreen(); + } +} + +void GMainWindow::ShowFullscreen() { + if (ui.action_Single_Window_Mode->isChecked()) { + UISettings::values.geometry = saveGeometry(); + ui.menubar->hide(); + statusBar()->hide(); + showFullScreen(); + } else { + UISettings::values.renderwindow_geometry = render_window->saveGeometry(); + render_window->showFullScreen(); + } +} + +void GMainWindow::HideFullscreen() { + if (ui.action_Single_Window_Mode->isChecked()) { + statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); + ui.menubar->show(); + showNormal(); + restoreGeometry(UISettings::values.geometry); + } else { + render_window->showNormal(); + render_window->restoreGeometry(UISettings::values.renderwindow_geometry); } } diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 04bb887ae..4a0d912bb 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -128,6 +128,8 @@ private slots: void OnToggleFilterBar(); void OnDisplayTitleBars(bool); void ToggleFullscreen(); + void ShowFullscreen(); + void HideFullscreen(); void ToggleWindowMode(); void OnCoreError(Core::System::ResultStatus, std::string); |