mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-05 06:22:45 +01:00
Merge pull request #1428 from lioncash/qt
configure_graphics: Make functions internally linked where applicable
This commit is contained in:
commit
af672d8abf
1 changed files with 23 additions and 21 deletions
|
@ -8,27 +8,7 @@
|
||||||
#include "ui_configure_graphics.h"
|
#include "ui_configure_graphics.h"
|
||||||
#include "yuzu/configuration/configure_graphics.h"
|
#include "yuzu/configuration/configure_graphics.h"
|
||||||
|
|
||||||
ConfigureGraphics::ConfigureGraphics(QWidget* parent)
|
namespace {
|
||||||
: QWidget(parent), ui(new Ui::ConfigureGraphics) {
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
|
||||||
this->setConfiguration();
|
|
||||||
|
|
||||||
ui->frame_limit->setEnabled(Settings::values.use_frame_limit);
|
|
||||||
connect(ui->toggle_frame_limit, &QCheckBox::stateChanged, ui->frame_limit,
|
|
||||||
&QSpinBox::setEnabled);
|
|
||||||
connect(ui->bg_button, &QPushButton::clicked, this, [this] {
|
|
||||||
const QColor new_bg_color = QColorDialog::getColor(bg_color);
|
|
||||||
if (!new_bg_color.isValid())
|
|
||||||
return;
|
|
||||||
bg_color = new_bg_color;
|
|
||||||
ui->bg_button->setStyleSheet(
|
|
||||||
QString("QPushButton { background-color: %1 }").arg(bg_color.name()));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
ConfigureGraphics::~ConfigureGraphics() = default;
|
|
||||||
|
|
||||||
enum class Resolution : int {
|
enum class Resolution : int {
|
||||||
Auto,
|
Auto,
|
||||||
Scale1x,
|
Scale1x,
|
||||||
|
@ -67,6 +47,28 @@ Resolution FromResolutionFactor(float factor) {
|
||||||
}
|
}
|
||||||
return Resolution::Auto;
|
return Resolution::Auto;
|
||||||
}
|
}
|
||||||
|
} // Anonymous namespace
|
||||||
|
|
||||||
|
ConfigureGraphics::ConfigureGraphics(QWidget* parent)
|
||||||
|
: QWidget(parent), ui(new Ui::ConfigureGraphics) {
|
||||||
|
|
||||||
|
ui->setupUi(this);
|
||||||
|
this->setConfiguration();
|
||||||
|
|
||||||
|
ui->frame_limit->setEnabled(Settings::values.use_frame_limit);
|
||||||
|
connect(ui->toggle_frame_limit, &QCheckBox::stateChanged, ui->frame_limit,
|
||||||
|
&QSpinBox::setEnabled);
|
||||||
|
connect(ui->bg_button, &QPushButton::clicked, this, [this] {
|
||||||
|
const QColor new_bg_color = QColorDialog::getColor(bg_color);
|
||||||
|
if (!new_bg_color.isValid())
|
||||||
|
return;
|
||||||
|
bg_color = new_bg_color;
|
||||||
|
ui->bg_button->setStyleSheet(
|
||||||
|
QString("QPushButton { background-color: %1 }").arg(bg_color.name()));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigureGraphics::~ConfigureGraphics() = default;
|
||||||
|
|
||||||
void ConfigureGraphics::setConfiguration() {
|
void ConfigureGraphics::setConfiguration() {
|
||||||
ui->resolution_factor_combobox->setCurrentIndex(
|
ui->resolution_factor_combobox->setCurrentIndex(
|
||||||
|
|
Loading…
Reference in a new issue