summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h
blob: cd60ad25db0f2448c807f0a4f8103625bf9b55d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2019 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <QLabel>
#include <QPointer>

#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"

#include "Common/Config/ConfigInfo.h"

class ConfigInteger final : public ConfigControl<ToolTipSpinBox>
{
  Q_OBJECT
public:
  ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting, int step = 1);
  ConfigInteger(int minimum, int maximum, const Config::Info<int>& setting, Config::Layer* layer,
                int step = 1);

  void Update(int value);

protected:
  void OnConfigChanged() override;

private:
  const Config::Info<int> m_setting;
};

class ConfigIntegerLabel final : public QLabel
{
  Q_OBJECT

public:
  ConfigIntegerLabel(const QString& text, ConfigInteger* widget);

private:
  QPointer<ConfigInteger> m_widget;
};