mirror of
https://github.com/lbonn/rofi
synced 2024-11-26 22:00:20 +00:00
Fix text color when cursor-color
is set (#1901)
* Fix text color when cursor color is set * Add comment
This commit is contained in:
parent
1243dca65b
commit
05327773d9
1 changed files with 4 additions and 0 deletions
|
@ -540,6 +540,9 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
|
|||
tb->cursor_x_pos = x + cursor_x;
|
||||
}
|
||||
if (tb->blink) {
|
||||
// This save/restore state is necessary to render the text in the
|
||||
// correct color when `cursor-color` is set
|
||||
cairo_save(draw);
|
||||
// use text color as fallback for themes that don't specify the cursor
|
||||
// color
|
||||
rofi_theme_get_color(WIDGET(tb), "cursor-color", draw);
|
||||
|
@ -555,6 +558,7 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
|
|||
} else {
|
||||
cairo_fill(draw);
|
||||
}
|
||||
cairo_restore(draw);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue