summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2020-10-17 00:05:43 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2020-11-28 11:49:14 -0600
commita9271aa167f0fca3780bdad32b682cb964db116f (patch)
tree3aa0ea1c3b1a0d8a9ea9bdc136ddb2bafe22a9b7 /Source/Core
parentaf0161cafdb5044d46814ab64ac5b7fb82e8c343 (diff)
DolphinQt: Add the ability to show a tooltip for custom graphics controls
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsBool.cpp6
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsBool.h8
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsChoice.h4
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp2
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.h4
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.cpp2
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.h4
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.cpp2
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.h4
9 files changed, 19 insertions, 17 deletions
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.cpp
index 4d5eaf6973..e05f956463 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.cpp
@@ -3,6 +3,7 @@
// Refer to the license.txt file included.
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
+#include "DolphinQt/Config/Graphics/BalloonTip.h"
#include <QSignalBlocker>
@@ -10,10 +11,11 @@
#include "DolphinQt/Settings.h"
+#include <QEvent>
#include <QFont>
GraphicsBool::GraphicsBool(const QString& label, const Config::Info<bool>& setting, bool reverse)
- : QCheckBox(label), m_setting(setting), m_reverse(reverse)
+ : ToolTipCheckBox(label), m_setting(setting), m_reverse(reverse)
{
connect(this, &QCheckBox::toggled, this, &GraphicsBool::Update);
setChecked(Config::Get(m_setting) ^ reverse);
@@ -35,7 +37,7 @@ void GraphicsBool::Update()
GraphicsBoolEx::GraphicsBoolEx(const QString& label, const Config::Info<bool>& setting,
bool reverse)
- : QRadioButton(label), m_setting(setting), m_reverse(reverse)
+ : ToolTipRadioButton(label), m_setting(setting), m_reverse(reverse)
{
connect(this, &QCheckBox::toggled, this, &GraphicsBoolEx::Update);
setChecked(Config::Get(m_setting) ^ reverse);
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.h
index bb772e4c77..1d3ceb4d5d 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.h
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsBool.h
@@ -4,8 +4,8 @@
#pragma once
-#include <QCheckBox>
-#include <QRadioButton>
+#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
+#include "DolphinQt/Config/ToolTipControls/ToolTipRadioButton.h"
namespace Config
{
@@ -13,7 +13,7 @@ template <typename T>
struct Info;
}
-class GraphicsBool : public QCheckBox
+class GraphicsBool : public ToolTipCheckBox
{
Q_OBJECT
public:
@@ -26,7 +26,7 @@ private:
bool m_reverse;
};
-class GraphicsBoolEx : public QRadioButton
+class GraphicsBoolEx : public ToolTipRadioButton
{
Q_OBJECT
public:
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsChoice.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsChoice.h
index fc2116c123..734c7d56bb 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsChoice.h
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsChoice.h
@@ -4,11 +4,11 @@
#pragma once
-#include <QComboBox>
+#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
#include "Common/Config/Config.h"
-class GraphicsChoice : public QComboBox
+class GraphicsChoice : public ToolTipComboBox
{
Q_OBJECT
public:
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp
index b69f02ecdb..1fd529687e 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.cpp
@@ -12,7 +12,7 @@
GraphicsInteger::GraphicsInteger(int minimum, int maximum, const Config::Info<int>& setting,
int step)
- : QSpinBox(), m_setting(setting)
+ : ToolTipSpinBox(), m_setting(setting)
{
setMinimum(minimum);
setMaximum(maximum);
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.h
index dda8737f02..4f0cea9cb3 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.h
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsInteger.h
@@ -4,7 +4,7 @@
#pragma once
-#include <QSpinBox>
+#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"
namespace Config
{
@@ -12,7 +12,7 @@ template <typename T>
struct Info;
}
-class GraphicsInteger : public QSpinBox
+class GraphicsInteger : public ToolTipSpinBox
{
Q_OBJECT
public:
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.cpp
index eb15527b71..2a8d2b5205 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.cpp
@@ -12,7 +12,7 @@
GraphicsRadioInt::GraphicsRadioInt(const QString& label, const Config::Info<int>& setting,
int value)
- : QRadioButton(label), m_setting(setting), m_value(value)
+ : ToolTipRadioButton(label), m_setting(setting), m_value(value)
{
setChecked(Config::Get(m_setting) == m_value);
connect(this, &QRadioButton::toggled, this, &GraphicsRadioInt::Update);
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.h
index 288acc16c1..91ba241589 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.h
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsRadio.h
@@ -4,11 +4,11 @@
#pragma once
-#include <QRadioButton>
+#include "DolphinQt/Config/ToolTipControls/ToolTipRadioButton.h"
#include "Common/Config/Config.h"
-class GraphicsRadioInt : public QRadioButton
+class GraphicsRadioInt : public ToolTipRadioButton
{
Q_OBJECT
public:
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.cpp b/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.cpp
index 350873c570..39b97fc424 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.cpp
@@ -11,7 +11,7 @@
#include "DolphinQt/Settings.h"
GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
- : QSlider(Qt::Horizontal), m_setting(setting)
+ : ToolTipSlider(Qt::Horizontal), m_setting(setting)
{
setMinimum(minimum);
setMaximum(maximum);
diff --git a/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.h b/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.h
index 96fdcfda4e..9c45f81ac4 100644
--- a/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.h
+++ b/Source/Core/DolphinQt/Config/Graphics/GraphicsSlider.h
@@ -4,7 +4,7 @@
#pragma once
-#include <QSlider>
+#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
namespace Config
{
@@ -12,7 +12,7 @@ template <typename T>
struct Info;
}
-class GraphicsSlider : public QSlider
+class GraphicsSlider : public ToolTipSlider
{
Q_OBJECT
public: