DolphinQt: Refactor, add ConfigControl class

This reduces code duplication in the different ConfigControls. This is
helpful for the next commit, which will modify the now deduplicated
code.
This commit is contained in:
TryTwo
2024-09-17 23:29:13 -07:00
committed by JosJuice
parent 0a84d93a8e
commit 08df9a66e0
15 changed files with 189 additions and 147 deletions

View File

@ -3,6 +3,7 @@
#pragma once
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"
namespace Config
@ -11,13 +12,16 @@ template <typename T>
class Info;
}
class ConfigInteger : public ToolTipSpinBox
class ConfigInteger final : public ConfigControl<ToolTipSpinBox>
{
Q_OBJECT
public:
ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
void Update(int value);
protected:
void OnConfigChanged() override;
private:
const Config::Info<int>& m_setting;
};