From 2b42ba5510992b3a52177714e6d72138ccf0fc37 Mon Sep 17 00:00:00 2001 From: LittleWhite Date: Wed, 2 Sep 2015 00:28:47 +0200 Subject: [PATCH] Add final for internal widget classes Improve comments Hide the render_window when stopping emulation --- src/citra_qt/bootmanager.cpp | 8 +- src/citra_qt/data/citra.svg | 187 ++++++++++++++++++++--------------- src/citra_qt/main.cpp | 1 + 3 files changed, 113 insertions(+), 83 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 51da6c977..14ad4efaa 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -78,7 +78,7 @@ void EmuThread::run() { // This class overrides paintEvent and resizeEvent to prevent the GUI thread from stealing GL context. // The corresponding functionality is handled in EmuThread instead -class GGLWidgetInternal : public QGLWidget +class GGLWidgetInternal final : public QGLWidget { public: GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) @@ -97,7 +97,7 @@ private: GRenderWindow* parent; }; -class GSplashWidgetInternal : public QWidget +class GSplashWidgetInternal final : public QWidget { public: GSplashWidgetInternal(QWidget* parent) @@ -296,7 +296,7 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pairemu_thread = emu_thread; - // Swaps to put in front the render widget + // Put render widget in front active_widget=render_widget; layout->removeWidget(splash_widget); layout->addWidget(render_widget); @@ -307,7 +307,7 @@ void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) { void GRenderWindow::OnEmulationStopping() { emu_thread = nullptr; - // Swaps back the splash widget + // Put splash widget in front active_widget=splash_widget; layout->removeWidget(render_widget); layout->addWidget(splash_widget); diff --git a/src/citra_qt/data/citra.svg b/src/citra_qt/data/citra.svg index 7b299cd89..b8143e0a9 100644 --- a/src/citra_qt/data/citra.svg +++ b/src/citra_qt/data/citra.svg @@ -1,80 +1,109 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index d3ffc993c..9ff840ced 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -290,6 +290,7 @@ void GMainWindow::ShutdownGame() { ui.action_Start->setText(tr("Start")); ui.action_Pause->setEnabled(false); ui.action_Stop->setEnabled(false); + render_window->hide(); } void GMainWindow::StoreRecentFile(const QString& filename)