diff options
author | Alexandre Mazari <scaroo@gmail.com> | 2011-07-30 12:57:51 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2011-07-30 13:10:17 +0800 |
commit | d6f43136341159cccde9f707f2a493c109ec4e85 (patch) | |
tree | f9cd5ac4c6b6ffdd08f3404e90236c8b13c609a1 /src/ephy-window.c | |
parent | f4c6a2f079f5b24c067f2b656a8a4f808ec4533c (diff) | |
download | gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.tar gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.tar.gz gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.tar.bz2 gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.tar.lz gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.tar.xz gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.tar.zst gsoc2013-epiphany-d6f43136341159cccde9f707f2a493c109ec4e85.zip |
e-window: use a css file for widget styling
Replace local styling (used for the tab close button and embed's status
frame) by a global css sheet loaded at window construction.
This allows tweaking style properties without rebuilding.
The css file is installed in $(pkgdatadir)/epiphany.css.
Signed-off-by: Diego Escalante Urrelo <descalante@igalia.com>
Bug #644805
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r-- | src/ephy-window.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index f5ee4b2a9..f8cedf9be 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -3683,6 +3683,8 @@ ephy_window_constructor (GType type, guint settings_connection; GSList *proxies; GtkWidget *proxy; + GtkCssProvider *css_provider; + GFile *css_file; object = G_OBJECT_CLASS (ephy_window_parent_class)->constructor (type, n_construct_properties, construct_params); @@ -3779,6 +3781,27 @@ ephy_window_constructor (GType type, } #endif + /* Attach the CSS provider to the window */ + css_file = g_file_new_for_path (ephy_file ("epiphany.css")); + css_provider = gtk_css_provider_new (); + gtk_css_provider_load_from_file (css_provider, + css_file, + &error); + if (error == NULL) + { + gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (GTK_WIDGET (window)), + GTK_STYLE_PROVIDER (css_provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + else + { + g_warning ("Could not attach css style: %s", error->message); + g_error_free (error); + } + + g_object_unref (css_provider); + g_object_unref (css_file); + /* Initialize the menus */ priv->tabs_menu = ephy_tabs_menu_new (window); priv->enc_menu = ephy_encoding_menu_new (window); |