diff options
| author | 2023-05-09 01:35:25 -0400 | |
|---|---|---|
| committer | 2023-07-21 10:56:07 -0400 | |
| commit | 464aad52cd644bdc32ca4eb35b0ce669c3b30c4f (patch) | |
| tree | 17ceb24d150d42fa154343c578062cad6581bd7e /src | |
| parent | config: Don't merge the maps (diff) | |
| download | yuzu-464aad52cd644bdc32ca4eb35b0ce669c3b30c4f.tar.gz yuzu-464aad52cd644bdc32ca4eb35b0ce669c3b30c4f.tar.xz yuzu-464aad52cd644bdc32ca4eb35b0ce669c3b30c4f.zip | |
settings: Add UiGeneral class
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.cpp | 4 | ||||
| -rw-r--r-- | src/common/settings.h | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 1 | ||||
| -rw-r--r-- | src/yuzu/uisettings.h | 11 |
4 files changed, 16 insertions, 7 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 38a82f6f7..b7a0c063f 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -144,6 +144,9 @@ float Volume() { | |||
| 144 | return values.volume.GetValue() / static_cast<f32>(values.volume.GetDefault()); | 144 | return values.volume.GetValue() / static_cast<f32>(values.volume.GetDefault()); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | Linkage::Linkage() = default; | ||
| 148 | Linkage::~Linkage() = default; | ||
| 149 | |||
| 147 | const char* TranslateCategory(Category category) { | 150 | const char* TranslateCategory(Category category) { |
| 148 | switch (category) { | 151 | switch (category) { |
| 149 | case Category::Audio: | 152 | case Category::Audio: |
| @@ -176,6 +179,7 @@ const char* TranslateCategory(Category category) { | |||
| 176 | case Category::Controls: | 179 | case Category::Controls: |
| 177 | return "Controls"; | 180 | return "Controls"; |
| 178 | case Category::Ui: | 181 | case Category::Ui: |
| 182 | case Category::UiGeneral: | ||
| 179 | return "UI"; | 183 | return "UI"; |
| 180 | case Category::UiLayout: | 184 | case Category::UiLayout: |
| 181 | return "UiLayout"; | 185 | return "UiLayout"; |
diff --git a/src/common/settings.h b/src/common/settings.h index 4ca8299b3..e60105059 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -143,6 +143,7 @@ enum class Category : u32 { | |||
| 143 | AddOns, | 143 | AddOns, |
| 144 | Controls, | 144 | Controls, |
| 145 | Ui, | 145 | Ui, |
| 146 | UiGeneral, | ||
| 146 | UiLayout, | 147 | UiLayout, |
| 147 | UiGameList, | 148 | UiGameList, |
| 148 | Screenshots, | 149 | Screenshots, |
| @@ -209,8 +210,10 @@ public: | |||
| 209 | 210 | ||
| 210 | class Linkage { | 211 | class Linkage { |
| 211 | public: | 212 | public: |
| 212 | std::map<Category, std::forward_list<BasicSetting*>> by_category; | 213 | explicit Linkage(); |
| 213 | std::vector<std::function<void()>> restore_functions; | 214 | ~Linkage(); |
| 215 | std::map<Category, std::forward_list<BasicSetting*>> by_category{}; | ||
| 216 | std::vector<std::function<void()>> restore_functions{}; | ||
| 214 | u32 count; | 217 | u32 count; |
| 215 | }; | 218 | }; |
| 216 | 219 | ||
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 28c606f5e..3181a9528 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -717,6 +717,7 @@ void Config::ReadUIValues() { | |||
| 717 | ReadMultiplayerValues(); | 717 | ReadMultiplayerValues(); |
| 718 | 718 | ||
| 719 | ReadCategory(Settings::Category::Ui); | 719 | ReadCategory(Settings::Category::Ui); |
| 720 | ReadCategory(Settings::Category::UiGeneral); | ||
| 720 | 721 | ||
| 721 | qt_config->endGroup(); | 722 | qt_config->endGroup(); |
| 722 | } | 723 | } |
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 53cdd7fcb..9e2cea4d6 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -78,17 +78,18 @@ struct Values { | |||
| 78 | Setting<bool> show_filter_bar{linkage, true, "showFilterBar", Category::Ui}; | 78 | Setting<bool> show_filter_bar{linkage, true, "showFilterBar", Category::Ui}; |
| 79 | Setting<bool> show_status_bar{linkage, true, "showStatusBar", Category::Ui}; | 79 | Setting<bool> show_status_bar{linkage, true, "showStatusBar", Category::Ui}; |
| 80 | 80 | ||
| 81 | Setting<bool> confirm_before_closing{linkage, true, "confirmClose", Category::Ui}; | 81 | Setting<bool> confirm_before_closing{linkage, true, "confirmClose", Category::UiGeneral}; |
| 82 | Setting<bool> first_start{linkage, true, "firstStart", Category::Ui}; | 82 | Setting<bool> first_start{linkage, true, "firstStart", Category::Ui}; |
| 83 | Setting<bool> pause_when_in_background{linkage, false, "pauseWhenInBackground", Category::Ui}; | 83 | Setting<bool> pause_when_in_background{linkage, false, "pauseWhenInBackground", |
| 84 | Category::UiGeneral}; | ||
| 84 | Setting<bool> mute_when_in_background{linkage, false, "muteWhenInBackground", Category::Ui}; | 85 | Setting<bool> mute_when_in_background{linkage, false, "muteWhenInBackground", Category::Ui}; |
| 85 | Setting<bool> hide_mouse{linkage, true, "hideInactiveMouse", Category::Ui}; | 86 | Setting<bool> hide_mouse{linkage, true, "hideInactiveMouse", Category::UiGeneral}; |
| 86 | Setting<bool> controller_applet_disabled{linkage, false, "disableControllerApplet", | 87 | Setting<bool> controller_applet_disabled{linkage, false, "disableControllerApplet", |
| 87 | Category::Ui}; | 88 | Category::UiGeneral}; |
| 88 | // Set when Vulkan is known to crash the application | 89 | // Set when Vulkan is known to crash the application |
| 89 | bool has_broken_vulkan = false; | 90 | bool has_broken_vulkan = false; |
| 90 | 91 | ||
| 91 | Setting<bool> select_user_on_boot{linkage, false, "select_user_on_boot", Category::Ui}; | 92 | Setting<bool> select_user_on_boot{linkage, false, "select_user_on_boot", Category::UiGeneral}; |
| 92 | Setting<bool> disable_web_applet{linkage, true, "disable_web_applet", Category::Ui}; | 93 | Setting<bool> disable_web_applet{linkage, true, "disable_web_applet", Category::Ui}; |
| 93 | 94 | ||
| 94 | // Discord RPC | 95 | // Discord RPC |