summaryrefslogtreecommitdiff
path: root/libview
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-12-10 01:35:29 +0100
committerinfirit <[email protected]>2014-12-10 01:35:29 +0100
commit4130805895a7969e543203777c77c0cf4d040e5f (patch)
tree525f529916ee0d39d523bb2df70a26f47b3ddd6d /libview
parent574c93458607dc2a4331b819a8761893c3f2d1fb (diff)
downloadatril-4130805895a7969e543203777c77c0cf4d040e5f.tar.bz2
atril-4130805895a7969e543203777c77c0cf4d040e5f.tar.xz
Gtk3: presentation: Make sure background window is black by default in presentation mode
Taken from evince commit: cb45bdc33321121e2e0ec14e0c74530623180858 From: Carlos Garcia Campos <[email protected]>
Diffstat (limited to 'libview')
-rw-r--r--libview/ev-view-presentation.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/libview/ev-view-presentation.c b/libview/ev-view-presentation.c
index 7558f92c..d9386563 100644
--- a/libview/ev-view-presentation.c
+++ b/libview/ev-view-presentation.c
@@ -1364,7 +1364,8 @@ ev_view_presentation_realize (GtkWidget *widget)
gtk_widget_set_window (widget, window);
#if GTK_CHECK_VERSION (3, 0, 0)
- gdk_window_set_background_rgba (window, &black);
+ gtk_style_context_set_background (gtk_widget_get_style_context (widget),
+ window);
#else
gtk_widget_style_attach (widget);
style = gtk_widget_get_style (widget);
@@ -1489,6 +1490,9 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
#endif
GtkBindingSet *binding_set;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkCssProvider *provider;
+#endif
klass->change_page = ev_view_presentation_change_page;
@@ -1609,6 +1613,18 @@ ev_view_presentation_class_init (EvViewPresentationClass *klass)
gtk_binding_entry_add_signal (binding_set, GDK_KEY_K, 0,
"change_page", 1,
GTK_TYPE_SCROLL_TYPE, GTK_SCROLL_PAGE_BACKWARD);
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "EvViewPresentation {\n"
+ " background-color: black; }",
+ -1, NULL);
+ gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+#endif
}
static void