Reshow the play button after game close (#238)

* Add call to update UI after game close

* instead of regenerating the header entirely, just swap the play/pause buttons

* fix uninitialized var,
This commit is contained in:
Tom Boehmer
2026-01-26 20:45:36 +10:00
committed by GitHub
parent c0e4080db3
commit f8ebecb33a

View File

@@ -144,6 +144,19 @@ void MainWindow::onGameClosed() {
EmulatorState::GetInstance()->SetGameRunning(false); EmulatorState::GetInstance()->SetGameRunning(false);
is_paused = false; is_paused = false;
// swap the pause button back to the play button on close
ui->playButton->setVisible(true);
ui->pauseButton->setVisible(false);
if (ui->toggleLabelsAct->isChecked()) {
QLabel* playButtonLabel = ui->playButton->parentWidget()->findChild<QLabel*>();
if (playButtonLabel)
playButtonLabel->setVisible(true);
QLabel* pauseButtonLabel = ui->pauseButton->parentWidget()->findChild<QLabel*>();
if (pauseButtonLabel)
pauseButtonLabel->setVisible(false);
}
// clear dialogs when game closed // clear dialogs when game closed
skylander_dialog* sky_diag = skylander_dialog::get_dlg(this, m_ipc_client); skylander_dialog* sky_diag = skylander_dialog::get_dlg(this, m_ipc_client);
sky_diag->clear_all(); sky_diag->clear_all();