config: Handle widget style changes in the config file

This commit is contained in:
tomboylover93 2024-12-18 19:15:14 -03:00
parent fbd47b41be
commit 390a308299
2 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,7 @@ static std::string logType = "async";
static std::string userName = "shadPS4";
static std::string updateChannel;
static std::string backButtonBehavior = "left";
static std::string widgetStyle = "Fusion";
static bool useSpecialPad = false;
static int specialPadClass = 1;
static bool isDebugDump = false;
@ -136,6 +137,10 @@ std::string getLogType() {
return logType;
}
std::string getWidgetStyle() {
return widgetStyle;
}
std::string getUserName() {
return userName;
}
@ -320,6 +325,10 @@ void setLogFilter(const std::string& type) {
logFilter = type;
}
void setWidgetStyle(const std::string &type) {
widgetStyle = type;
}
void setUserName(const std::string& type) {
userName = type;
}
@ -614,6 +623,7 @@ void load(const std::filesystem::path& path) {
m_recent_files = toml::find_or<std::vector<std::string>>(gui, "recentFiles", {});
m_table_mode = toml::find_or<int>(gui, "gameTableMode", 0);
emulator_language = toml::find_or<std::string>(gui, "emulatorLanguage", "en");
widgetStyle = toml::find_or<std::string>(gui, "widgetStyle", "System");
}
if (data.contains("Settings")) {
@ -687,6 +697,7 @@ void save(const std::filesystem::path& path) {
data["GUI"]["addonInstallDir"] =
std::string{fmt::UTF(settings_addon_install_dir.u8string()).data};
data["GUI"]["emulatorLanguage"] = emulator_language;
data["GUI"]["widgetStyle"] = widgetStyle;
data["Settings"]["consoleLanguage"] = m_language;
std::ofstream file(path, std::ios::binary);
@ -747,6 +758,7 @@ void setDefaultValues() {
screenHeight = 720;
logFilter = "";
logType = "async";
widgetStyle = "Fusion";
userName = "shadPS4";
if (Common::isRelease) {
updateChannel = "Release";

View File

@ -24,6 +24,7 @@ bool getSeparateUpdateEnabled();
std::string getLogFilter();
std::string getLogType();
std::string getWidgetStyle();
std::string getUserName();
std::string getUpdateChannel();
@ -78,6 +79,7 @@ void setSpecialPadClass(int type);
void setLogType(const std::string& type);
void setLogFilter(const std::string& type);
void setWidgetStyle(const std::string& type);
void setVkValidation(bool enable);
void setVkSyncValidation(bool enable);