summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/yuzu/configuration/shared_widget.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/src/yuzu/configuration/shared_widget.cpp b/src/yuzu/configuration/shared_widget.cpp
index 74985129b..410fa80cd 100644
--- a/src/yuzu/configuration/shared_widget.cpp
+++ b/src/yuzu/configuration/shared_widget.cpp
@@ -390,25 +390,6 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
390 390
391 QWidget* data_component{nullptr}; 391 QWidget* data_component{nullptr};
392 392
393 if (!Settings::IsConfiguringGlobal() && managed) {
394 restore_button = CreateRestoreGlobalButton(setting.UsingGlobal(), this);
395
396 touch = [this]() {
397 LOG_DEBUG(Frontend, "Enabling custom setting for \"{}\"", setting.GetLabel());
398 restore_button->setEnabled(true);
399 restore_button->setVisible(true);
400 };
401 }
402
403 if (require_checkbox) {
404 QWidget* lhs =
405 CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
406 layout->addWidget(lhs);
407 } else if (setting.TypeId() != typeid(bool)) {
408 QLabel* qt_label = CreateLabel(label);
409 layout->addWidget(qt_label);
410 }
411
412 request = [&]() { 393 request = [&]() {
413 if (request != RequestType::Default) { 394 if (request != RequestType::Default) {
414 return request; 395 return request;
@@ -435,6 +416,25 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
435 return request; 416 return request;
436 }(); 417 }();
437 418
419 if (!Settings::IsConfiguringGlobal() && managed) {
420 restore_button = CreateRestoreGlobalButton(setting.UsingGlobal(), this);
421
422 touch = [this]() {
423 LOG_DEBUG(Frontend, "Enabling custom setting for \"{}\"", setting.GetLabel());
424 restore_button->setEnabled(true);
425 restore_button->setVisible(true);
426 };
427 }
428
429 if (require_checkbox) {
430 QWidget* lhs =
431 CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch);
432 layout->addWidget(lhs);
433 } else if (setting.TypeId() != typeid(bool)) {
434 QLabel* qt_label = CreateLabel(label);
435 layout->addWidget(qt_label);
436 }
437
438 if (setting.TypeId() == typeid(bool)) { 438 if (setting.TypeId() == typeid(bool)) {
439 data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch); 439 data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch);
440 } else if (setting.IsEnum()) { 440 } else if (setting.IsEnum()) {
@@ -505,6 +505,9 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu
505 505
506 QObject::connect(restore_button, &QAbstractButton::clicked, 506 QObject::connect(restore_button, &QAbstractButton::clicked,
507 [this, restore_func, checkbox_restore_func](bool) { 507 [this, restore_func, checkbox_restore_func](bool) {
508 LOG_DEBUG(Frontend, "Restore global state for \"{}\"",
509 setting.GetLabel());
510
508 restore_button->setEnabled(false); 511 restore_button->setEnabled(false);
509 restore_button->setVisible(false); 512 restore_button->setVisible(false);
510 513