summaryrefslogtreecommitdiff
path: root/shell/ev-window.c
diff options
context:
space:
mode:
authorCarlos Garcia Campos <[email protected]>2012-09-29 12:22:17 +0200
committerraveit65 <[email protected]>2018-03-22 21:24:30 +0100
commit1b1f2c58617b72efb9aad7ebc98fe390138d733f (patch)
tree59d41dbf6f529175d9dd678db1050a209e837577 /shell/ev-window.c
parent11fc5dc635d544b7d19b5774ab11dcd5e5c2638c (diff)
downloadatril-1b1f2c58617b72efb9aad7ebc98fe390138d733f.tar.bz2
atril-1b1f2c58617b72efb9aad7ebc98fe390138d733f.tar.xz
Move custom css to a file compiled as a gresource
origin commit: https://git.gnome.org/browse/evince/commit/shell?h=gnome-3-6&id=65fa4ff
Diffstat (limited to 'shell/ev-window.c')
-rw-r--r--shell/ev-window.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 065ada89..6bb7eefb 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4231,7 +4231,7 @@ ev_window_run_fullscreen (EvWindow *window)
"/FullscreenToolbar");
gtk_widget_set_name (window->priv->fullscreen_toolbar,
- "atril-fullscreen-toolbar");
+ "ev-fullscreen-toolbar");
gtk_toolbar_set_style (GTK_TOOLBAR (window->priv->fullscreen_toolbar),
GTK_TOOLBAR_BOTH_HORIZ);
fullscreen_toolbar_setup_item_properties (window->priv->ui_manager);
@@ -7647,11 +7647,33 @@ handle_sync_view_cb (EvAtrilWindow *object,
}
#endif /* ENABLE_DBUS */
+static gboolean
+_gtk_css_provider_load_from_resource (GtkCssProvider *provider,
+ const char *resource_path,
+ GError **error)
+{
+ GBytes *data;
+ gboolean retval;
+
+ data = g_resources_lookup_data (resource_path, 0, error);
+ if (!data)
+ return FALSE;
+
+ retval = gtk_css_provider_load_from_data (provider,
+ g_bytes_get_data (data, NULL),
+ g_bytes_get_size (data),
+ error);
+ g_bytes_unref (data);
+
+ return retval;
+}
+
static void
ev_window_init (EvWindow *ev_window)
{
GtkActionGroup *action_group;
GtkAccelGroup *accel_group;
+ GtkCssProvider *css_provider;
GError *error = NULL;
GtkWidget *sidebar_widget;
GtkWidget *menuitem;
@@ -7758,6 +7780,16 @@ ev_window_init (EvWindow *ev_window)
&error);
g_assert_no_error (error);
+ css_provider = gtk_css_provider_new ();
+ _gtk_css_provider_load_from_resource (css_provider,
+ "/org/mate/atril/shell/ui/atril.css",
+ &error);
+ g_assert_no_error (error);
+ gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (GTK_WIDGET (ev_window)),
+ GTK_STYLE_PROVIDER (css_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (css_provider);
+
ev_window->priv->recent_manager = gtk_recent_manager_get_default ();
ev_window->priv->recent_action_group = NULL;
ev_window->priv->recent_ui_id = 0;