diff --git a/common/tokenize.gperf b/common/tokenize.gperf index 2e56187ad..f4dc6d155 100644 --- a/common/tokenize.gperf +++ b/common/tokenize.gperf @@ -23,6 +23,7 @@ min_value reverse right scale +text ticks_count ticks_gap top diff --git a/widgets/progressbar.c b/widgets/progressbar.c index d7c7512da..cdbcfe6b3 100644 --- a/widgets/progressbar.c +++ b/widgets/progressbar.c @@ -412,7 +412,8 @@ progressbar_tell(widget_t *widget, const char *property, const char *new_value) if(!new_value) return WIDGET_ERROR_NOVALUE; - switch (prop) { + switch (prop) + { case A_TK_GAP: d->gap = atoi(new_value); return WIDGET_NOERROR; @@ -470,7 +471,8 @@ progressbar_tell(widget_t *widget, const char *property, const char *new_value) return WIDGET_ERROR; } - switch (prop) { + switch (prop) + { case A_TK_DATA: value = atof(setting); bar->value = (value < bar->min_value ? bar->min_value : diff --git a/widgets/textbox.c b/widgets/textbox.c index 5aa3cf680..c01ef147e 100644 --- a/widgets/textbox.c +++ b/widgets/textbox.c @@ -24,6 +24,7 @@ #include "screen.h" #include "common/util.h" #include "common/configopts.h" +#include "common/tokenize.h" extern awesome_t globalconf; @@ -73,15 +74,18 @@ textbox_tell(widget_t *widget, const char *property, const char *new_value) { textbox_data_t *d = widget->data; - if(!a_strcmp(property, "text")) + switch(a_tokenize(property, -1)) { + case A_TK_TEXT: p_delete(&d->text); a_iso2utf8(new_value, &d->text); - } - else if(!a_strcmp(property, "width")) + break; + case A_TK_WIDTH: d->width = atoi(new_value); - else + break; + default: return WIDGET_ERROR; + } return WIDGET_NOERROR; }