mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
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:
@ -3,11 +3,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipRadioButton.h"
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
namespace Config
|
||||
{
|
||||
template <typename T>
|
||||
class Info;
|
||||
}
|
||||
|
||||
class ConfigRadioInt : public ToolTipRadioButton
|
||||
class ConfigRadioInt final : public ConfigControl<ToolTipRadioButton>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -19,9 +24,12 @@ signals:
|
||||
void OnSelected(int new_value);
|
||||
void OnDeselected(int old_value);
|
||||
|
||||
protected:
|
||||
void OnConfigChanged() override;
|
||||
|
||||
private:
|
||||
void Update();
|
||||
|
||||
Config::Info<int> m_setting;
|
||||
const Config::Info<int>& m_setting;
|
||||
int m_value;
|
||||
};
|
||||
|
Reference in New Issue
Block a user