diff options
author | Franco M <francomaro@gmail.com> | 2023-11-04 21:28:16 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-04 21:28:16 -0300 |
commit | 728aca770317b3f86961c8669ba9ae5c68570d3f (patch) | |
tree | 29adffcb1d264cc16cacb478a8f6645ef6259b3b /src/yuzu/main.h | |
parent | 7f62a48ab507d3874378c10944662d5b841c6c2e (diff) | |
parent | 940618a64dc048790291e240dca6a085a4f1c27c (diff) |
Merge branch 'master' into new-shortcut
Diffstat (limited to 'src/yuzu/main.h')
-rw-r--r-- | src/yuzu/main.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index d203e5301..f67c4cfda 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -9,6 +9,7 @@ #include <filesystem> #include <QMainWindow> #include <QMessageBox> +#include <QPushButton> #include <QTimer> #include <QTranslator> @@ -138,6 +139,28 @@ namespace VkDeviceInfo { class Record; } +class VolumeButton : public QPushButton { + Q_OBJECT +public: + explicit VolumeButton(QWidget* parent = nullptr) : QPushButton(parent), scroll_multiplier(1) { + connect(&scroll_timer, &QTimer::timeout, this, &VolumeButton::ResetMultiplier); + } + +signals: + void VolumeChanged(); + +protected: + void wheelEvent(QWheelEvent* event) override; + +private slots: + void ResetMultiplier(); + +private: + int scroll_multiplier; + QTimer scroll_timer; + constexpr static int MaxMultiplier = 8; +}; + class GMainWindow : public QMainWindow { Q_OBJECT @@ -492,7 +515,7 @@ private: QPushButton* dock_status_button = nullptr; QPushButton* filter_status_button = nullptr; QPushButton* aa_status_button = nullptr; - QPushButton* volume_button = nullptr; + VolumeButton* volume_button = nullptr; QWidget* volume_popup = nullptr; QSlider* volume_slider = nullptr; QTimer status_bar_update_timer; |