From bf25d583c6279aa425ed3211e1bffd67a5e7646d Mon Sep 17 00:00:00 2001 From: lat9nq Date: Mon, 13 Jul 2020 19:30:11 -0400 Subject: configure_audio: Implement highlighted overrides --- src/yuzu/configuration/configure_audio.cpp | 25 +++-- src/yuzu/configuration/configure_audio.ui | 142 +++++++++++++++-------------- 2 files changed, 87 insertions(+), 80 deletions(-) (limited to 'src') diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index cc021beec..2418ca005 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp @@ -49,12 +49,9 @@ void ConfigureAudio::SetConfiguration() { ui->volume_slider->setValue(Settings::values.volume.GetValue() * ui->volume_slider->maximum()); - if (Settings::configuring_global) { - ui->toggle_audio_stretching->setChecked( - Settings::values.enable_audio_stretching.GetValue()); - } else { - ConfigurationShared::SetPerGameSetting(ui->toggle_audio_stretching, - &Settings::values.enable_audio_stretching); + ui->toggle_audio_stretching->setChecked(Settings::values.enable_audio_stretching.GetValue()); + + if (!Settings::configuring_global) { if (Settings::values.volume.UsingGlobal()) { ui->volume_combo_box->setCurrentIndex(0); ui->volume_slider->setEnabled(false); @@ -62,6 +59,8 @@ void ConfigureAudio::SetConfiguration() { ui->volume_combo_box->setCurrentIndex(1); ui->volume_slider->setEnabled(true); } + ConfigurationShared::SetHighlight(ui->volume_layout, "volume_layout", + !Settings::values.volume.UsingGlobal()); } SetVolumeIndicatorText(ui->volume_slider->sliderPosition()); } @@ -119,8 +118,9 @@ void ConfigureAudio::ApplyConfiguration() { ui->volume_slider->maximum()); } } else { - ConfigurationShared::ApplyPerGameSetting(&Settings::values.enable_audio_stretching, - ui->toggle_audio_stretching); + ConfigurationShared::ApplyPerGameSetting( + &Settings::values.enable_audio_stretching, ui->toggle_audio_stretching, + ConfigurationShared::trackers.enable_audio_stretching); if (ui->volume_combo_box->currentIndex() == 0) { Settings::values.volume.SetGlobal(true); } else { @@ -173,9 +173,14 @@ void ConfigureAudio::SetupPerGameUI() { return; } - ui->toggle_audio_stretching->setTristate(true); + ConfigurationShared::SetColoredTristate(ui->toggle_audio_stretching, "toggle_audio_stretching", + Settings::values.enable_audio_stretching, + ConfigurationShared::trackers.enable_audio_stretching); connect(ui->volume_combo_box, static_cast(&QComboBox::activated), - this, [this](int index) { ui->volume_slider->setEnabled(index == 1); }); + this, [this](int index) { + ui->volume_slider->setEnabled(index == 1); + ConfigurationShared::SetHighlight(ui->volume_layout, "volume_layout", index == 1); + }); ui->output_sink_combo_box->setVisible(false); ui->output_sink_label->setVisible(false); diff --git a/src/yuzu/configuration/configure_audio.ui b/src/yuzu/configuration/configure_audio.ui index 862ccb988..3c1147935 100644 --- a/src/yuzu/configuration/configure_audio.ui +++ b/src/yuzu/configuration/configure_audio.ui @@ -56,80 +56,82 @@ - - - 0 - - - - + + + + 1 + + + + + + Use global volume + + + + + Set volume: + + + + + + - Use global volume + Volume: + + + + + + + Qt::Horizontal + + + + 30 + 20 + + + + + + + + + 0 + 0 + + + + 100 + + + 10 + + + Qt::Horizontal + + + + + + + + 32 + 0 + - - - Set volume: + 0 % - - - - - - - Volume: - - - - - - - Qt::Horizontal - - - - 30 - 20 - - - - - - - - - 0 - 0 - - - - 100 - - - 10 - - - Qt::Horizontal - - - - - - - - 32 - 0 - - - - 0 % - - - Qt::AlignCenter - - - - + + Qt::AlignCenter + + + + + -- cgit v1.2.3