diff options
author | Dave Davenport <qball@gmpclient.org> | 2017-01-08 20:39:37 +0100 |
---|---|---|
committer | Dave Davenport <qball@gmpclient.org> | 2017-01-08 20:39:37 +0100 |
commit | 8c0c43952dceb78d717f036478b4d66c75267a3b (patch) | |
tree | 4e639813c203268e55c05a53f684ddcdde75c691 | |
parent | 8fe5ea648a0c367dd4a10e0600d116ddc962ecdb (diff) |
Make 'text' override foreground color for rendering text
-rw-r--r-- | doc/themer.md | 1 | ||||
-rw-r--r-- | source/widgets/textbox.c | 14 |
2 files changed, 3 insertions, 12 deletions
diff --git a/doc/themer.md b/doc/themer.md index 01ea59bf..ffa8d24c 100644 --- a/doc/themer.md +++ b/doc/themer.md @@ -155,6 +155,7 @@ The following properties are currently supports: * textbox: * background: color * foreground: color + * text: The text color to use (falls back to foreground if not set) * listview: * columns: integer diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c index 877266b5..0a848e99 100644 --- a/source/widgets/textbox.c +++ b/source/widgets/textbox.c @@ -362,11 +362,9 @@ static void texbox_update ( textbox *tb ) } y = widget_padding_get_top ( WIDGET (tb) ) + ( pango_font_metrics_get_ascent ( p_metrics ) - pango_layout_get_baseline ( tb->layout ) ) / PANGO_SCALE; - // Set background transparency - //cairo_set_source_rgba ( tb->main_draw, 0,0,0,0.0); - //cairo_paint ( tb->main_draw ); - rofi_theme_get_color ( WIDGET ( tb ), "foreground", tb->main_draw); + // Text + rofi_theme_get_color ( WIDGET ( tb ), "text", tb->main_draw); // draw the cursor if ( tb->flags & TB_EDITABLE && tb->blink ) { cairo_rectangle ( tb->main_draw, x + cursor_x, y+cursor_y, cursor_width, cursor_height); @@ -380,14 +378,6 @@ static void texbox_update ( textbox *tb ) pango_cairo_show_layout ( tb->main_draw, tb->layout ); if ( ( tb->flags & TB_INDICATOR ) == TB_INDICATOR && ( tb->tbft & ( SELECTED ) ) ) { - /* - if ( ( tb->tbft & SELECTED ) == SELECTED ) { - cairo_set_source_rgba ( tb->main_draw, col.red, col.green, col.blue, col.alpha ); - } - else if ( ( tb->tbft & HIGHLIGHT ) == HIGHLIGHT ) { - cairo_set_source_rgba ( tb->main_draw, col.red, col.green, col.blue, col.alpha * 0.2 ); - } - */ cairo_arc ( tb->main_draw, DOT_OFFSET / 2.0, tb->widget.h / 2.0, 2.0, 0, 2.0 * M_PI ); cairo_fill ( tb->main_draw ); |