[Xfce4-commits] <xfce4-notes-plugin:master> Add an option for the navigation bar

Mike Massonnet noreply at xfce.org
Sat Sep 19 03:44:02 CEST 2009


Updating branch refs/heads/master
         to 8ffbbf2bcd75843d9640d4bf609f29b1ebec28ea (commit)
       from 5bb8731e54a8ca1f7abc9894cdfee1a9771ad425 (commit)

commit 8ffbbf2bcd75843d9640d4bf609f29b1ebec28ea
Author: Mike Massonnet <mike at debian.(none)>
Date:   Sun Sep 13 00:46:15 2009 +0200

    Add an option for the navigation bar

 ChangeLog                           |   20 ++++++++++++++++++++
 panel-plugin/application.vala       |    2 ++
 panel-plugin/defines.h              |    1 +
 panel-plugin/window.vala            |   19 +++++++++++++++++++
 panel-plugin/xfce4-notes-settings.c |    7 +++++++
 5 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 93ed4bf..f043af8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2009-09-12  Mike Massonnet <mmassonnet at xfce.org>
+
+Add an option for the navigation bar
+	* panel-plugin/window.vala:
+	  - New public property show-nabar set by default to true. The motion
+	  callbacks take a look over the boolean and perform only if it is set
+	  to true.
+	* panel-plugin/xfce4-notes-settings.c:
+	  - New option in the settings dialog.
+
+2009-09-08  Mike Massonnet <mmassonnet at xfce.org>
+
+Update the autotools build to Automake 1.11
+	* configure.ac.in:
+	  - Drop custom check on valac against AM_PROG_VALAC.
+
+2009-09-03  Mike Massonnet <mmassonnet at xfce.org>
+
+=== Release 1.7.1 ===
+
 2009-08-22  Mike Massonnet <mmassonnet at xfce.org>
 
 Notify note name change after insertion in the notebook
diff --git a/panel-plugin/application.vala b/panel-plugin/application.vala
index cc25f2f..8a254ed 100644
--- a/panel-plugin/application.vala
+++ b/panel-plugin/application.vala
@@ -86,6 +86,8 @@ namespace Xnp {
 				typeof (bool), window, "skip-taskbar-hint");
 			Xfconf.Property.bind (xfconf_channel, "/global/show-tabs",
 				typeof (bool), window, "show-tabs");
+			Xfconf.Property.bind (xfconf_channel, "/global/show-navbar",
+				typeof (bool), window, "show-navbar");
 
 			/* Default settings */
 			if (name == null) {
diff --git a/panel-plugin/defines.h b/panel-plugin/defines.h
index b26109f..fbcc873 100644
--- a/panel-plugin/defines.h
+++ b/panel-plugin/defines.h
@@ -28,6 +28,7 @@
 /* Default settings */
 #define GENERAL_HIDE_FROM_TASKBAR       TRUE
 #define GENERAL_SHOW_TABS               FALSE
+#define GENERAL_SHOW_NAVBAR             TRUE
 #define GENERAL_HIDE_ARROW_BUTTON       FALSE
 #define GENERAL_BACKGROUND_COLOR        BACKGROUND_YELLOW
 #define NEW_WINDOW_ABOVE                FALSE
diff --git a/panel-plugin/window.vala b/panel-plugin/window.vala
index 93b91ec..03eee94 100644
--- a/panel-plugin/window.vala
+++ b/panel-plugin/window.vala
@@ -91,6 +91,18 @@ namespace Xnp {
 			}
 		}
 
+		private bool _show_navbar;
+		public bool show_navbar {
+			get {
+				return this._show_navbar;
+			}
+			set {
+				this._show_navbar = value;
+				if (this._show_navbar == false)
+					navigation_box.hide ();
+			}
+		}
+
 		private bool _above;
 		public bool above {
 			get {
@@ -127,6 +139,7 @@ namespace Xnp {
 			this.title = _("Notes");
 			this.deletable = false;
 			this.skip_taskbar_hint = true;
+			this.show_navbar = true;
 			this.default_height = 380;
 			this.default_width = 300;
 			this.decorated = false;
@@ -342,6 +355,9 @@ namespace Xnp {
 		 * Hide the navigation when the mouse pointer is leaving the window.
 		 */
 		private bool navigation_leaved_cb () {
+			if (!_show_navbar)
+				return false;
+
 			int timeout = 2;
 			if (is_active) {
 				int x, y;
@@ -364,6 +380,9 @@ namespace Xnp {
 		 * Show the navigation when the mouse pointer is hovering the window.
 		 */
 		private bool navigation_motion_cb () {
+			if (!_show_navbar)
+				return false;
+
 			if (navigation_timeout != 0) {
 				Source.remove (navigation_timeout);
 				navigation_timeout = 0;
diff --git a/panel-plugin/xfce4-notes-settings.c b/panel-plugin/xfce4-notes-settings.c
index 8d29c54..625195f 100644
--- a/panel-plugin/xfce4-notes-settings.c
+++ b/panel-plugin/xfce4-notes-settings.c
@@ -118,6 +118,13 @@ prop_dialog_new ()
                           G_TYPE_BOOLEAN, G_OBJECT (button), "active");
   gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
 
+  /* Show navigation bar */
+  button = gtk_check_button_new_with_label (_("Show the automatic navigation bar"));
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), GENERAL_SHOW_NAVBAR);
+  xfconf_g_property_bind (xfconf_channel, "/global/show-navbar",
+                          G_TYPE_BOOLEAN, G_OBJECT (button), "active");
+  gtk_box_pack_start (GTK_BOX (box), button, TRUE, FALSE, 0);
+
   /* Background color */
   hbox = gtk_hbox_new (FALSE, BORDER);
   gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, FALSE, 0);



More information about the Xfce4-commits mailing list