diff options
| -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) { | |||
| 420 | render_window->setFocus(); | 420 | render_window->setFocus(); |
| 421 | 421 | ||
| 422 | emulation_running = true; | 422 | emulation_running = true; |
| 423 | ToggleFullscreen(); | 423 | if (ui.action_Fullscreen->isChecked()) { |
| 424 | ShowFullscreen(); | ||
| 425 | } | ||
| 424 | OnStartGame(); | 426 | OnStartGame(); |
| 425 | } | 427 | } |
| 426 | 428 | ||
| @@ -572,21 +574,33 @@ void GMainWindow::ToggleFullscreen() { | |||
| 572 | return; | 574 | return; |
| 573 | } | 575 | } |
| 574 | if (ui.action_Fullscreen->isChecked()) { | 576 | if (ui.action_Fullscreen->isChecked()) { |
| 575 | if (ui.action_Single_Window_Mode->isChecked()) { | 577 | ShowFullscreen(); |
| 576 | ui.menubar->hide(); | ||
| 577 | statusBar()->hide(); | ||
| 578 | showFullScreen(); | ||
| 579 | } else { | ||
| 580 | render_window->showFullScreen(); | ||
| 581 | } | ||
| 582 | } else { | 578 | } else { |
| 583 | if (ui.action_Single_Window_Mode->isChecked()) { | 579 | HideFullscreen(); |
| 584 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); | 580 | } |
| 585 | ui.menubar->show(); | 581 | } |
| 586 | showNormal(); | 582 | |
| 587 | } else { | 583 | void GMainWindow::ShowFullscreen() { |
| 588 | render_window->showNormal(); | 584 | if (ui.action_Single_Window_Mode->isChecked()) { |
| 589 | } | 585 | UISettings::values.geometry = saveGeometry(); |
| 586 | ui.menubar->hide(); | ||
| 587 | statusBar()->hide(); | ||
| 588 | showFullScreen(); | ||
| 589 | } else { | ||
| 590 | UISettings::values.renderwindow_geometry = render_window->saveGeometry(); | ||
| 591 | render_window->showFullScreen(); | ||
| 592 | } | ||
| 593 | } | ||
| 594 | |||
| 595 | void GMainWindow::HideFullscreen() { | ||
| 596 | if (ui.action_Single_Window_Mode->isChecked()) { | ||
| 597 | statusBar()->setVisible(ui.action_Show_Status_Bar->isChecked()); | ||
| 598 | ui.menubar->show(); | ||
| 599 | showNormal(); | ||
| 600 | restoreGeometry(UISettings::values.geometry); | ||
| 601 | } else { | ||
| 602 | render_window->showNormal(); | ||
| 603 | render_window->restoreGeometry(UISettings::values.renderwindow_geometry); | ||
| 590 | } | 604 | } |
| 591 | } | 605 | } |
| 592 | 606 | ||
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: | |||
| 128 | void OnToggleFilterBar(); | 128 | void OnToggleFilterBar(); |
| 129 | void OnDisplayTitleBars(bool); | 129 | void OnDisplayTitleBars(bool); |
| 130 | void ToggleFullscreen(); | 130 | void ToggleFullscreen(); |
| 131 | void ShowFullscreen(); | ||
| 132 | void HideFullscreen(); | ||
| 131 | void ToggleWindowMode(); | 133 | void ToggleWindowMode(); |
| 132 | void OnCoreError(Core::System::ResultStatus, std::string); | 134 | void OnCoreError(Core::System::ResultStatus, std::string); |
| 133 | 135 | ||