mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-05 04:16:29 +01:00
84a937ae65
Creates a layer outside the game config layer system and passes it to the created gfx widows, so as to not interfere with the global config system. Supports multiple game properties being open at once. Supports editing while a game is playing, but the options only save and update the active game when the window is closed. Right-clicking will remove a property from the game ini.
33 lines
876 B
C++
33 lines
876 B
C++
// Copyright 2017 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
|
|
|
ConfigSlider::ConfigSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
|
|
: ConfigSlider(minimum, maximum, setting, nullptr, tick)
|
|
{
|
|
}
|
|
|
|
ConfigSlider::ConfigSlider(int minimum, int maximum, const Config::Info<int>& setting,
|
|
Config::Layer* layer, int tick)
|
|
: ConfigControl(Qt::Horizontal, setting.GetLocation(), layer), m_setting(setting)
|
|
|
|
{
|
|
setMinimum(minimum);
|
|
setMaximum(maximum);
|
|
setTickInterval(tick);
|
|
setValue(ReadValue(setting));
|
|
|
|
connect(this, &ConfigSlider::valueChanged, this, &ConfigSlider::Update);
|
|
}
|
|
|
|
void ConfigSlider::Update(int value)
|
|
{
|
|
SaveValue(m_setting, value);
|
|
}
|
|
|
|
void ConfigSlider::OnConfigChanged()
|
|
{
|
|
setValue(ReadValue(m_setting));
|
|
}
|