From c753c8f9055c09bd0c6e8fa272355f3ab5359234 Mon Sep 17 00:00:00 2001 From: Sean Maas Date: Thu, 28 May 2015 16:12:10 -0400 Subject: [PATCH] QT: Add a placeholder for the render window when it's hidden --- src/citra_qt/main.cpp | 7 +++++++ src/citra_qt/main.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 626f54a74..1ff8afda8 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -57,6 +57,8 @@ GMainWindow::GMainWindow() : emu_thread(nullptr) ui.setupUi(this); statusBar()->hide(); + render_window_placeholder = new QSpacerItem(400, 480, QSizePolicy::Fixed, QSizePolicy::Fixed); + render_window = new GRenderWindow(this, emu_thread.get()); render_window->hide(); @@ -230,6 +232,7 @@ void GMainWindow::BootGame(std::string filename) { // Update the GUI registersWidget->OnDebugModeEntered(); callstackWidget->OnDebugModeEntered(); + ui.horizontalLayout->removeItem(render_window_placeholder); render_window->show(); OnStartGame(); @@ -259,6 +262,7 @@ void GMainWindow::ShutdownGame() { ui.action_Pause->setEnabled(false); ui.action_Stop->setEnabled(false); render_window->hide(); + ui.horizontalLayout->addSpacerItem(render_window_placeholder); } void GMainWindow::OnMenuLoadFile() @@ -318,11 +322,14 @@ void GMainWindow::ToggleWindowMode() { ui.horizontalLayout->addWidget(render_window); if (emu_thread != nullptr) render_window->setVisible(true); + else + ui.horizontalLayout->addSpacerItem(render_window_placeholder); render_window->setFocusPolicy(Qt::ClickFocus); render_window->setFocus(); } else { // Render in a separate window... + ui.horizontalLayout->removeItem(render_window_placeholder); ui.horizontalLayout->removeWidget(render_window); render_window->setParent(nullptr); if (emu_thread != nullptr) diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 242b08c39..814d4de31 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -75,6 +75,7 @@ private slots: private: Ui::MainWindow ui; + QSpacerItem* render_window_placeholder; GRenderWindow* render_window; std::unique_ptr emu_thread;