diff --git a/Makefile.am b/Makefile.am index 964dd9a..703cd64 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,14 +1,15 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = \ - mousepad \ - po + mousepad \ + po \ + styles distclean-local: rm -rf *.cache *~ desktopdir = $(datadir)/applications -desktop_in_in_files = \ +desktop_in_in_files = \ mousepad.desktop.in.in desktop_in_files = $(desktop_in_in_files:.desktop.in.in=.desktop.in) %.desktop.in: %.desktop.in.in diff --git a/configure.ac.in b/configure.ac.in index 3f75bad..ec840df 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -158,6 +158,7 @@ AC_OUTPUT([ Makefile mousepad/Makefile po/Makefile.in +styles/Makefile ]) dnl *************************** diff --git a/mousepad/Makefile.am b/mousepad/Makefile.am index 888582d..9ed332a 100644 --- a/mousepad/Makefile.am +++ b/mousepad/Makefile.am @@ -72,7 +72,8 @@ mousepad_CFLAGS = \ $(GTHREAD_CFLAGS) \ $(GTKSOURCEVIEW_CFLAGS) \ $(PLATFORM_CFLAGS) \ - -DMOUSEPAD_GSETTINGS_SCHEMA_DIR=\""$(datadir)/glib-2.0/schemas"\" + -DMOUSEPAD_GSETTINGS_SCHEMA_DIR=\""$(datadir)/glib-2.0/schemas"\" \ + -DMOUSEPAD_STYLES_DIR=\"$(datadir)/xfce4/mousepad/styles\" mousepad_LDFLAGS = \ -no-undefined \ diff --git a/mousepad/mousepad-action-group.c b/mousepad/mousepad-action-group.c index acea132..4e13e06 100644 --- a/mousepad/mousepad-action-group.c +++ b/mousepad/mousepad-action-group.c @@ -775,6 +775,21 @@ mousepad_action_group_get_style_schemes (void) { scheme = gtk_source_style_scheme_manager_get_scheme ( gtk_source_style_scheme_manager_get_default (), *schemes); + +#if GTK_CHECK_VERSION(3, 0, 0) + /* Ignore the none theme */ + const gchar *scheme_id; + if (GTK_SOURCE_IS_STYLE_SCHEME (scheme)) + { + scheme_id = gtk_source_style_scheme_get_id (scheme); + if (g_strcmp0(scheme_id, "none") == 0) + { + schemes++; + continue; + } + } +#endif + list = g_slist_prepend (list, scheme); schemes++; } diff --git a/mousepad/mousepad-settings.c b/mousepad/mousepad-settings.c index 4c2f5bc..7c7d2d7 100644 --- a/mousepad/mousepad-settings.c +++ b/mousepad/mousepad-settings.c @@ -18,6 +18,10 @@ #include #include +#include + +#include + #include @@ -48,7 +52,6 @@ mousepad_settings_finalize (void) void mousepad_settings_init (void) { - if (settings_init_count == 0) { if (! MOUSEPAD_IS_SETTINGS_STORE (settings_store)) @@ -56,6 +59,11 @@ mousepad_settings_init (void) } settings_init_count++; + +#if GTK_CHECK_VERSION(3, 0, 0) + gtk_source_style_scheme_manager_prepend_search_path( + gtk_source_style_scheme_manager_get_default (), MOUSEPAD_STYLES_DIR); +#endif } diff --git a/mousepad/mousepad-style-scheme-action.c b/mousepad/mousepad-style-scheme-action.c index 52b256a..9baa91a 100644 --- a/mousepad/mousepad-style-scheme-action.c +++ b/mousepad/mousepad-style-scheme-action.c @@ -162,6 +162,12 @@ mousepad_style_scheme_action_new (GtkSourceStyleScheme *scheme) gchar *name; GtkAction *action; +#if GTK_CHECK_VERSION(3, 0, 0) + if (scheme == NULL) + scheme = gtk_source_style_scheme_manager_get_scheme( + gtk_source_style_scheme_manager_get_default (), "none"); +#endif + if (GTK_SOURCE_IS_STYLE_SCHEME (scheme)) scheme_id = gtk_source_style_scheme_get_id (scheme); else diff --git a/styles/Makefile.am b/styles/Makefile.am new file mode 100644 index 0000000..583cb1d --- /dev/null +++ b/styles/Makefile.am @@ -0,0 +1,7 @@ +Stylesdir = $(datadir)/xfce4/mousepad/styles + +Styles_DATA = \ + none.xml + +EXTRA_DIST = \ + $(Styles_DATA) diff --git a/styles/none.xml b/styles/none.xml new file mode 100644 index 0000000..c22e3a3 --- /dev/null +++ b/styles/none.xml @@ -0,0 +1,6 @@ + + + Mousepad developers + <_description>No style scheme + +