qt_gui: Organize settings page (#1316)

* Wire up translations and descriptions for the cursor settings.
* Move controller settings to input tab and rename it to controller (to inline it with how other settings are shown).
* Fixed unnecessary double initialization of the back button setting.
* Organize statements and functions w/ respect to their tabs and some minor QOL changes for the settings UI in general.
This commit is contained in:
Exhigh 2024-10-10 18:52:39 +04:00 committed by GitHub
parent 299a29e243
commit 87f8f3a59e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 499 additions and 242 deletions

View file

@ -473,7 +473,6 @@ void load(const std::filesystem::path& path) {
}
isShowSplash = toml::find_or<bool>(general, "showSplash", true);
isAutoUpdate = toml::find_or<bool>(general, "autoUpdate", false);
backButtonBehavior = toml::find_or<std::string>(general, "backButtonBehavior", "left");
}
if (data.contains("Input")) {
@ -481,6 +480,7 @@ void load(const std::filesystem::path& path) {
cursorState = toml::find_or<int>(input, "cursorState", HideCursorState::Idle);
cursorHideTimeout = toml::find_or<int>(input, "cursorHideTimeout", 5);
backButtonBehavior = toml::find_or<std::string>(input, "backButtonBehavior", "left");
useSpecialPad = toml::find_or<bool>(input, "useSpecialPad", false);
specialPadClass = toml::find_or<int>(input, "specialPadClass", 1);
}
@ -594,7 +594,7 @@ void save(const std::filesystem::path& path) {
data["General"]["autoUpdate"] = isAutoUpdate;
data["Input"]["cursorState"] = cursorState;
data["Input"]["cursorHideTimeout"] = cursorHideTimeout;
data["General"]["backButtonBehavior"] = backButtonBehavior;
data["Input"]["backButtonBehavior"] = backButtonBehavior;
data["Input"]["useSpecialPad"] = useSpecialPad;
data["Input"]["specialPadClass"] = specialPadClass;
data["GPU"]["screenWidth"] = screenWidth;
@ -650,8 +650,6 @@ void setDefaultValues() {
playBGM = false;
BGMvolume = 50;
enableDiscordRPC = true;
cursorState = HideCursorState::Idle;
cursorHideTimeout = 5;
screenWidth = 1280;
screenHeight = 720;
logFilter = "";
@ -662,6 +660,8 @@ void setDefaultValues() {
} else {
updateChannel = "Nightly";
}
cursorState = HideCursorState::Idle;
cursorHideTimeout = 5;
backButtonBehavior = "left";
useSpecialPad = false;
specialPadClass = 1;

View file

@ -20,15 +20,14 @@ bool getPlayBGM();
int getBGMvolume();
bool getEnableDiscordRPC();
s16 getCursorState();
int getCursorHideTimeout();
std::string getLogFilter();
std::string getLogType();
std::string getUserName();
std::string getUpdateChannel();
std::string getBackButtonBehavior();
s16 getCursorState();
int getCursorHideTimeout();
std::string getBackButtonBehavior();
bool getUseSpecialPad();
int getSpecialPadClass();
@ -59,14 +58,14 @@ void setFullscreenMode(bool enable);
void setPlayBGM(bool enable);
void setBGMvolume(int volume);
void setEnableDiscordRPC(bool enable);
void setCursorState(s16 cursorState);
void setCursorHideTimeout(int newcursorHideTimeout);
void setLanguage(u32 language);
void setNeoMode(bool enable);
void setUserName(const std::string& type);
void setUpdateChannel(const std::string& type);
void setBackButtonBehavior(const std::string& type);
void setCursorState(s16 cursorState);
void setCursorHideTimeout(int newcursorHideTimeout);
void setBackButtonBehavior(const std::string& type);
void setUseSpecialPad(bool use);
void setSpecialPadClass(int type);