mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Qt: Rename GraphicsChoice to ConfigChoice
GraphicsChoice is used by the panes in the Graphics config window to create combo boxes 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 ConfigChoice better reflects its purpose. This should also make it less confusing when ConfigChoices are eventually added to the other config windows.
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
#include "Core/Core.h"
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsInteger.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
|
||||
|
||||
class ConfigBool;
|
||||
class GraphicsChoice;
|
||||
class ConfigChoice;
|
||||
class GraphicsInteger;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "Core/ConfigManager.h"
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsSlider.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
@ -82,7 +82,7 @@ void EnhancementsWidget::CreateWidgets()
|
||||
QString::number(static_cast<int>(EFB_HEIGHT) * scale)));
|
||||
}
|
||||
|
||||
m_ir_combo = new GraphicsChoice(resolution_options, Config::GFX_EFB_SCALE);
|
||||
m_ir_combo = new ConfigChoice(resolution_options, Config::GFX_EFB_SCALE);
|
||||
m_ir_combo->setMaxVisibleItems(visible_resolution_option_count);
|
||||
|
||||
m_aa_combo = new ToolTipComboBox();
|
||||
@ -157,9 +157,9 @@ void EnhancementsWidget::CreateWidgets()
|
||||
auto* stereoscopy_layout = new QGridLayout();
|
||||
stereoscopy_box->setLayout(stereoscopy_layout);
|
||||
|
||||
m_3d_mode = new GraphicsChoice({tr("Off"), tr("Side-by-Side"), tr("Top-and-Bottom"),
|
||||
tr("Anaglyph"), tr("HDMI 3D"), tr("Passive")},
|
||||
Config::GFX_STEREO_MODE);
|
||||
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);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
|
||||
|
||||
class ConfigBool;
|
||||
class GraphicsChoice;
|
||||
class ConfigChoice;
|
||||
class GraphicsSlider;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
@ -34,7 +34,7 @@ private:
|
||||
void LoadPPShaders();
|
||||
|
||||
// Enhancements
|
||||
GraphicsChoice* m_ir_combo;
|
||||
ConfigChoice* m_ir_combo;
|
||||
ToolTipComboBox* m_aa_combo;
|
||||
ToolTipComboBox* m_texture_filtering_combo;
|
||||
ToolTipComboBox* m_pp_effect;
|
||||
@ -48,7 +48,7 @@ private:
|
||||
ConfigBool* m_arbitrary_mipmap_detection;
|
||||
|
||||
// Stereoscopy
|
||||
GraphicsChoice* m_3d_mode;
|
||||
ConfigChoice* m_3d_mode;
|
||||
GraphicsSlider* m_3d_depth;
|
||||
GraphicsSlider* m_3d_convergence;
|
||||
ConfigBool* m_3d_swap_eyes;
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "Core/Core.h"
|
||||
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigBool.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
|
||||
#include "DolphinQt/Config/ConfigControls/ConfigChoice.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsRadio.h"
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
|
||||
@ -57,8 +57,8 @@ void GeneralWidget::CreateWidgets()
|
||||
|
||||
m_backend_combo = new ToolTipComboBox();
|
||||
m_aspect_combo =
|
||||
new GraphicsChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
|
||||
Config::GFX_ASPECT_RATIO);
|
||||
new ConfigChoice({tr("Auto"), tr("Force 16:9"), tr("Force 4:3"), tr("Stretch to Window")},
|
||||
Config::GFX_ASPECT_RATIO);
|
||||
m_adapter_combo = new ToolTipComboBox;
|
||||
m_enable_vsync = new ConfigBool(tr("V-Sync"), Config::GFX_VSYNC);
|
||||
m_enable_fullscreen = new ConfigBool(tr("Start in Fullscreen"), Config::MAIN_FULLSCREEN);
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "DolphinQt/Config/Graphics/GraphicsWidget.h"
|
||||
|
||||
class ConfigBool;
|
||||
class GraphicsChoice;
|
||||
class ConfigChoice;
|
||||
class GraphicsRadioInt;
|
||||
class GraphicsWindow;
|
||||
class QCheckBox;
|
||||
@ -44,7 +44,7 @@ private:
|
||||
QGridLayout* m_video_layout;
|
||||
ToolTipComboBox* m_backend_combo;
|
||||
ToolTipComboBox* m_adapter_combo;
|
||||
GraphicsChoice* m_aspect_combo;
|
||||
ConfigChoice* m_aspect_combo;
|
||||
ConfigBool* m_enable_vsync;
|
||||
ConfigBool* m_enable_fullscreen;
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "DolphinQt/Config/Graphics/GraphicsChoice.h"
|
||||
|
||||
#include <QSignalBlocker>
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
#include "DolphinQt/Settings.h"
|
||||
|
||||
GraphicsChoice::GraphicsChoice(const QStringList& options, const Config::Info<int>& setting)
|
||||
: m_setting(setting)
|
||||
{
|
||||
addItems(options);
|
||||
connect(this, qOverload<int>(&QComboBox::currentIndexChanged), this, &GraphicsChoice::Update);
|
||||
setCurrentIndex(Config::Get(m_setting));
|
||||
|
||||
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);
|
||||
setCurrentIndex(Config::Get(m_setting));
|
||||
});
|
||||
}
|
||||
|
||||
void GraphicsChoice::Update(int choice)
|
||||
{
|
||||
Config::SetBaseOrCurrent(m_setting, choice);
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
// Copyright 2017 Dolphin Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h"
|
||||
|
||||
#include "Common/Config/Config.h"
|
||||
|
||||
class GraphicsChoice : public ToolTipComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GraphicsChoice(const QStringList& options, const Config::Info<int>& setting);
|
||||
|
||||
private:
|
||||
void Update(int choice);
|
||||
|
||||
Config::Info<int> m_setting;
|
||||
};
|
Reference in New Issue
Block a user