Commit a56186e4 authored by William Jon McCann's avatar William Jon McCann Committed by Carlos Garcia Campos
Browse files

Set a style class on the view so it can be more easily styled

And share the style we use for other content views.
parent 38528f9f
......@@ -3403,9 +3403,6 @@ ev_view_realize (GtkWidget *widget)
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);
gdk_window_set_user_data (window, widget);
gtk_style_context_set_background (gtk_widget_get_style_context (widget),
static gboolean
......@@ -3416,6 +3413,12 @@ ev_view_draw (GtkWidget *widget,
gint i;
GdkRectangle clip_rect;
gtk_render_background (gtk_widget_get_style_context (widget),
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget));
if (view->document == NULL)
return FALSE;
......@@ -4922,11 +4925,17 @@ ev_view_class_init (EvViewClass *class)
static void
ev_view_init (EvView *view)
GtkStyleContext *context;
gtk_widget_set_has_window (GTK_WIDGET (view), TRUE);
gtk_widget_set_can_focus (GTK_WIDGET (view), TRUE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (view), FALSE);
gtk_container_set_resize_mode (GTK_CONTAINER (view), GTK_RESIZE_QUEUE);
context = gtk_widget_get_style_context (GTK_WIDGET (view));
gtk_style_context_add_class (context, "content-view");
gtk_style_context_add_class (context, "view");
gtk_widget_set_events (GTK_WIDGET (view),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment