summaryrefslogtreecommitdiff
path: root/mate-panel
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2018-04-23 16:46:40 +0200
committerraveit65 <[email protected]>2018-04-26 13:05:43 +0200
commit3db6772bd564fc2c592b61853b870dd8c9dc5e1b (patch)
tree160f735372c54812a02d62854ab1aa9def75e3eb /mate-panel
parent9ee6deb9c12ebeb39337f228aa62abbb68ca5a38 (diff)
downloadmate-panel-3db6772bd564fc2c592b61853b870dd8c9dc5e1b.tar.bz2
mate-panel-3db6772bd564fc2c592b61853b870dd8c9dc5e1b.tar.xz
css: Convert to GResource
Diffstat (limited to 'mate-panel')
-rw-r--r--mate-panel/Makefile.am1
-rw-r--r--mate-panel/main.c35
-rw-r--r--mate-panel/panel.gresource.xml4
3 files changed, 21 insertions, 19 deletions
diff --git a/mate-panel/Makefile.am b/mate-panel/Makefile.am
index 6de930be..836b49e4 100644
--- a/mate-panel/Makefile.am
+++ b/mate-panel/Makefile.am
@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
-I$(top_builddir)/mate-panel/libpanel-util \
-DMATELOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DPANELDATADIR=\""$(datadir)/mate-panel"\" \
- -DDATADIR=\""$(datadir)"\" \
$(DISABLE_DEPRECATED_CFLAGS)
AM_CFLAGS = $(WARN_CFLAGS)
diff --git a/mate-panel/main.c b/mate-panel/main.c
index dc136cda..825ec348 100644
--- a/mate-panel/main.c
+++ b/mate-panel/main.c
@@ -60,8 +60,12 @@ main (int argc, char **argv)
{
char *desktopfile;
GOptionContext *context;
- GError *error, *error2;
- GtkCssProvider *provider;
+ GError *error;
+ GdkScreen *screen;
+ GtkCssProvider *css;
+ GtkStyleProvider *provider;
+ const gchar *resource;
+ guint priority;
bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
@@ -167,22 +171,17 @@ main (int argc, char **argv)
* connecting to the session manager */
panel_session_init ();
- /*Load a css file from a path so the drag handle image can be loaded*/
- error2 = NULL;
- provider = gtk_css_provider_new ();
- gtk_css_provider_load_from_path (provider,
- DATADIR "/mate-panel/" "mate-panel.css", &error2);
-
- if (error2 != NULL) {
- g_warning ("Can't parse mate-panel CSS custom description: %s\n", error2->message);
- g_error_free (error2);
- }
- else {
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default(),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_FALLBACK);
- }
- g_object_unref (provider);
+ /*Load a css file from a GResource so the drag handle image can be loaded*/
+ screen = gdk_screen_get_default ();
+ css = gtk_css_provider_new ();
+ provider = GTK_STYLE_PROVIDER (css);
+ resource = "/org/mate/panel/theme/mate-panel.css";
+ priority = GTK_STYLE_PROVIDER_PRIORITY_FALLBACK;
+
+ gtk_css_provider_load_from_resource (css, resource);
+ gtk_style_context_add_provider_for_screen (screen, provider, priority);
+
+ g_object_unref (provider);
gtk_main ();
diff --git a/mate-panel/panel.gresource.xml b/mate-panel/panel.gresource.xml
index c49541d0..df6396c5 100644
--- a/mate-panel/panel.gresource.xml
+++ b/mate-panel/panel.gresource.xml
@@ -5,4 +5,8 @@
<file compressed="true">panel-run-dialog.ui</file>
<file alias="anim/wanda.png">../applets/fish/wanda.png</file>
</gresource>
+ <gresource prefix="/org/mate/panel/theme">
+ <file alias="mate-panel.css">../data/theme/mate-panel.css</file>
+ <file alias="panel-grid-symbolic.svg">../data/theme/panel-grid-symbolic.svg</file>
+ </gresource>
</gresources>