summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2020-01-02 13:42:14 +0100
committerDave Davenport <qball@gmpclient.org>2020-01-02 13:42:14 +0100
commitb4b85b2a715fa2a618b492103968efe6176054c4 (patch)
tree784c96f6bb1028a2628fd1ea646d5e33e31d0c62
parentb44b5e8d16b673e473cd9cb4f59618676aedea7a (diff)
[Textbox] Don't use placeholder color for cursor.
-rw-r--r--source/widgets/textbox.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/widgets/textbox.c b/source/widgets/textbox.c
index 949e4623..2d8be530 100644
--- a/source/widgets/textbox.c
+++ b/source/widgets/textbox.c
@@ -441,10 +441,18 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
cairo_set_operator ( draw, CAIRO_OPERATOR_OVER );
cairo_set_source_rgb ( draw, 0.0, 0.0, 0.0 );
rofi_theme_get_color ( WIDGET ( tb ), "text-color", draw );
+
if ( tb->show_placeholder ) {
rofi_theme_get_color ( WIDGET ( tb ), "placeholder-color", draw );
}
+ // Set ARGB
+ // We need to set over, otherwise subpixel hinting wont work.
+ cairo_move_to ( draw, x, top );
+ pango_cairo_show_layout ( draw, tb->layout );
+
+
// draw the cursor
+ rofi_theme_get_color ( WIDGET ( tb ), "text-color", draw );
if ( tb->flags & TB_EDITABLE && tb->blink ) {
// We want to place the cursor based on the text shown.
const char *text = pango_layout_get_text ( tb->layout );
@@ -462,10 +470,6 @@ static void textbox_draw ( widget *wid, cairo_t *draw )
cairo_fill ( draw );
}
- // Set ARGB
- // We need to set over, otherwise subpixel hinting wont work.
- cairo_move_to ( draw, x, top );
- pango_cairo_show_layout ( draw, tb->layout );
if ( ( tb->flags & TB_INDICATOR ) == TB_INDICATOR && ( tb->tbft & ( SELECTED ) ) ) {
cairo_arc ( draw, DOT_OFFSET / 2.0, tb->widget.h / 2.0, 2.0, 0, 2.0 * M_PI );