[gnome-music] Fix loading the CSS stylesheet
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] Fix loading the CSS stylesheet
- Date: Tue, 2 Apr 2013 17:37:10 +0000 (UTC)
commit 8be9125f2f373fb08187c045760e00c6b6cc39a3
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Tue Apr 2 19:27:32 2013 +0200
Fix loading the CSS stylesheet
Include it in the resource, and load it at application startup.
.../gtk-style.css => data/application.css | 0
data/gnome-music.gresource.xml | 3 ++-
src/application.js | 7 +++++++
3 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/resources/gtk-style.css b/data/application.css
similarity index 100%
rename from src/resources/gtk-style.css
rename to data/application.css
diff --git a/data/gnome-music.gresource.xml b/data/gnome-music.gresource.xml
index fb57524..128f3e7 100644
--- a/data/gnome-music.gresource.xml
+++ b/data/gnome-music.gresource.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/music">
- <file>app-menu.ui</file>
+ <file preprocess="xml-stripblanks">app-menu.ui</file>
+ <file>application.css</file>
</gresource>
</gresources>
diff --git a/src/application.js b/src/application.js
index 676c25b..79f2b91 100644
--- a/src/application.js
+++ b/src/application.js
@@ -70,6 +70,13 @@ const Application = new Lang.Class({
let resource = Gio.Resource.load(pkg.pkgdatadir + '/gnome-music.gresource');
resource._register();
+ let cssFile = Gio.File.new_for_uri('resource:///org/gnome/music/application.css');
+ let provider = new Gtk.CssProvider();
+ provider.load_from_file(cssFile);
+ Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(),
+ provider,
+ Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+
this._window = new Window.MainWindow(this);
this._buildAppMenu();
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]