summaryrefslogtreecommitdiff
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
parent9ee6deb9c12ebeb39337f228aa62abbb68ca5a38 (diff)
downloadmate-panel-3db6772bd564fc2c592b61853b870dd8c9dc5e1b.tar.bz2
mate-panel-3db6772bd564fc2c592b61853b870dd8c9dc5e1b.tar.xz
css: Convert to GResource
-rw-r--r--configure.ac1
-rw-r--r--data/Makefile.am8
-rw-r--r--data/theme/Makefile.am8
-rw-r--r--data/theme/mate-panel.css (renamed from data/mate-panel.css)0
-rw-r--r--data/theme/panel-grid-symbolic.svg (renamed from data/panel-grid-symbolic.svg)0
-rw-r--r--mate-panel/Makefile.am1
-rw-r--r--mate-panel/main.c35
-rw-r--r--mate-panel/panel.gresource.xml4
8 files changed, 33 insertions, 24 deletions
diff --git a/configure.ac b/configure.ac
index aa94cfb7..65a1a4b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,6 +254,7 @@ AC_SUBST(REBUILD)
AC_OUTPUT([
Makefile
data/Makefile
+data/theme/Makefile
data/org.mate.panel.gschema.xml
data/org.mate.panel.menubar.gschema.xml
data/org.mate.panel.object.gschema.xml
diff --git a/data/Makefile.am b/data/Makefile.am
index ad405ccd..74c58edd 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,3 +1,6 @@
+SUBDIRS = \
+ theme
+
layoutdir = $(datadir)/mate-panel/layouts
layout_DATA = \
default.layout \
@@ -7,11 +10,6 @@ layout_DATA = \
opensuse.layout \
ubuntu.layout
-matepaneldir = $(datadir)/mate-panel
-matepanel_DATA = \
- mate-panel.css \
- panel-grid-symbolic.svg
-
@INTLTOOL_XML_NOMERGE_RULE@
gsettings_ENUM_NAMESPACE = org.mate.panel
diff --git a/data/theme/Makefile.am b/data/theme/Makefile.am
new file mode 100644
index 00000000..be159948
--- /dev/null
+++ b/data/theme/Makefile.am
@@ -0,0 +1,8 @@
+NULL =
+
+EXTRA_DIST = \
+ mate-panel.css \
+ panel-grid-symbolic.svg \
+ $(NULL)
+
+-include $(top_srcdir)/git.mk
diff --git a/data/mate-panel.css b/data/theme/mate-panel.css
index bfa890d1..bfa890d1 100644
--- a/data/mate-panel.css
+++ b/data/theme/mate-panel.css
diff --git a/data/panel-grid-symbolic.svg b/data/theme/panel-grid-symbolic.svg
index c057ca53..c057ca53 100644
--- a/data/panel-grid-symbolic.svg
+++ b/data/theme/panel-grid-symbolic.svg
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>