on, true and yes are now synonymous in messages

This commit is contained in:
FelixKratz 2021-09-15 20:02:10 +02:00
parent 70d9b7a983
commit 0b3291d5f0
2 changed files with 5 additions and 2 deletions

View file

@ -252,7 +252,6 @@ this currently works for the properties:
* *icon_highlight_color*
* *icon_padding_left*
* *icon_padding_right*
* *background_color*
* *draws_background*
* *background_color*
* *background_border_color*

View file

@ -96,7 +96,11 @@ extern bool g_verbose;
#define ARGUMENT_COMMON_VAL_ON "on"
#define ARGUMENT_COMMON_VAL_TRUE "true"
#define ARGUMENT_COMMON_VAL_YES "yes"
#define ARGUMENT_COMMON_VAL_OFF "off"
#define ARGUMENT_COMMON_VAL_FALSE "false"
#define ARGUMENT_COMMON_VAL_NO "no"
#define ARGUMENT_COMMON_VAL_TOGGLE "toggle"
#define ARGUMENT_COMMON_NO_SPACE "nospace"
@ -198,7 +202,7 @@ static void pack_key_value_pair(char* cursor, char* key, char* value) {
static bool evaluate_boolean_state(struct token state, bool previous_state) {
if (token_equals(state, ARGUMENT_COMMON_VAL_ON)) return true;
if (token_equals(state, ARGUMENT_COMMON_VAL_ON) || token_equals(state, ARGUMENT_COMMON_VAL_YES) || token_equals(state, ARGUMENT_COMMON_VAL_TRUE)) return true;
else if (token_equals(state, ARGUMENT_COMMON_VAL_TOGGLE)) return !previous_state;
else return false;
}