summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2022-07-29 00:41:37 +0200
committerGitHub <noreply@github.com>2022-07-29 00:41:37 +0200
commit880006c5ca84aa31836e461df2311d84558b8e8e (patch)
treeeeac46984a4754f9b6e06f9d57cb2081a0e68cbb
parentMerge pull request #8349 from yuzu-emu/revert-8256-ci-vs-2022 (diff)
parentyuzu: Add incremental steps to volume hotkeys (diff)
downloadyuzu-880006c5ca84aa31836e461df2311d84558b8e8e.tar
yuzu-880006c5ca84aa31836e461df2311d84558b8e8e.tar.gz
yuzu-880006c5ca84aa31836e461df2311d84558b8e8e.tar.bz2
yuzu-880006c5ca84aa31836e461df2311d84558b8e8e.tar.lz
yuzu-880006c5ca84aa31836e461df2311d84558b8e8e.tar.xz
yuzu-880006c5ca84aa31836e461df2311d84558b8e8e.tar.zst
yuzu-880006c5ca84aa31836e461df2311d84558b8e8e.zip
-rw-r--r--src/yuzu/main.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e8a57f4b4..f8c234082 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1076,12 +1076,26 @@ void GMainWindow::InitializeHotkeys() {
[] { Settings::values.audio_muted = !Settings::values.audio_muted; });
connect_shortcut(QStringLiteral("Audio Volume Down"), [] {
const auto current_volume = static_cast<int>(Settings::values.volume.GetValue());
- const auto new_volume = std::max(current_volume - 5, 0);
+ int step = 5;
+ if (current_volume <= 30) {
+ step = 2;
+ }
+ if (current_volume <= 6) {
+ step = 1;
+ }
+ const auto new_volume = std::max(current_volume - step, 0);
Settings::values.volume.SetValue(static_cast<u8>(new_volume));
});
connect_shortcut(QStringLiteral("Audio Volume Up"), [] {
const auto current_volume = static_cast<int>(Settings::values.volume.GetValue());
- const auto new_volume = std::min(current_volume + 5, 100);
+ int step = 5;
+ if (current_volume < 30) {
+ step = 2;
+ }
+ if (current_volume < 6) {
+ step = 1;
+ }
+ const auto new_volume = std::min(current_volume + step, 100);
Settings::values.volume.SetValue(static_cast<u8>(new_volume));
});
connect_shortcut(QStringLiteral("Toggle Framerate Limit"), [] {