Skip to content
Permalink
Browse files

css: Convert to GResource

  • Loading branch information...
raveit65 committed Apr 23, 2018
1 parent 9ee6deb commit 3db6772bd564fc2c592b61853b870dd8c9dc5e1b
@@ -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
@@ -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
@@ -0,0 +1,8 @@
NULL =

EXTRA_DIST = \
mate-panel.css \
panel-grid-symbolic.svg \
$(NULL)

-include $(top_srcdir)/git.mk
File renamed without changes.
@@ -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)
@@ -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 ();

@@ -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>

0 comments on commit 3db6772

Please sign in to comment.
You can’t perform that action at this time.