Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
843 B
C
Raw Permalink Normal View History

2023-06-08 03:10:12 +03:00
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
2023-06-08 03:10:12 +03:00
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
#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.
class ConfigFloatSlider final : public ConfigControl<ToolTipSlider>
2023-06-08 03:10:12 +03:00
{
Q_OBJECT
public:
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;
protected:
void OnConfigChanged() override;
2023-06-08 03:10:12 +03:00
private:
float m_minimum;
float m_step;
const Config::Info<float> m_setting;
2023-06-08 03:10:12 +03:00
};