Added cursor icon always on option to general settings

This commit is contained in:
AdenKoperczak 2024-11-30 15:43:50 -05:00
parent 40b3ecce16
commit 64b679a002
6 changed files with 43 additions and 9 deletions

View file

@ -77,6 +77,7 @@ public:
trackLocation_.SetDefault(false);
updateNotificationsEnabled_.SetDefault(true);
warningsProvider_.SetDefault(defaultWarningsProviderValue);
cursorIconAlwaysOn_.SetDefault(false);
fontSizes_.SetElementMinimum(1);
fontSizes_.SetElementMaximum(72);
@ -166,6 +167,7 @@ public:
SettingsVariable<bool> trackLocation_ {"track_location"};
SettingsVariable<bool> updateNotificationsEnabled_ {"update_notifications"};
SettingsVariable<std::string> warningsProvider_ {"warnings_provider"};
SettingsVariable<bool> cursorIconAlwaysOn_ {"cursor_icon_always_on"};
};
GeneralSettings::GeneralSettings() :
@ -198,7 +200,8 @@ GeneralSettings::GeneralSettings() :
&p->themeFile_,
&p->trackLocation_,
&p->updateNotificationsEnabled_,
&p->warningsProvider_});
&p->warningsProvider_,
&p->cursorIconAlwaysOn_});
SetDefaults();
}
GeneralSettings::~GeneralSettings() = default;
@ -348,6 +351,11 @@ SettingsVariable<std::string>& GeneralSettings::warnings_provider() const
return p->warningsProvider_;
}
SettingsVariable<bool>& GeneralSettings::cursor_icon_always_on() const
{
return p->cursorIconAlwaysOn_;
}
bool GeneralSettings::Shutdown()
{
bool dataChanged = false;
@ -397,7 +405,8 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs)
lhs.p->trackLocation_ == rhs.p->trackLocation_ &&
lhs.p->updateNotificationsEnabled_ ==
rhs.p->updateNotificationsEnabled_ &&
lhs.p->warningsProvider_ == rhs.p->warningsProvider_);
lhs.p->warningsProvider_ == rhs.p->warningsProvider_ &&
lhs.p->cursorIconAlwaysOn_ == rhs.p->cursorIconAlwaysOn_);
}
} // namespace settings

View file

@ -53,6 +53,7 @@ public:
SettingsVariable<bool>& track_location() const;
SettingsVariable<bool>& update_notifications_enabled() const;
SettingsVariable<std::string>& warnings_provider() const;
SettingsVariable<bool>& cursor_icon_always_on() const;
static GeneralSettings& Instance();