diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.cpp b/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.cpp index 8d724505e3..a81bfd7aed 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.cpp +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.cpp @@ -29,3 +29,13 @@ void ConfigInteger::OnConfigChanged() { setValue(ReadValue(m_setting)); } + +ConfigIntegerLabel::ConfigIntegerLabel(const QString& text, ConfigInteger* widget) + : QLabel(text), m_widget(QPointer(widget)) +{ + connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this]() { + // Label shares font changes with ConfigInteger to mark game ini settings. + if (m_widget) + setFont(m_widget->font()); + }); +} diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h index 2979423f74..9a0e718279 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigInteger.h @@ -3,6 +3,9 @@ #pragma once +#include +#include + #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h" @@ -28,3 +31,14 @@ protected: private: const Config::Info& m_setting; }; + +class ConfigIntegerLabel final : public QLabel +{ + Q_OBJECT + +public: + ConfigIntegerLabel(const QString& text, ConfigInteger* widget); + +private: + QPointer m_widget; +}; diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.cpp b/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.cpp index 9192410e03..a296d57e86 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.cpp +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.cpp @@ -1,7 +1,10 @@ // Copyright 2017 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include + #include "DolphinQt/Config/ConfigControls/ConfigSlider.h" +#include "DolphinQt/Settings.h" ConfigSlider::ConfigSlider(int minimum, int maximum, const Config::Info& setting, int tick) : ConfigSlider(minimum, maximum, setting, nullptr, tick) @@ -30,3 +33,13 @@ void ConfigSlider::OnConfigChanged() { setValue(ReadValue(m_setting)); } + +ConfigSliderLabel::ConfigSliderLabel(const QString& text, ConfigSlider* slider) + : QLabel(text), m_slider(QPointer(slider)) +{ + connect(&Settings::Instance(), &Settings::ConfigChanged, this, [this]() { + // Label shares font changes with slider to mark game ini settings. + if (m_slider) + setFont(m_slider->font()); + }); +} diff --git a/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h b/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h index 7ac81d03d5..7d10dcafb2 100644 --- a/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h +++ b/Source/Core/DolphinQt/Config/ConfigControls/ConfigSlider.h @@ -3,6 +3,9 @@ #pragma once +#include +#include + #include "DolphinQt/Config/ConfigControls/ConfigControl.h" #include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h" @@ -28,3 +31,14 @@ protected: private: const Config::Info& m_setting; }; + +class ConfigSliderLabel final : public QLabel +{ + Q_OBJECT + +public: + ConfigSliderLabel(const QString& text, ConfigSlider* slider); + +private: + QPointer m_slider; +}; diff --git a/Source/Core/DolphinQt/Config/GameConfigWidget.cpp b/Source/Core/DolphinQt/Config/GameConfigWidget.cpp index c53e8e8379..99d7b45cce 100644 --- a/Source/Core/DolphinQt/Config/GameConfigWidget.cpp +++ b/Source/Core/DolphinQt/Config/GameConfigWidget.cpp @@ -152,9 +152,11 @@ void GameConfigWidget::CreateWidgets() m_use_monoscopic_shadows->setToolTip( tr("Use a single depth buffer for both eyes. Needed for a few games.")); - stereoscopy_layout->addWidget(new QLabel(tr("Depth Percentage:")), 0, 0); + stereoscopy_layout->addWidget(new ConfigSliderLabel(tr("Depth Percentage:"), m_depth_slider), 0, + 0); stereoscopy_layout->addWidget(m_depth_slider, 0, 1); - stereoscopy_layout->addWidget(new QLabel(tr("Convergence:")), 1, 0); + stereoscopy_layout->addWidget(new ConfigIntegerLabel(tr("Convergence:"), m_convergence_spin), 1, + 0); stereoscopy_layout->addWidget(m_convergence_spin, 1, 1); stereoscopy_layout->addWidget(m_use_monoscopic_shadows, 2, 0); diff --git a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp index 9854a47b23..f04d8fec2a 100644 --- a/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/EnhancementsWidget.cpp @@ -236,9 +236,9 @@ void EnhancementsWidget::CreateWidgets() stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0); stereoscopy_layout->addWidget(m_3d_mode, 0, 1); - stereoscopy_layout->addWidget(new QLabel(tr("Depth:")), 1, 0); + stereoscopy_layout->addWidget(new ConfigSliderLabel(tr("Depth:"), m_3d_depth), 1, 0); stereoscopy_layout->addWidget(m_3d_depth, 1, 1); - stereoscopy_layout->addWidget(new QLabel(tr("Convergence:")), 2, 0); + stereoscopy_layout->addWidget(new ConfigSliderLabel(tr("Convergence:"), m_3d_convergence), 2, 0); stereoscopy_layout->addWidget(m_3d_convergence, 2, 1); stereoscopy_layout->addWidget(m_3d_swap_eyes, 3, 0); stereoscopy_layout->addWidget(m_3d_per_eye_resolution, 4, 0);