diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-07-23 23:08:25 +0200 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2023-07-23 23:08:25 +0200 |
commit | ab2921121ec89feb8a926648728beee1551edcf3 (patch) | |
tree | f0bcc683fb6b924fbf642364643ac186d12ca6ae /src | |
parent | settings_common: Document specializations (diff) | |
download | yuzu-ab2921121ec89feb8a926648728beee1551edcf3.tar yuzu-ab2921121ec89feb8a926648728beee1551edcf3.tar.gz yuzu-ab2921121ec89feb8a926648728beee1551edcf3.tar.bz2 yuzu-ab2921121ec89feb8a926648728beee1551edcf3.tar.lz yuzu-ab2921121ec89feb8a926648728beee1551edcf3.tar.xz yuzu-ab2921121ec89feb8a926648728beee1551edcf3.tar.zst yuzu-ab2921121ec89feb8a926648728beee1551edcf3.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/configuration/shared_widget.cpp | 41 |
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 QWidget* data_component{nullptr}; - if (!Settings::IsConfiguringGlobal() && managed) { - restore_button = CreateRestoreGlobalButton(setting.UsingGlobal(), this); - - touch = [this]() { - LOG_DEBUG(Frontend, "Enabling custom setting for \"{}\"", setting.GetLabel()); - restore_button->setEnabled(true); - restore_button->setVisible(true); - }; - } - - if (require_checkbox) { - QWidget* lhs = - CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); - layout->addWidget(lhs); - } else if (setting.TypeId() != typeid(bool)) { - QLabel* qt_label = CreateLabel(label); - layout->addWidget(qt_label); - } - request = [&]() { if (request != RequestType::Default) { return request; @@ -435,6 +416,25 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu return request; }(); + if (!Settings::IsConfiguringGlobal() && managed) { + restore_button = CreateRestoreGlobalButton(setting.UsingGlobal(), this); + + touch = [this]() { + LOG_DEBUG(Frontend, "Enabling custom setting for \"{}\"", setting.GetLabel()); + restore_button->setEnabled(true); + restore_button->setVisible(true); + }; + } + + if (require_checkbox) { + QWidget* lhs = + CreateCheckBox(other_setting, label, checkbox_serializer, checkbox_restore_func, touch); + layout->addWidget(lhs); + } else if (setting.TypeId() != typeid(bool)) { + QLabel* qt_label = CreateLabel(label); + layout->addWidget(qt_label); + } + if (setting.TypeId() == typeid(bool)) { data_component = CreateCheckBox(&setting, label, serializer, restore_func, touch); } else if (setting.IsEnum()) { @@ -505,6 +505,9 @@ void Widget::SetupComponent(const QString& label, std::function<void()>& load_fu QObject::connect(restore_button, &QAbstractButton::clicked, [this, restore_func, checkbox_restore_func](bool) { + LOG_DEBUG(Frontend, "Restore global state for \"{}\"", + setting.GetLabel()); + restore_button->setEnabled(false); restore_button->setVisible(false); |