[Xfce4-commits] <xfce4-notes-plugin:master> Rework the gtkrc theme

Mike Massonnet noreply at xfce.org
Mon Mar 8 21:58:01 CET 2010


Updating branch refs/heads/master
         to c34a559568276e06647ce9696c27be3d76b389c1 (commit)
       from 875024ab583bc5791f50010113d633e37d92a025 (commit)

commit c34a559568276e06647ce9696c27be3d76b389c1
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Mon Mar 8 20:53:25 2010 +0100

    Rework the gtkrc theme
    
    The gtkrc file is installed (without colors) system wide and contains
    more customization for coloured scrollbars, gradient title-bar, standing
    out colour for the current tab, and tooltip colours.
    
    The custom colours are installed inside the user's configuration
    directory and includes a line to the system wide gtkrc file.
    
    To avoid conflicts with the existing theme included through ~/.gtkrc-2.0
    the widget names are renamed and the user's gtkrc file is saved with the
    name xfce4-notes.gtkrc.

 ChangeLog                                          |   15 +
 Makefile.am                                        |    1 +
 configure.ac.in                                    |    3 +
 data/Makefile.am                                   |    1 +
 data/gtk-2.0/Makefile.am                           |    5 +
 data/gtk-2.0/gradient.png                          |  Bin 0 -> 671 bytes
 data/gtk-2.0/notes.gtkrc                           |  291 ++++++++++++++++++++
 data/gtk-2.0/scrollbars/Makefile.am                |   16 +
 data/gtk-2.0/scrollbars/slider-horiz-active.png    |  Bin 0 -> 258 bytes
 data/gtk-2.0/scrollbars/slider-horiz.png           |  Bin 0 -> 262 bytes
 data/gtk-2.0/scrollbars/slider-vert-active.png     |  Bin 0 -> 259 bytes
 data/gtk-2.0/scrollbars/slider-vert.png            |  Bin 0 -> 263 bytes
 data/gtk-2.0/scrollbars/stepper-down-active.png    |  Bin 0 -> 2839 bytes
 data/gtk-2.0/scrollbars/stepper-down.png           |  Bin 0 -> 2839 bytes
 data/gtk-2.0/scrollbars/stepper-left-active.png    |  Bin 0 -> 2837 bytes
 data/gtk-2.0/scrollbars/stepper-left.png           |  Bin 0 -> 2837 bytes
 data/gtk-2.0/scrollbars/stepper-right-active.png   |  Bin 0 -> 2838 bytes
 data/gtk-2.0/scrollbars/stepper-right.png          |  Bin 0 -> 2838 bytes
 data/gtk-2.0/scrollbars/stepper-up-active.png      |  Bin 0 -> 2832 bytes
 data/gtk-2.0/scrollbars/stepper-up.png             |  Bin 0 -> 2832 bytes
 data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png |  Bin 0 -> 2792 bytes
 data/gtk-2.0/scrollbars/trough-scrollbar-vert.png  |  Bin 0 -> 2793 bytes
 lib/Makefile.am                                    |    5 +-
 lib/application.vala                               |    3 +
 lib/color.c                                        |   67 +-----
 lib/config.vapi                                    |    2 +
 lib/window.vala                                    |   17 +-
 src/Makefile.am                                    |    1 +
 28 files changed, 352 insertions(+), 75 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6a3cf05..0cde4e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2010-03-08  Mike Massonnet <mmassonnet at xfce.org>
