Qt: Add a method for the emulation thread to focus the display widget
This commit is contained in:
@ -84,11 +84,6 @@ void MainWindow::destroyDisplayWindow()
|
||||
m_display_widget = nullptr;
|
||||
}
|
||||
|
||||
void MainWindow::toggleFullscreen()
|
||||
{
|
||||
setFullscreen(!m_display_widget->isFullScreen());
|
||||
}
|
||||
|
||||
void MainWindow::setFullscreen(bool fullscreen)
|
||||
{
|
||||
if (fullscreen)
|
||||
@ -110,6 +105,19 @@ void MainWindow::setFullscreen(bool fullscreen)
|
||||
m_ui.actionFullscreen->setChecked(fullscreen);
|
||||
}
|
||||
|
||||
void MainWindow::toggleFullscreen()
|
||||
{
|
||||
setFullscreen(!m_display_widget->isFullScreen());
|
||||
}
|
||||
|
||||
void MainWindow::focusDisplayWidget()
|
||||
{
|
||||
if (m_ui.mainContainer->currentIndex() != 1)
|
||||
return;
|
||||
|
||||
m_display_widget->setFocus();
|
||||
}
|
||||
|
||||
void MainWindow::onEmulationStarted()
|
||||
{
|
||||
m_emulation_running = true;
|
||||
@ -349,6 +357,7 @@ void MainWindow::connectSignals()
|
||||
connect(m_host_interface, &QtHostInterface::destroyDisplayWindowRequested, this, &MainWindow::destroyDisplayWindow);
|
||||
connect(m_host_interface, &QtHostInterface::setFullscreenRequested, this, &MainWindow::setFullscreen);
|
||||
connect(m_host_interface, &QtHostInterface::toggleFullscreenRequested, this, &MainWindow::toggleFullscreen);
|
||||
connect(m_host_interface, &QtHostInterface::focusDisplayWidgetRequested, this, &MainWindow::focusDisplayWidget);
|
||||
connect(m_host_interface, &QtHostInterface::emulationStarted, this, &MainWindow::onEmulationStarted);
|
||||
connect(m_host_interface, &QtHostInterface::emulationStopped, this, &MainWindow::onEmulationStopped);
|
||||
connect(m_host_interface, &QtHostInterface::emulationPaused, this, &MainWindow::onEmulationPaused);
|
||||
|
||||
Reference in New Issue
Block a user