mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Merge pull request #2390 from darkengine-io/new-qt
More miscellaneous Qt fixes
This commit is contained in:
@ -78,6 +78,7 @@ DMainWindow::DMainWindow(QWidget* parent_widget)
|
||||
connect(m_ui->actionGitHub, SIGNAL(triggered()), this, SLOT(OnOpenGitHub()));
|
||||
connect(m_ui->actionSystemInfo, SIGNAL(triggered()), this, SLOT(OnOpenSystemInfo()));
|
||||
connect(m_ui->actionAbout, SIGNAL(triggered()), this, SLOT(OnOpenAbout()));
|
||||
connect(m_ui->actionAboutQt, SIGNAL(triggered()), this, SLOT(OnOpenAboutQt()));
|
||||
|
||||
// Update GUI items
|
||||
emit CoreStateChanged(Core::CORE_UNINITIALIZED);
|
||||
@ -92,6 +93,11 @@ DMainWindow::~DMainWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void DMainWindow::closeEvent(QCloseEvent* ce)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
// Emulation
|
||||
|
||||
void DMainWindow::StartGame(const QString filename)
|
||||
@ -111,9 +117,15 @@ void DMainWindow::StartGame(const QString filename)
|
||||
m_ui->centralWidget->addWidget(m_render_widget.get());
|
||||
m_ui->centralWidget->setCurrentWidget(m_render_widget.get());
|
||||
|
||||
// TODO: When rendering to main, this won't resize the parent window...
|
||||
m_render_widget->resize(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth,
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize)
|
||||
{
|
||||
// Resize main window to fit render
|
||||
m_render_widget->setMinimumSize(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth,
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight);
|
||||
qApp->processEvents(); // Force a redraw so the window has time to resize
|
||||
m_render_widget->setMinimumSize(0, 0); // Allow the widget to scale down
|
||||
}
|
||||
m_render_widget->adjustSize();
|
||||
}
|
||||
|
||||
if (!BootManager::BootCore(filename.toStdString()))
|
||||
@ -351,3 +363,8 @@ void DMainWindow::OnOpenAbout()
|
||||
DAboutDialog* dlg = new DAboutDialog(this);
|
||||
dlg->open();
|
||||
}
|
||||
|
||||
void DMainWindow::OnOpenAboutQt()
|
||||
{
|
||||
QApplication::aboutQt();
|
||||
}
|
||||
|
Reference in New Issue
Block a user