mirror of
https://git.eden-emu.dev/archive/citron
synced 2026-04-19 03:00:50 -04:00
Edit configure_graphics_advanced.cpp
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||||
|
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
|
#include "citron/configuration/configure_graphics_advanced.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <qnamespace.h>
|
#include <qnamespace.h>
|
||||||
@@ -8,14 +10,13 @@
|
|||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "ui_configure_graphics_advanced.h"
|
#include "ui_configure_graphics_advanced.h"
|
||||||
#include "citron/configuration/configuration_shared.h"
|
#include "citron/configuration/configuration_shared.h"
|
||||||
#include "citron/configuration/configure_graphics_advanced.h"
|
|
||||||
#include "citron/configuration/shared_translation.h"
|
#include "citron/configuration/shared_translation.h"
|
||||||
#include "citron/configuration/shared_widget.h"
|
#include "citron/configuration/shared_widget.h"
|
||||||
|
|
||||||
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(
|
ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(
|
||||||
const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
|
const Core::System& system_, std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_,
|
||||||
const ConfigurationShared::Builder& builder, QWidget* parent)
|
const ConfigurationShared::Builder& builder, QWidget* parent)
|
||||||
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} {
|
: Tab(group_, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} {
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@@ -35,27 +36,27 @@ void ConfigureGraphicsAdvanced::Setup(const ConfigurationShared::Builder& builde
|
|||||||
std::map<u32, QWidget*> hold{}; // A map will sort the data for us
|
std::map<u32, QWidget*> hold{}; // A map will sort the data for us
|
||||||
|
|
||||||
for (auto setting :
|
for (auto setting :
|
||||||
Settings::values.linkage.by_category[Settings::Category::RendererAdvanced]) {
|
Settings::values.linkage.by_category[Settings::Category::RendererAdvanced]) {
|
||||||
ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs);
|
ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs);
|
||||||
|
|
||||||
if (widget == nullptr) {
|
if (widget == nullptr) {
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
if (!widget->Valid()) {
|
|
||||||
widget->deleteLater();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
hold.emplace(setting->Id(), widget);
|
|
||||||
|
|
||||||
// Keep track of enable_compute_pipelines so we can display it when needed
|
|
||||||
if (setting->Id() == Settings::values.enable_compute_pipelines.Id()) {
|
|
||||||
checkbox_enable_compute_pipelines = widget;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (const auto& [id, widget] : hold) {
|
if (!widget->Valid()) {
|
||||||
layout.addWidget(widget);
|
widget->deleteLater();
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hold.emplace(setting->Id(), widget);
|
||||||
|
|
||||||
|
// Keep track of enable_compute_pipelines so we can display it when needed
|
||||||
|
if (setting->Id() == Settings::values.enable_compute_pipelines.Id()) {
|
||||||
|
checkbox_enable_compute_pipelines = widget;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const auto& [id, widget] : hold) {
|
||||||
|
layout.addWidget(widget);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigureGraphicsAdvanced::ApplyConfiguration() {
|
void ConfigureGraphicsAdvanced::ApplyConfiguration() {
|
||||||
@@ -80,3 +81,16 @@ void ConfigureGraphicsAdvanced::RetranslateUI() {
|
|||||||
void ConfigureGraphicsAdvanced::ExposeComputeOption() {
|
void ConfigureGraphicsAdvanced::ExposeComputeOption() {
|
||||||
checkbox_enable_compute_pipelines->setVisible(true);
|
checkbox_enable_compute_pipelines->setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ConfigureGraphicsAdvanced::GetTemplateStyleSheet() const {
|
||||||
|
return m_template_style_sheet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigureGraphicsAdvanced::SetTemplateStyleSheet(const QString& sheet) {
|
||||||
|
if (m_template_style_sheet == sheet) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
m_template_style_sheet = sheet;
|
||||||
|
setStyleSheet(sheet);
|
||||||
|
emit TemplateStyleSheetChanged();
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user