mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-03 16:02:26 +00:00
Toggle pause and play icons and label to "Resume" when paused.
This commit is contained in:
parent
d73a0eb8bf
commit
947c86c474
@ -138,6 +138,8 @@ void MainWindow::PauseGame() {
|
|||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
SDL_memset(&event, 0, sizeof(event));
|
SDL_memset(&event, 0, sizeof(event));
|
||||||
event.type = SDL_EVENT_TOGGLE_PAUSE;
|
event.type = SDL_EVENT_TOGGLE_PAUSE;
|
||||||
|
is_paused = !is_paused;
|
||||||
|
UpdateToolbarButtons();
|
||||||
SDL_PushEvent(&event);
|
SDL_PushEvent(&event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,10 +222,6 @@ void MainWindow::AddUiWidgets() {
|
|||||||
ui->pauseButton->setVisible(false);
|
ui->pauseButton->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::UpdateToolbarLabels() {
|
|
||||||
AddUiWidgets();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::UpdateToolbarButtons() {
|
void MainWindow::UpdateToolbarButtons() {
|
||||||
// add toolbar widgets for when game is running
|
// add toolbar widgets for when game is running
|
||||||
bool showLabels = ui->toggleLabelsAct->isChecked();
|
bool showLabels = ui->toggleLabelsAct->isChecked();
|
||||||
@ -241,8 +239,17 @@ void MainWindow::UpdateToolbarButtons() {
|
|||||||
ui->playButton->setVisible(false);
|
ui->playButton->setVisible(false);
|
||||||
ui->pauseButton->setVisible(true);
|
ui->pauseButton->setVisible(true);
|
||||||
|
|
||||||
|
if (is_paused) {
|
||||||
|
ui->pauseButton->setIcon(ui->playButton->icon());
|
||||||
|
ui->pauseButton->setToolTip(tr("Resume"));
|
||||||
|
} else {
|
||||||
|
ui->pauseButton->setIcon(RecolorIcon(QIcon(":images/pause_icon.png"), isWhite));
|
||||||
|
ui->pauseButton->setToolTip(tr("Pause"));
|
||||||
|
}
|
||||||
|
|
||||||
buttonLayout->addWidget(createButtonWithLabel(ui->playButton, tr("Play"), false));
|
buttonLayout->addWidget(createButtonWithLabel(ui->playButton, tr("Play"), false));
|
||||||
buttonLayout->addWidget(createButtonWithLabel(ui->pauseButton, tr("Pause"), showLabels));
|
buttonLayout->addWidget(
|
||||||
|
createButtonWithLabel(ui->pauseButton, is_paused ? tr("Resume") : tr("Pause"), showLabels));
|
||||||
buttonLayout->addWidget(createButtonWithLabel(ui->stopButton, tr("Stop"), showLabels));
|
buttonLayout->addWidget(createButtonWithLabel(ui->stopButton, tr("Stop"), showLabels));
|
||||||
buttonLayout->addWidget(createButtonWithLabel(ui->settingsButton, tr("Settings"), showLabels));
|
buttonLayout->addWidget(createButtonWithLabel(ui->settingsButton, tr("Settings"), showLabels));
|
||||||
buttonLayout->addWidget(
|
buttonLayout->addWidget(
|
||||||
@ -266,6 +273,10 @@ void MainWindow::UpdateToolbarButtons() {
|
|||||||
ui->toolBar->addWidget(toolbarContainer);
|
ui->toolBar->addWidget(toolbarContainer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::UpdateToolbarLabels() {
|
||||||
|
AddUiWidgets();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::CreateDockWindows() {
|
void MainWindow::CreateDockWindows() {
|
||||||
// place holder widget is needed for good health they say :)
|
// place holder widget is needed for good health they say :)
|
||||||
QWidget* phCentralWidget = new QWidget(this);
|
QWidget* phCentralWidget = new QWidget(this);
|
||||||
|
@ -82,6 +82,9 @@ private:
|
|||||||
bool isIconBlack = false;
|
bool isIconBlack = false;
|
||||||
bool isTableList = true;
|
bool isTableList = true;
|
||||||
bool isGameRunning = false;
|
bool isGameRunning = false;
|
||||||
|
bool isWhite = false;
|
||||||
|
bool is_paused = false;
|
||||||
|
|
||||||
QActionGroup* m_icon_size_act_group = nullptr;
|
QActionGroup* m_icon_size_act_group = nullptr;
|
||||||
QActionGroup* m_list_mode_act_group = nullptr;
|
QActionGroup* m_list_mode_act_group = nullptr;
|
||||||
QActionGroup* m_theme_act_group = nullptr;
|
QActionGroup* m_theme_act_group = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user