mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-05-18 01:14:56 +00:00
Change Background Image for games (#2334)
* Added opacity change instead of blur for background image * Fixed integer overflow when refreshing grid list * Added slider to control background image opacity * Added show background image button * Added UI code for checkbox and English and Spanish translations for new UI elements * Removed background image caching * Background image update on apply/save * Only recompute image if opacity or game changes * Fixed segfault when trying to change opacity after table refresh * Placed background image settings under GUI in settings file
This commit is contained in:
parent
363604c6f0
commit
b6ad512e34
13 changed files with 279 additions and 56 deletions
|
@ -173,6 +173,9 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
|||
{
|
||||
connect(ui->chooseHomeTabComboBox, &QComboBox::currentTextChanged, this,
|
||||
[](const QString& hometab) { Config::setChooseHomeTab(hometab.toStdString()); });
|
||||
|
||||
connect(ui->showBackgroundImageCheckBox, &QCheckBox::stateChanged, this,
|
||||
[](int state) { Config::setShowBackgroundImage(state == Qt::Checked); });
|
||||
}
|
||||
// Input TAB
|
||||
{
|
||||
|
@ -251,6 +254,7 @@ SettingsDialog::SettingsDialog(std::span<const QString> physical_devices,
|
|||
#ifdef ENABLE_UPDATER
|
||||
ui->updaterGroupBox->installEventFilter(this);
|
||||
#endif
|
||||
ui->GUIBackgroundImageGroupBox->installEventFilter(this);
|
||||
ui->GUIMusicGroupBox->installEventFilter(this);
|
||||
ui->disableTrophycheckBox->installEventFilter(this);
|
||||
ui->enableCompatibilityCheckBox->installEventFilter(this);
|
||||
|
@ -410,6 +414,8 @@ void SettingsDialog::LoadValuesFromConfig() {
|
|||
|
||||
ui->removeFolderButton->setEnabled(!ui->gameFoldersListWidget->selectedItems().isEmpty());
|
||||
ResetInstallFolders();
|
||||
ui->backgroundImageOpacitySlider->setValue(Config::getBackgroundImageOpacity());
|
||||
ui->showBackgroundImageCheckBox->setChecked(Config::getShowBackgroundImage());
|
||||
}
|
||||
|
||||
void SettingsDialog::InitializeEmulatorLanguages() {
|
||||
|
@ -504,6 +510,8 @@ void SettingsDialog::updateNoteTextEdit(const QString& elementName) {
|
|||
} else if (elementName == "updaterGroupBox") {
|
||||
text = tr("updaterGroupBox");
|
||||
#endif
|
||||
} else if (elementName == "GUIBackgroundImageGroupBox") {
|
||||
text = tr("GUIBackgroundImageGroupBox");
|
||||
} else if (elementName == "GUIMusicGroupBox") {
|
||||
text = tr("GUIMusicGroupBox");
|
||||
} else if (elementName == "disableTrophycheckBox") {
|
||||
|
@ -638,6 +646,9 @@ void SettingsDialog::UpdateSettings() {
|
|||
Config::setChooseHomeTab(ui->chooseHomeTabComboBox->currentText().toStdString());
|
||||
Config::setCompatibilityEnabled(ui->enableCompatibilityCheckBox->isChecked());
|
||||
Config::setCheckCompatibilityOnStartup(ui->checkCompatibilityOnStartupCheckBox->isChecked());
|
||||
Config::setBackgroundImageOpacity(ui->backgroundImageOpacitySlider->value());
|
||||
emit BackgroundOpacityChanged(ui->backgroundImageOpacitySlider->value());
|
||||
Config::setShowBackgroundImage(ui->showBackgroundImageCheckBox->isChecked());
|
||||
|
||||
#ifdef ENABLE_DISCORD_RPC
|
||||
auto* rpc = Common::Singleton<DiscordRPCHandler::RPC>::Instance();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue