Instead of setting the popup default colours in the draw callback, set

it up in popup_display and follow the same routine as panes in the draw
and init_ctx callbacks - use the palette if the option value is default.
Allows application-set fg and bg to work in panes again.
This commit is contained in:
nicm
2021-10-25 09:22:17 +00:00
parent 9b4148b12c
commit 0cca695d6e
3 changed files with 48 additions and 39 deletions

View File

@ -184,8 +184,10 @@ screen_write_initctx(struct screen_write_ctx *ctx, struct tty_ctx *ttyctx,
if (ctx->init_ctx_cb != NULL) {
ctx->init_ctx_cb(ctx, ttyctx);
if (ttyctx->palette != NULL) {
ttyctx->defaults.fg = ttyctx->palette->fg;
ttyctx->defaults.bg = ttyctx->palette->bg;
if (COLOUR_DEFAULT(ttyctx->defaults.fg))
ttyctx->defaults.fg = ttyctx->palette->fg;
if (COLOUR_DEFAULT(ttyctx->defaults.bg))
ttyctx->defaults.bg = ttyctx->palette->bg;
}
} else {
ttyctx->redraw_cb = screen_write_redraw_cb;