Add method to bold slider/spin labels when a user game ini setting is being used
This commit is contained in:
parent
ac129d318b
commit
9541bb6cf7
|
@ -29,3 +29,13 @@ void ConfigInteger::OnConfigChanged()
|
||||||
{
|
{
|
||||||
setValue(ReadValue(m_setting));
|
setValue(ReadValue(m_setting));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigIntegerLabel::ConfigIntegerLabel(const QString& text, ConfigInteger* widget)
|
||||||
|
: QLabel(text), m_widget(QPointer<ConfigInteger>(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());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
||||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"
|
#include "DolphinQt/Config/ToolTipControls/ToolTipSpinBox.h"
|
||||||
|
|
||||||
|
@ -28,3 +31,14 @@ protected:
|
||||||
private:
|
private:
|
||||||
const Config::Info<int>& m_setting;
|
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;
|
||||||
|
};
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
// Copyright 2017 Dolphin Emulator Project
|
// Copyright 2017 Dolphin Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
#include "DolphinQt/Config/ConfigControls/ConfigSlider.h"
|
||||||
|
#include "DolphinQt/Settings.h"
|
||||||
|
|
||||||
ConfigSlider::ConfigSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
|
ConfigSlider::ConfigSlider(int minimum, int maximum, const Config::Info<int>& setting, int tick)
|
||||||
: ConfigSlider(minimum, maximum, setting, nullptr, tick)
|
: ConfigSlider(minimum, maximum, setting, nullptr, tick)
|
||||||
|
@ -30,3 +33,13 @@ void ConfigSlider::OnConfigChanged()
|
||||||
{
|
{
|
||||||
setValue(ReadValue(m_setting));
|
setValue(ReadValue(m_setting));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ConfigSliderLabel::ConfigSliderLabel(const QString& text, ConfigSlider* slider)
|
||||||
|
: QLabel(text), m_slider(QPointer<ConfigSlider>(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());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
#include "DolphinQt/Config/ConfigControls/ConfigControl.h"
|
||||||
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
#include "DolphinQt/Config/ToolTipControls/ToolTipSlider.h"
|
||||||
|
|
||||||
|
@ -28,3 +31,14 @@ protected:
|
||||||
private:
|
private:
|
||||||
const Config::Info<int>& m_setting;
|
const Config::Info<int>& m_setting;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ConfigSliderLabel final : public QLabel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ConfigSliderLabel(const QString& text, ConfigSlider* slider);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QPointer<ConfigSlider> m_slider;
|
||||||
|
};
|
||||||
|
|
|
@ -152,9 +152,11 @@ void GameConfigWidget::CreateWidgets()
|
||||||
m_use_monoscopic_shadows->setToolTip(
|
m_use_monoscopic_shadows->setToolTip(
|
||||||
tr("Use a single depth buffer for both eyes. Needed for a few games."));
|
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(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_convergence_spin, 1, 1);
|
||||||
stereoscopy_layout->addWidget(m_use_monoscopic_shadows, 2, 0);
|
stereoscopy_layout->addWidget(m_use_monoscopic_shadows, 2, 0);
|
||||||
|
|
||||||
|
|
|
@ -236,9 +236,9 @@ void EnhancementsWidget::CreateWidgets()
|
||||||
|
|
||||||
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
|
stereoscopy_layout->addWidget(new QLabel(tr("Stereoscopic 3D Mode:")), 0, 0);
|
||||||
stereoscopy_layout->addWidget(m_3d_mode, 0, 1);
|
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(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_convergence, 2, 1);
|
||||||
stereoscopy_layout->addWidget(m_3d_swap_eyes, 3, 0);
|
stereoscopy_layout->addWidget(m_3d_swap_eyes, 3, 0);
|
||||||
stereoscopy_layout->addWidget(m_3d_per_eye_resolution, 4, 0);
|
stereoscopy_layout->addWidget(m_3d_per_eye_resolution, 4, 0);
|
||||||
|
|
Loading…
Reference in New Issue