Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #9155 from JosJuice/tas-slider-right-click
DolphinQt: Reset TAS input slider to default on right-click
- Loading branch information
Showing
8 changed files
with
96 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #include "DolphinQt/TAS/TASSlider.h" | ||
|
|
||
| #include <QMouseEvent> | ||
|
|
||
| TASSlider::TASSlider(int default_, QWidget* parent) : QSlider(parent), m_default(default_) | ||
| { | ||
| } | ||
|
|
||
| TASSlider::TASSlider(int default_, Qt::Orientation orientation, QWidget* parent) | ||
| : QSlider(orientation, parent), m_default(default_) | ||
| { | ||
| } | ||
|
|
||
| void TASSlider::mouseReleaseEvent(QMouseEvent* event) | ||
| { | ||
| if (event->button() == Qt::RightButton) | ||
| setValue(m_default); | ||
| else | ||
| QSlider::mouseReleaseEvent(event); | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Copyright 2020 Dolphin Emulator Project | ||
| // Licensed under GPLv2+ | ||
| // Refer to the license.txt file included. | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <QSlider> | ||
|
|
||
| class QMouseEvent; | ||
|
|
||
| class TASSlider : public QSlider | ||
| { | ||
| public: | ||
| explicit TASSlider(int default_, QWidget* parent = nullptr); | ||
| explicit TASSlider(int default_, Qt::Orientation orientation, QWidget* parent = nullptr); | ||
|
|
||
| protected: | ||
| void mouseReleaseEvent(QMouseEvent* event) override; | ||
|
|
||
| private: | ||
| int m_default; | ||
| }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters