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

View File

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