2023-06-08 03:10:12 +03:00
|
|
|
// Copyright 2023 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-09-17 23:29:13 -07:00
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
2023-06-08 03:10:12 +03:00
|
|
|
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
|
|
|
|
2024-12-23 14:54:26 -07:00
|
|
|
#include "Common/Config/ConfigInfo.h"
|
2023-06-08 03:10:12 +03:00
|
|
|
|
|
|
|
// Automatically converts an int slider into a float one.
|
|
|
|
// Do not read the int values or ranges directly from it.
|
2024-09-17 23:29:13 -07:00
|
|
|
class ConfigFloatSlider final : public ConfigControl<ToolTipSlider>
|
2023-06-08 03:10:12 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2024-09-17 23:29:13 -07:00
|
|
|
ConfigFloatSlider(float minimum, float maximum, const Config::Info<float>& setting, float step,
|
|
|
|
Config::Layer* layer = nullptr);
|
2023-06-08 03:10:12 +03:00
|
|
|
void Update(int value);
|
|
|
|
|
|
|
|
// Returns the adjusted float value
|
|
|
|
float GetValue() const;
|
|
|
|
|
2024-09-17 23:29:13 -07:00
|
|
|
protected:
|
|
|
|
void OnConfigChanged() override;
|
|
|
|
|
2023-06-08 03:10:12 +03:00
|
|
|
private:
|
|
|
|
float m_minimum;
|
|
|
|
float m_step;
|
2024-12-23 14:54:26 -07:00
|
|
|
const Config::Info<float> m_setting;
|
2023-06-08 03:10:12 +03:00
|
|
|
};
|