mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-02 15:45:58 +00:00
Qt: Rename GraphicsSlider to ConfigSlider
GraphicsSlider is used by the panes in the Graphics config window to create sliders that change their associated config setting, and update their own state when something else changes the config setting. Despite its current name nothing about this class is particular to the Graphics window, so renaming it to ConfigSlider better reflects its purpose. This should also make it less confusing when ConfigSliders are added to other config panes.
This commit is contained in:
parent
8e6e6f3c4a
commit
1a2a99c9b3
8 changed files with 19 additions and 19 deletions
|
@ -17,7 +17,7 @@
|
|||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigRadio.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/Graphics/PostProcessingConfigWindow.h"
|
||||
#include "DolphinQt/QtUtils/NonDefaultQPushButton.h"
|
||||
|
@ -160,9 +160,9 @@ void EnhancementsWidget::CreateWidgets()
|
|||
m_3d_mode = new ConfigChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"), tr("Anaglyph"),
|
||||
tr("HDMI 3D"), tr("Passive")},
|
||||
Config::GFX_STEREO_MODE);
|
||||
m_3d_depth = new GraphicsSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
|
||||
m_3d_convergence = new GraphicsSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
|
||||
Config::GFX_STEREO_CONVERGENCE, 100);
|
||||
m_3d_depth = new ConfigSlider(0, Config::GFX_STEREO_DEPTH_MAXIMUM, Config::GFX_STEREO_DEPTH);
|
||||
m_3d_convergence = new ConfigSlider(0, Config::GFX_STEREO_CONVERGENCE_MAXIMUM,
|
||||
Config::GFX_STEREO_CONVERGENCE, 100);
|
||||
m_3d_swap_eyes = new ConfigBool(tr("Swap Eyes"), Config::GFX_STEREO_SWAP_EYES);
|
||||
|
||||
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
class ConfigBool;
|
||||
class ConfigChoice;
|
||||
class GraphicsSlider;
|
||||
class ConfigSlider;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
|
@ -49,8 +49,8 @@ private:
|
|||
|
||||
// Stereoscopy
|
||||
ConfigChoice* m_3d_mode;
|
||||
GraphicsSlider* m_3d_depth;
|
||||
GraphicsSlider* m_3d_convergence;
|
||||
ConfigSlider* m_3d_depth;
|
||||
ConfigSlider* m_3d_convergence;
|
||||
ConfigBool* m_3d_swap_eyes;
|
||||
|
||||
int m_msaa_modes;
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright 2017 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
|
||||
|
||||
#include <QSignalBlocker>
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
GraphicsSlider::GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
|
||||
: ToolTipSlider(Qt::Horizontal), m_setting(setting)
|
||||
{
|
||||
setMinimum(minimum);
|
||||
setMaximum(maximum);
|
||||
setTickInterval(tick);
|
||||
|
||||
setValue(Config::Get(setting));
|
||||
|
||||
connect(this, &GraphicsSlider::valueChanged, this, &GraphicsSlider::Update);
|
||||
|
||||
connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this] {
|
||||
QFont bf = font();
|
||||
bf.setBold(Config::GetActiveLayerForConfig(m_setting) != Config::LayerType::Base);
|
||||
setFont(bf);
|
||||
|
||||
const QSignalBlocker blocker(this);
|
||||
setValue(Config::Get(m_setting));
|
||||
});
|
||||
}
|
||||
|
||||
void GraphicsSlider::Update(int value)
|
||||
{
|
||||
Config::SetBaseOrCurrent(m_setting, value);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
// Copyright 2017 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
||||
|
||||
namespace Config
|
||||
{
|
||||
template <typename T>
|
||||
class Info;
|
||||
}
|
||||
|
||||
class GraphicsSlider : public ToolTipSlider
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GraphicsSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick = 0);
|
||||
void Update(int value);
|
||||
|
||||
private:
|
||||
const Config::Info<int>& m_setting;
|
||||
};
|
|
@ -14,7 +14,7 @@
|
|||
#include "Core/ConfigManager.h"
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue