theming: add a CSS file for nautilus, and initialize it at startup

This commit is contained in:
Cosimo Cecchi 2010-12-15 19:35:38 +01:00
parent 1c79bf9809
commit dad5d12770
3 changed files with 46 additions and 0 deletions

View file

@ -23,11 +23,13 @@ nautilusdatadir = $(datadir)/nautilus
nautilusdata_DATA = \
nautilus-extras.placeholder \
nautilus-suggested.placeholder \
nautilus.css \
$(NULL)
EXTRA_DIST = $(nautilusdata_DATA) \
nautilus.desktop \
nautilus.desktop.in \
nautilus.css \
$(xml_in_files) \
$(desktop_in_files) \
$(NULL)

19
data/nautilus.css Normal file
View file

@ -0,0 +1,19 @@
GtkTreeView.NautilusSidebar {
background-color: #f6f6f4;
}
#statusbar-no-border {
-GtkStatusbar-shadow-type: none;
}
#nautilus-extra-view-widget {
background-color: #a7c6e1;
}
#nautilus-tab-close-button {
-GtkWidget-focus-padding : 0;
-GtkWidget-focus-line-width: 0;
xthickness: 0;
ythickness: 0;
}

View file

@ -1499,6 +1499,28 @@ nautilus_application_command_line (GApplication *app,
return retval;
}
static void
init_css (void)
{
GtkCssProvider *provider;
GError *error = NULL;
provider = gtk_css_provider_new ();
gtk_css_provider_load_from_path (provider,
NAUTILUS_DATADIR G_DIR_SEPARATOR_S "nautilus.css", &error);
if (error != NULL) {
g_warning ("Can't parse NautilusPlacesSidebar's CSS custom description: %s\n", error->message);
g_error_free (error);
} else {
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
GTK_STYLE_PROVIDER (provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
g_object_unref (provider);
}
static void
nautilus_application_startup (GApplication *app)
{
@ -1534,6 +1556,9 @@ nautilus_application_startup (GApplication *app)
/* register property pages */
nautilus_image_properties_page_register ();
/* initialize CSS theming */
init_css ();
/* initialize search path for custom icons */
gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
NAUTILUS_DATADIR G_DIR_SEPARATOR_S "icons");