aboutsummaryrefslogtreecommitdiff
path: root/fastiv-view.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-10-17 12:44:23 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-10-17 12:48:15 +0200
commita6972e4c6e5653f97f29e6aefa4a1840a3105055 (patch)
tree98b25214b43dcccff92c814f32a2748f4ac175a0 /fastiv-view.c
parentfa7b1631f0a0ca911ad9a0aa41278f389f2b45eb (diff)
downloadfiv-a6972e4c6e5653f97f29e6aefa4a1840a3105055.tar.gz
fiv-a6972e4c6e5653f97f29e6aefa4a1840a3105055.tar.xz
fiv-a6972e4c6e5653f97f29e6aefa4a1840a3105055.zip
Don't hardcode the background colour
It can be now overriden in the user's gtk.css.
Diffstat (limited to 'fastiv-view.c')
-rw-r--r--fastiv-view.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index edddeb4..01187b8 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -116,12 +116,10 @@ fastiv_view_draw(GtkWidget *widget, cairo_t *cr)
|| !gtk_cairo_should_draw_window(cr, gtk_widget_get_window(widget)))
return TRUE;
- // TODO(p): Make this adjustable later.
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_paint(cr);
-
GtkAllocation allocation;
gtk_widget_get_allocation(widget, &allocation);
+ gtk_render_background(gtk_widget_get_style_context(widget), cr,
+ 0, 0, allocation.width, allocation.height);
int w = get_display_width(self);
int h = get_display_height(self);
@@ -180,6 +178,7 @@ fastiv_view_class_init(FastivViewClass *klass)
// TODO(p): Later override "screen_changed", recreate Pango layouts there,
// if we get to have any, or otherwise reflect DPI changes.
+ gtk_widget_class_set_css_name(widget_class, "fastiv-view");
}
static void