diff --git a/unix/area.c b/unix/area.c index c46447cc..ca99e602 100644 --- a/unix/area.c +++ b/unix/area.c @@ -119,7 +119,8 @@ static gboolean areaWidget_draw(GtkWidget *w, cairo_t *cr) uiAreaDrawParams dp; double clipX0, clipY0, clipX1, clipY1; - dp.Context = newContext(cr); + dp.Context = newContext(cr, + gtk_widget_get_style_context(a->widget)); loadAreaSize(a, &(dp.AreaWidth), &(dp.AreaHeight)); diff --git a/unix/draw.c b/unix/draw.c index 2d7a6367..b4d18049 100644 --- a/unix/draw.c +++ b/unix/draw.c @@ -2,17 +2,19 @@ #include "uipriv_unix.h" #include "draw.h" -uiDrawContext *newContext(cairo_t *cr) +uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style) { uiDrawContext *c; c = uiNew(uiDrawContext); c->cr = cr; + c->style = style; return c; } void freeContext(uiDrawContext *c) { + // free neither cr nor style; we own neither uiFree(c); } diff --git a/unix/draw.h b/unix/draw.h index dbd82ff5..9eec2846 100644 --- a/unix/draw.h +++ b/unix/draw.h @@ -3,6 +3,7 @@ // draw.c struct uiDrawContext { cairo_t *cr; + GtkStyleContext *style; }; // drawpath.c diff --git a/unix/uipriv_unix.h b/unix/uipriv_unix.h index 0a477158..3764f8ef 100644 --- a/unix/uipriv_unix.h +++ b/unix/uipriv_unix.h @@ -42,7 +42,7 @@ extern GtkWidget *childBox(struct child *c); extern void childSetMargined(struct child *c, int margined); // draw.c -extern uiDrawContext *newContext(cairo_t *); +extern uiDrawContext *newContext(cairo_t *cr, GtkStyleContext *style); extern void freeContext(uiDrawContext *); // drawtext.c