Merge pull request #6750 from spycrab/qt_render_widget

Qt: Fix multiple RenderWidget issues
This commit is contained in:
Anthony 2018-05-05 18:39:40 -07:00 committed by GitHub
commit 2588b5e40e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -619,9 +619,14 @@ void MainWindow::FullScreen()
bool was_fullscreen = m_render_widget->isFullScreen();
HideRenderWidget(false);
if (was_fullscreen)
{
ShowRenderWidget();
}
else
{
m_render_widget_size = m_render_widget->size();
m_render_widget->showFullScreen();
}
}
void MainWindow::ScreenShot()
@ -691,7 +696,7 @@ void MainWindow::ShowRenderWidget()
m_rendering_to_main = false;
m_render_widget->showNormal();
m_render_widget->resize(640, 480);
m_render_widget->resize(m_render_widget_size);
}
}

View File

@ -191,4 +191,5 @@ private:
RegisterWidget* m_register_widget;
WatchWidget* m_watch_widget;
CheatsManager* m_cheats_manager;
QSize m_render_widget_size{640, 480};
};

View File

@ -5,6 +5,7 @@
#include <QApplication>
#include <QDesktopWidget>
#include <QGuiApplication>
#include <QIcon>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QPalette>
@ -18,10 +19,14 @@
#include "DolphinQt2/Host.h"
#include "DolphinQt2/RenderWidget.h"
#include "DolphinQt2/Resources.h"
#include "DolphinQt2/Settings.h"
RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent)
{
setWindowTitle(QStringLiteral("Dolphin"));
setWindowIcon(Resources::GetAppIcon());
QPalette p;
p.setColor(QPalette::Background, Qt::black);
setPalette(p);