From 2a5cb6f62159e345441046028ff70bc9e2906b28 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 7 Sep 2017 08:35:09 +0200 Subject: [PATCH] Alias 'color' property name to 'text-color' --- lexer/theme-lexer.l | 2 ++ source/theme.c | 2 +- source/widgets/textbox.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lexer/theme-lexer.l b/lexer/theme-lexer.l index 1eb47aec..5ea7e753 100644 --- a/lexer/theme-lexer.l +++ b/lexer/theme-lexer.l @@ -395,6 +395,8 @@ if ( queue == NULL ){ \.|{WHITESPACE} { return T_NSEP; } ,{WHITESPACE}* { return T_SSEP; } + /* Alias color to text-color */ +
"color" { yylval->sval = g_strdup("text-color"); return T_PROP_NAME;}
{WORD} { yylval->sval = g_strdup(yytext); return T_PROP_NAME;} {WORD} { yylval->sval = g_strdup(yytext); return T_NAME_ELEMENT;} diff --git a/source/theme.c b/source/theme.c index a335db10..10001c0f 100644 --- a/source/theme.c +++ b/source/theme.c @@ -485,7 +485,7 @@ Property *rofi_theme_find_property ( ThemeWidget *widget, PropertyType type, con ThemeWidget *rofi_theme_find_widget ( const char *name, const char *state, gboolean exact ) { // First find exact match based on name. - ThemeWidget *widget = rofi_theme_find ( rofi_theme, name, FALSE ); + ThemeWidget *widget = rofi_theme_find_single ( rofi_theme, name ); widget = rofi_theme_find ( widget, state, exact ); return widget; diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 26883fda..57856b1c 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -442,7 +442,7 @@ static void textbox_draw ( widget *wid, cairo_t *draw ) // TODO check if this is still needed after flatning. cairo_set_operator ( draw, CAIRO_OPERATOR_OVER ); cairo_set_source_rgb ( draw, 0.0, 0.0, 0.0 ); - rofi_theme_get_color ( WIDGET ( tb ), "color", draw ); + rofi_theme_get_color ( WIDGET ( tb ), "text-color", draw ); // draw the cursor if ( tb->flags & TB_EDITABLE && tb->blink ) { // We want to place the cursor based on the text shown.