2018-03-16 13:10:22 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-03-16 13:10:22 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-09-18 06:29:13 +00:00
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
2020-10-17 05:05:43 +00:00
|
|
|
#include "DolphinQt/Config/ToolTipControls/ToolTipRadioButton.h"
|
2018-03-16 13:10:22 +00:00
|
|
|
|
2024-12-23 21:54:26 +00:00
|
|
|
#include "Common/Config/ConfigInfo.h"
|
2018-03-16 13:10:22 +00:00
|
|
|
|
2024-09-18 06:29:13 +00:00
|
|
|
class ConfigRadioInt final : public ConfigControl<ToolTipRadioButton>
|
2018-03-16 13:10:22 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-09-18 06:29:13 +00:00
|
|
|
ConfigRadioInt(const QString& label, const Config::Info<int>& setting, int value,
|
|
|
|
Config::Layer* layer = nullptr);
|
2018-03-16 13:10:22 +00:00
|
|
|
|
2023-11-13 23:04:12 +00:00
|
|
|
signals:
|
|
|
|
// Since selecting a new radio button deselects the old one, ::toggled will generate two signals.
|
|
|
|
// These are convenience functions so you can receive only one signal if desired.
|
|
|
|
void OnSelected(int new_value);
|
|
|
|
void OnDeselected(int old_value);
|
|
|
|
|
2024-09-18 06:29:13 +00:00
|
|
|
protected:
|
|
|
|
void OnConfigChanged() override;
|
|
|
|
|
2018-03-16 13:10:22 +00:00
|
|
|
private:
|
|
|
|
void Update();
|
|
|
|
|
2024-12-23 21:54:26 +00:00
|
|
|
const Config::Info<int> m_setting;
|
2018-03-16 13:10:22 +00:00
|
|
|
int m_value;
|
|
|
|
};
|