Debian Codegraph @

Source/Core/DolphinQt/Config/ConfigControls/ConfigFloatSlider.h

raw symbols SCIP
1 // Copyright 2023 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <QLabel>
7
8 #include "DolphinQt/Config/ConfigControls/ConfigControl.h"
9 #include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
10
11 #include "Common/Config/ConfigInfo.h"
12
13 // Automatically converts an int slider into a float one.
14 // Do not read the int values or ranges directly from it.
15 class ConfigFloatSlider final : public ConfigControl<ToolTipSlider>
16 {
17 Q_OBJECT
18 public:
19 ConfigFloatSlider(float minimum, float maximum, const Config::Info<float>& setting, float step,
20 Config::Layer* layer = nullptr);
21 void Update(int value);
22
23 // Returns the adjusted float value
24 float GetValue() const;
25
26 protected:
27 void OnConfigChanged() override;
28
29 private:
30 float m_minimum;
31 float m_step;
32 const Config::Info<float> m_setting;
33 };
34
35 class ConfigFloatLabel final : public QLabel
36 {
37 public:
38 ConfigFloatLabel(const QString& text, ConfigFloatSlider* widget);
39 };