+
+Rework the gtkrc theme
+
+The gtkrc file is installed (without colors) system wide and contains
+more customization for coloured scrollbars, gradient title-bar, standing
+out colour for the current tab, and tooltip colours.
+
+The custom colours are installed inside the user's configuration
+directory and includes a line to the system wide gtkrc file.
+
+To avoid conflicts with the existing theme included through ~/.gtkrc-2.0
+the widget names are renamed and the user's gtkrc file is saved with the
+name xfce4-notes.gtkrc.
+
 2010-03-03  Mike Massonnet <mmassonnet at xfce.org>
 
 Restore tab orientation when the tab label changes (bug #6246)
diff --git a/Makefile.am b/Makefile.am
index 17b2a27..c529b42 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,7 @@
 @SET_MAKE@
 
 SUBDIRS =								\
+	data								\
 	icons								\
 	lib								\
 	src								\
diff --git a/configure.ac.in b/configure.ac.in
index 00649de..2a7f010 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -80,6 +80,9 @@ XDT_FEATURE_DEBUG()
 
 AC_OUTPUT([
 Makefile
+data/Makefile
+data/gtk-2.0/Makefile
+data/gtk-2.0/scrollbars/Makefile
 icons/Makefile
 icons/16x16/Makefile
 icons/22x22/Makefile
diff --git a/data/Makefile.am b/data/Makefile.am
new file mode 100644
index 0000000..5c631fb
--- /dev/null
+++ b/data/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = gtk-2.0
diff --git a/data/gtk-2.0/Makefile.am b/data/gtk-2.0/Makefile.am
new file mode 100644
index 0000000..1225724
--- /dev/null
+++ b/data/gtk-2.0/Makefile.am
@@ -0,0 +1,5 @@
+SUBDIRS = scrollbars
+notesgtkrcdir = $(pkgdatadir)/gtk-2.0
+dist_notesgtkrc_DATA =							\
+	gradient.png							\
+	notes.gtkrc
diff --git a/data/gtk-2.0/gradient.png b/data/gtk-2.0/gradient.png
new file mode 100644
index 0000000..8d5441c
Binary files /dev/null and b/data/gtk-2.0/gradient.png differ
diff --git a/data/gtk-2.0/notes.gtkrc b/data/gtk-2.0/notes.gtkrc
new file mode 100644
index 0000000..072045f
--- /dev/null
+++ b/data/gtk-2.0/notes.gtkrc
@@ -0,0 +1,291 @@
+style "notes-default" {
+xthickness = 1
+ythickness = 1
+fg[NORMAL] = @notes_fg_color
+fg[ACTIVE] = @notes_fg_color
+fg[PRELIGHT] = @notes_fg_color
+fg[SELECTED] = @notes_selected_fg_color
+fg[INSENSITIVE] = shade(0.78, at notes_fg_color)
+bg[NORMAL] = @notes_bg_color
+bg[ACTIVE] = @notes_bg_color
+bg[PRELIGHT] = mix(0.90,shade(1.1, at notes_bg_color), at notes_selected_bg_color)
+bg[SELECTED] = @notes_selected_bg_color
+bg[INSENSITIVE] = shade(1.03, at notes_bg_color)
+base[NORMAL] = @notes_base_color
+base[ACTIVE] = shade(0.65, at notes_base_color)
+base[PRELIGHT] = @notes_base_color
+base[SELECTED] = @notes_selected_bg_color
+base[INSENSITIVE] = shade(1.025, at notes_bg_color)
+text[NORMAL] = @notes_text_color
+text[ACTIVE] = shade(0.95, at notes_base_color)
+text[PRELIGHT] = @notes_text_color
+text[SELECTED] = @notes_selected_fg_color
+text[INSENSITIVE] = mix(0.675,shade(0.95, at notes_bg_color), at notes_fg_color)
+}
+
+style "notes-window" = "notes-default" {
+	engine "pixmap" {
+		image {
+		function = FLAT_BOX
+		file = "gradient.png"
+		border = {0, 0, 40, 0}
+		}
+	}
+}
+
+style "notes-tooltips" {
+xthickness = 4
+ythickness = 4
+bg[NORMAL] = @notes_fg_color
+fg[NORMAL] = @notes_bg_color
+}
+
+style "notes-notebook" = "notes-default" {
+xthickness = 3
+ythickness = 3
+bg[NORMAL] = @notes_fg_color
+fg[NORMAL] = @notes_bg_color
+bg[ACTIVE] = shade(1.166, at notes_bg_color)
+fg[ACTIVE] = @notes_fg_color
+}
+
+style "notes-scrollbar" = "notes-default" {
+GtkRange::trough_border = 0
+GtkRange::slider_width = 15
+GtkRange::stepper_size = 14
+GtkScrollbar::min_slider_length = 30
+
+	engine "pixmap" {
+		# Horizontal slider background
+		image {
+		function        = BOX
+		detail          = "trough"
+		file            = "scrollbars/trough-scrollbar-horiz.png"
+		border          = { 30, 30, 0, 0 }
+		stretch         = TRUE
+		orientation     = HORIZONTAL
+		}
+		# Vertical slider background
+		image {
+		function        = BOX
+		detail          = "trough"
+		file            = "scrollbars/trough-scrollbar-vert.png"
+		border          = { 0, 0, 30, 30 }
+		stretch         = TRUE
+		orientation     = VERTICAL
+		}
+
+		# Horizontal slider (normal)
+		image {
+		function        = SLIDER
+		state           = NORMAL
+		file            = "scrollbars/slider-horiz.png"
+		border          = { 15, 15, 6, 6 }
+		stretch         = TRUE
+		orientation     = HORIZONTAL
+		}
+		# Horizontal slider (active)
+		image {
+		function        = SLIDER
+		state           = ACTIVE
+		file            = "scrollbars/slider-horiz-active.png"
+		border          = { 15, 15, 6, 6 }
+		stretch         = TRUE
+		orientation     = HORIZONTAL
+		}
+		# Horizontal slider (prelight)
+		image {
+		function        = SLIDER
+		state           = PRELIGHT
+		file            = "scrollbars/slider-horiz-active.png"
+		border          = { 15, 15, 6, 6 }
+		stretch         = TRUE
+		orientation     = HORIZONTAL
+		}
+		# Horizontal slider (insensitive)
+		image {
+		function        = SLIDER
+		state           = INSENSITIVE
+		file            = "scrollbars/slider-horiz.png"
+		border          = { 15, 15, 6, 6 }
+		stretch         = TRUE
+		orientation     = HORIZONTAL
+		}
+
+		# Vertical slider (normal)
+		image {
+		function        = SLIDER
+		state           = NORMAL
+		file            = "scrollbars/slider-vert.png"
+		border          = { 6, 6, 15, 15 }
+		stretch         = TRUE
+		orientation     = VERTICAL
+		}
+		# Vertical slider (active)
+		image {
+		function        = SLIDER
+		state           = ACTIVE
+		file            = "scrollbars/slider-vert-active.png"
+		border          = { 6, 6, 15, 15 }
+		stretch         = TRUE
+		orientation     = VERTICAL
+		}
+		# Vertical slider (prelight)
+		image {
+		function        = SLIDER
+		state           = PRELIGHT
+		file            = "scrollbars/slider-vert-active.png"
+		border          = { 6, 6, 15, 15 }
+		stretch         = TRUE
+		orientation     = VERTICAL
+		}
+		# Vertical slider (insensitive)
+		image {
+		function        = SLIDER
+		state           = INSENSITIVE
+		file            = "scrollbars/slider-vert.png"
+		border          = { 6, 6, 15, 15 }
+		stretch         = TRUE
+		orientation     = VERTICAL
+		}
+
+		# Scrollbar stepper up (normal)
+		image {
+		function        = STEPPER
+		state           = NORMAL
+		file            = "scrollbars/stepper-up.png"
+		stretch         = TRUE
+		arrow_direction = UP
+		}
+		# Scrollbar stepper up (active)
+		image {
+		function        = STEPPER
+		state           = ACTIVE
+		file            = "scrollbars/stepper-up-active.png"
+		stretch         = TRUE
+		arrow_direction = UP
+		}
+		# Scrollbar stepper up (prelight)
+		image {
+		function        = STEPPER
+		state           = PRELIGHT
+		file            = "scrollbars/stepper-up-active.png"
+		stretch         = TRUE
+		arrow_direction = UP
+		}
+		# Scrollbar stepper up (insensitive)
+		image {
+		function        = STEPPER
+		state           = INSENSITIVE
+		file            = "scrollbars/stepper-up.png"
+		stretch         = TRUE
+		arrow_direction = UP
+		}
+
+		# Scrollbar stepper down (normal)
+		image {
+		function        = STEPPER
+		state           = NORMAL
+		file            = "scrollbars/stepper-down.png"
+		stretch         = TRUE
+		arrow_direction = DOWN
+		}
+		# Scrollbar stepper down (active)
+		image {
+		function        = STEPPER
+		state           = ACTIVE
+		file            = "scrollbars/stepper-down-active.png"
+		stretch         = TRUE
+		arrow_direction = DOWN
+		}
+		# Scrollbar stepper down (prelight)
+		image {
+		function        = STEPPER
+		state           = PRELIGHT
+		file            = "scrollbars/stepper-down-active.png"
+		stretch         = TRUE
+		arrow_direction = DOWN
+		}
+		# Scrollbar stepper down (insensitive)
+		image {
+		function        = STEPPER
+		state           = INSENSITIVE
+		file            = "scrollbars/stepper-down.png"
+		stretch         = TRUE
+		arrow_direction = DOWN
+		}
+
+		# Scrollbar stepper left (normal)
+		image {
+		function        = STEPPER
+		state           = NORMAL
+		file            = "scrollbars/stepper-left.png"
+		stretch         = TRUE
+		arrow_direction = LEFT
+		}
+		# Scrollbar stepper left (active)
+		image {
+		function        = STEPPER
+		state           = ACTIVE
+		file            = "scrollbars/stepper-left-active.png"
+		stretch         = TRUE
+		arrow_direction = LEFT
+		}
+		# Scrollbar stepper left (prelight)
+		image {
+		function        = STEPPER
+		state           = PRELIGHT
+		file            = "scrollbars/stepper-left-active.png"
+		stretch         = TRUE
+		arrow_direction = LEFT
+		}
+		# Scrollbar stepper left (insensitive)
+		image {
+		function        = STEPPER
+		state           = INSENSITIVE
+		file            = "scrollbars/stepper-left.png"
+		stretch         = TRUE
+		arrow_direction = LEFT
+		}
+
+		# Scrollbar stepper right (normal)
+		image {
+		function        = STEPPER
+		state           = NORMAL
+		file            = "scrollbars/stepper-right.png"
+		stretch         = TRUE
+		arrow_direction = RIGHT
+		}
+		# Scrollbar stepper right (active)
+		image {
+		function        = STEPPER
+		state           = ACTIVE
+		file            = "scrollbars/stepper-right-active.png"
+		stretch         = TRUE
+		arrow_direction = RIGHT
+		}
+		# Scrollbar stepper right (prelight)
+		image {
+		function        = STEPPER
+		state           = PRELIGHT
+		file            = "scrollbars/stepper-right-active.png"
+		stretch         = TRUE
+		arrow_direction = RIGHT
+		}
+		# Scrollbar stepper right (insensitive)
+		image {
+		function        = STEPPER
+		state           = INSENSITIVE
+		file            = "scrollbars/stepper-right.png"
+		stretch         = TRUE
+		arrow_direction = RIGHT
+		}
+	}
+}
+
+widget "notes-window*" style "notes-default"
+widget "notes-window" style "notes-window"
+widget "gtk-tooltip*" style "notes-tooltips"
+widget "*notes-notebook*" style "notes-notebook"
+widget_class "*GtkScrolledWindow*" style "notes-scrollbar"
+
diff --git a/data/gtk-2.0/scrollbars/Makefile.am b/data/gtk-2.0/scrollbars/Makefile.am
new file mode 100644
index 0000000..13c0b37
--- /dev/null
+++ b/data/gtk-2.0/scrollbars/Makefile.am
@@ -0,0 +1,16 @@
+scrollbarsdir = $(pkgdatadir)/gtk-2.0/scrollbars
+dist_scrollbars_DATA =							\
+	slider-horiz-active.png						\
+	slider-horiz.png						\
+	slider-vert-active.png						\
+	slider-vert.png							\
+	stepper-down-active.png						\
+	stepper-down.png						\
+	stepper-left-active.png						\
+	stepper-left.png						\
+	stepper-right-active.png					\
+	stepper-right.png						\
+	stepper-up-active.png						\
+	stepper-up.png							\
+	trough-scrollbar-horiz.png					\
+	trough-scrollbar-vert.png
diff --git a/data/gtk-2.0/scrollbars/slider-horiz-active.png b/data/gtk-2.0/scrollbars/slider-horiz-active.png
new file mode 100644
index 0000000..d4aa6bf
Binary files /dev/null and b/data/gtk-2.0/scrollbars/slider-horiz-active.png differ
diff --git a/data/gtk-2.0/scrollbars/slider-horiz.png b/data/gtk-2.0/scrollbars/slider-horiz.png
new file mode 100644
index 0000000..a619d60
Binary files /dev/null and b/data/gtk-2.0/scrollbars/slider-horiz.png differ
diff --git a/data/gtk-2.0/scrollbars/slider-vert-active.png b/data/gtk-2.0/scrollbars/slider-vert-active.png
new file mode 100644
index 0000000..1d6a99d
Binary files /dev/null and b/data/gtk-2.0/scrollbars/slider-vert-active.png differ
diff --git a/data/gtk-2.0/scrollbars/slider-vert.png b/data/gtk-2.0/scrollbars/slider-vert.png
new file mode 100644
index 0000000..d2da00b
Binary files /dev/null and b/data/gtk-2.0/scrollbars/slider-vert.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-down-active.png b/data/gtk-2.0/scrollbars/stepper-down-active.png
new file mode 100644
index 0000000..7d9f674
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-down-active.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-down.png b/data/gtk-2.0/scrollbars/stepper-down.png
new file mode 100644
index 0000000..0e84d87
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-down.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-left-active.png b/data/gtk-2.0/scrollbars/stepper-left-active.png
new file mode 100644
index 0000000..c4d323c
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-left-active.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-left.png b/data/gtk-2.0/scrollbars/stepper-left.png
new file mode 100644
index 0000000..3d903a9
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-left.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-right-active.png b/data/gtk-2.0/scrollbars/stepper-right-active.png
new file mode 100644
index 0000000..77bb858
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-right-active.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-right.png b/data/gtk-2.0/scrollbars/stepper-right.png
new file mode 100644
index 0000000..723db3a
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-right.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-up-active.png b/data/gtk-2.0/scrollbars/stepper-up-active.png
new file mode 100644
index 0000000..8ce2b1d
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-up-active.png differ
diff --git a/data/gtk-2.0/scrollbars/stepper-up.png b/data/gtk-2.0/scrollbars/stepper-up.png
new file mode 100644
index 0000000..1bd9133
Binary files /dev/null and b/data/gtk-2.0/scrollbars/stepper-up.png differ
diff --git a/data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png b/data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png
new file mode 100644
index 0000000..5e08328
Binary files /dev/null and b/data/gtk-2.0/scrollbars/trough-scrollbar-horiz.png differ
diff --git a/data/gtk-2.0/scrollbars/trough-scrollbar-vert.png b/data/gtk-2.0/scrollbars/trough-scrollbar-vert.png
new file mode 100644
index 0000000..26ee2c1
Binary files /dev/null and b/data/gtk-2.0/scrollbars/trough-scrollbar-vert.png differ
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 4ceab0b..4d8281a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,3 @@
-INCLUDES =								\
-	-DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"
-
 noinst_LTLIBRARIES = libnotes.la
 
 libnotes_la_VALAFLAGS =							\
@@ -22,6 +19,8 @@ libnotes_la_SOURCES =							\
 	popup.c
 
 libnotes_la_CFLAGS =							\
+	-DPKGDATADIR=\""$(pkgdatadir)"\"				\
+	-DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"			\
 	@LIBX11_CFLAGS@							\
 	@GTK_CFLAGS@							\
 	@LIBXFCE4UTIL_CFLAGS@						\
diff --git a/lib/application.vala b/lib/application.vala
index 4e42bff..bf5c34a 100644
--- a/lib/application.vala
+++ b/lib/application.vala
@@ -36,6 +36,9 @@ namespace Xnp {
 		public Application (string config_file) {
 			GLib.Object (config_file: config_file);
 
+			var notesgtkrc = "%s/xfce4/xfce4-notes.gtkrc".printf (GLib.Environment.get_user_config_dir ());
+			Gtk.rc_parse (notesgtkrc);
+
 			try {
 				Xfconf.init ();
 			}
diff --git a/lib/color.c b/lib/color.c
index 712abca..14e8af7 100644
--- a/lib/color.c
+++ b/lib/color.c
@@ -37,69 +37,7 @@
 
 #define RC_STYLE \
   "gtk_color_scheme = \"notes_fg_color:#xxxxxxxxxxxx\\nnotes_bg_color:#xxxxxxxxxxxx\\nnotes_base_color:#xxxxxxxxxxxx\\nnotes_text_color:#xxxxxxxxxxxx\\nnotes_selected_bg_color:#xxxxxxxxxxxx\\nnotes_selected_fg_color:#xxxxxxxxxxxx\"\n" \
-  "style \"notes-default\" {\n" \
-  "xthickness = 1\n" \
-  "ythickness = 1\n" \
-  "fg[NORMAL] = @notes_fg_color\n" \
-  "fg[ACTIVE] = @notes_fg_color\n" \
-  "fg[PRELIGHT] = @notes_fg_color\n" \
-  "fg[SELECTED] = @notes_selected_fg_color\n" \
-  "fg[INSENSITIVE] = shade(3.0, at notes_fg_color)\n" \
-  "bg[NORMAL] = @notes_bg_color\n" \
-  "bg[ACTIVE] = shade(1.0233, at notes_bg_color)\n" \
-  "bg[PRELIGHT] = mix(0.90,shade(1.1, at notes_bg_color), at notes_selected_bg_color)\n" \
-  "bg[SELECTED] = @notes_selected_bg_color\n" \
-  "bg[INSENSITIVE] = shade(1.03, at notes_bg_color)\n" \
-  "base[NORMAL] = @notes_base_color\n" \
-  "base[ACTIVE] = shade(0.65, at notes_base_color)\n" \
-  "base[PRELIGHT] = @notes_base_color\n" \
-  "base[SELECTED] = @notes_selected_bg_color\n" \
-  "base[INSENSITIVE] = shade(1.025, at notes_bg_color)\n" \
-  "text[NORMAL] = @notes_text_color\n" \
-  "text[ACTIVE] = shade(0.95, at notes_base_color)\n" \
-  "text[PRELIGHT] = @notes_text_color\n" \
-  "text[SELECTED] = @notes_selected_fg_color\n" \
-  "text[INSENSITIVE] = mix(0.675,shade(0.95, at notes_bg_color), at notes_fg_color)\n" \
-  "}\n" \
-  "widget \"xfce4-notes-plugin*\" style \"notes-default\"\n"
-
-#define INCLUDE_CONTENT \
-  "\n\n# include rc style for the xfce4-notes-plugin" \
-  "\n\n%s" \
-  "\n\n# end of automatic change\n\n"
-
-static inline void
-update_gtkrc (const gchar *notesrc_file)
-{
-  gchar *gtkrc_file;
-  gchar *include_line;
-  gchar *include_content;
-  gchar *contents, *tmp;
-
-  gtkrc_file = g_strdup_printf ("%s/.gtkrc-2.0", g_get_home_dir ());
-  include_line = g_strdup_printf ("include \"%s\"", notesrc_file);
-  include_content = g_strdup_printf (INCLUDE_CONTENT, include_line);
-
-  g_file_get_contents (gtkrc_file, &contents, NULL, NULL);
-
-  if (contents == NULL)
-    {
-      g_file_set_contents (gtkrc_file, include_content, -1, NULL);
-    }
-  else if (!g_strrstr (contents, include_line))
-    {
-      tmp = contents;
-      contents = g_strconcat (tmp, include_content, NULL);
-      g_free (tmp);
-
-      g_file_set_contents (gtkrc_file, contents, -1, NULL);
-    }
-
-  g_free (include_content);
-  g_free (include_line);
-  g_free (gtkrc_file);
-  g_free (contents);
-}
+  "include \"" PKGDATADIR "/gtk-2.0/notes.gtkrc\""
 
 void
 color_set_background (const gchar *background)
@@ -155,9 +93,8 @@ color_set_background (const gchar *background)
   memcpy (offset, bg, 13);
 
   /* set the rc style */
-  notesrc_file = g_strdup_printf ("%s/xfce4/panel/xfce4-notes-plugin.gtkrc", g_get_user_config_dir ());
+  notesrc_file = g_strdup_printf ("%s/xfce4/xfce4-notes.gtkrc", g_get_user_config_dir ());
   g_file_set_contents (notesrc_file, rc_style, -1, NULL);
-  update_gtkrc (notesrc_file);
 
   gtk_rc_reparse_all ();
 
diff --git a/lib/config.vapi b/lib/config.vapi
index 4cf9447..f7452a3 100644
--- a/lib/config.vapi
+++ b/lib/config.vapi
@@ -16,4 +16,6 @@ namespace Config {
 	public const string PACKAGE_TARNAME;
 	[CCode (cname = "PACKAGE_VERSION")]
 	public const string PACKAGE_VERSION;
+	[CCode (cname = "PKGDATADIR")]
+	public const string PKGDATADIR;
 }
diff --git a/lib/window.vala b/lib/window.vala
index c9323c0..2ceadb6 100644
--- a/lib/window.vala
+++ b/lib/window.vala
@@ -165,7 +165,7 @@ namespace Xnp {
 		public signal void note_renamed (Xnp.Note note, string old_name);
 
 		construct {
-			base.name = "xfce4-notes-plugin";
+			base.name = "notes-window";
 			this.title = _("Notes");
 			this.deletable = false;
 			this.skip_taskbar_hint = true;
@@ -216,11 +216,13 @@ namespace Xnp {
 
 			/* Build title */
 			var title_box = new Gtk.HBox (false, 0);
-			var menu_box = new Gtk.EventBox ();
+			var menu_evbox = new Gtk.EventBox ();
+			menu_evbox.set_visible_window (false);
 			var menu_image = new Gtk.Image.from_icon_name ("xfce4-notes-plugin", Gtk.IconSize.MENU);
-			menu_box.add (menu_image);
-			title_box.pack_start (menu_box, false, false, 2);
+			menu_evbox.add (menu_image);
+			title_box.pack_start (menu_evbox, false, false, 2);
 			var title_evbox = new Gtk.EventBox ();
+			title_evbox.set_visible_window (false);
 			this.title_label = new Gtk.Label (null);
 			this.title_label.set_markup ("<b>"+this.title+"</b>");
 			this.title_label.ellipsize = Pango.EllipsizeMode.END;
@@ -246,6 +248,7 @@ namespace Xnp {
 
 			/* Build Notebook */
 			this.notebook = new Gtk.Notebook ();
+			this.notebook.name = "notes-notebook";
 			this.notebook.show_border = false;
 			this.notebook.show_tabs = false;
 			this.notebook.tab_pos = Gtk.PositionType.TOP;
@@ -303,7 +306,7 @@ namespace Xnp {
 			this.content_box.pack_start (this.navigation_box, false, false, 1);
 
 			/* Connect mouse click signals */
-			menu_box.button_press_event += menu_box_pressed_cb;
+			menu_evbox.button_press_event += menu_evbox_pressed_cb;
 			close_box.clicked += () => { hide (); };
 			add_box.clicked += action_new_note;
 			del_box.clicked += action_delete_note;
@@ -649,11 +652,11 @@ namespace Xnp {
 		 */
 
 		/**
-		 * menu_box_pressed_cb:
+		 * menu_evbox_pressed_cb:
 		 *
 		 * Popup the window menu.
 		 */
-		private bool menu_box_pressed_cb (Gtk.EventBox box, Gdk.EventButton event) {
+		private bool menu_evbox_pressed_cb (Gtk.EventBox box, Gdk.EventButton event) {
 			this.menu.popup (null, null, menu_position, 0, Gtk.get_current_event_time ());
 			return false;
 		}
diff --git a/src/Makefile.am b/src/Makefile.am
index c2d2ada..b95ddce 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,6 +1,7 @@
 INCLUDES =								\
 	-I$(top_srcdir)							\
 	-I$(top_srcdir)/lib						\
+	-DPKGDATADIR=\""$(pkgdatadir)"\"				\
 	-DGETTEXT_PACKAGE=\""$(GETTEXT_PACKAGE)"\"			\
 	-DPACKAGE_LOCALE_DIR=\""$(localedir)"\"
 



More information about the Xfce4-commits mailing list