[Xfce4-commits] <xfce4-notes-plugin:master> Remove automatic navigation bar completely

Mike Massonnet noreply at xfce.org
Sat Nov 6 21:52:06 CET 2010


Updating branch refs/heads/master
         to 937222d64bff40649ce26e033056b714865788e3 (commit)
       from c93a85490b6ecf021579dbedbcc73790b0ac73af (commit)

commit 937222d64bff40649ce26e033056b714865788e3
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Sat Nov 6 18:40:41 2010 +0100

    Remove automatic navigation bar completely

 lib/application.vala       |    2 -
 lib/window.vala            |   88 --------------------------------------------
 src/xfce4-notes-settings.c |    7 ---
 3 files changed, 0 insertions(+), 97 deletions(-)

diff --git a/lib/application.vala b/lib/application.vala
index ce2033d..83568a7 100644
--- a/lib/application.vala
+++ b/lib/application.vala
@@ -168,8 +168,6 @@ namespace Xnp {
 			/* Global settings */
 			Xfconf.Property.bind (xfconf_channel, "/global/skip-taskbar-hint",
 				typeof (bool), window, "skip-taskbar-hint");
-			Xfconf.Property.bind (xfconf_channel, "/global/show-navbar",
-				typeof (bool), window, "show-navbar");
 			Xfconf.Property.bind (xfconf_channel, "/global/tabs-position",
 				typeof (int), window, "tabs-position");
 
diff --git a/lib/window.vala b/lib/window.vala
index 1fa74a3..b2b4581 100644
--- a/lib/window.vala
+++ b/lib/window.vala
@@ -41,8 +41,6 @@ namespace Xnp {
 		private Xnp.TitleBarButton close_button;
 		private Gtk.VBox content_box;
 		private Gtk.Notebook notebook;
-		private Gtk.HBox navigation_box;
-		private uint navigation_timeout = 0;
 
 		private Gtk.UIManager ui;
 		private const string ui_string =
@@ -95,18 +93,6 @@ 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 int _tabs_position;
 		public int tabs_position {
 			get {
@@ -173,7 +159,6 @@ 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;
@@ -279,38 +264,11 @@ namespace Xnp {
 			this.notebook.show ();
 			this.content_box.pack_start (this.notebook, true, true, 0);
 
-			/* Build navigation toolbar */
-			this.navigation_box = new Gtk.HBox (false, 2);
-			var add_box = new Gtk.Button ();
-			add_box.set_tooltip_text (Gtk.accelerator_get_label ('N', Gdk.ModifierType.CONTROL_MASK));
-			add_box.set_relief (Gtk.ReliefStyle.NONE);
-			add_box.can_focus = false;
-			var add_label = new Gtk.Label ("<b>+</b>");
-			add_label.use_markup = true;
-			add_box.add (add_label);
-			this.navigation_box.pack_start (add_box, true, false, 0);
-			if (add_box.allocation.width < 22)
-				add_box.set_size_request (22, -1);
-			var del_box = new Gtk.Button ();
-			del_box.set_tooltip_text (Gtk.accelerator_get_label ('W', Gdk.ModifierType.CONTROL_MASK));
-			del_box.set_relief (Gtk.ReliefStyle.NONE);
-			del_box.can_focus = false;
-			var del_label = new Gtk.Label ("<b>−</b>");
-			del_label.use_markup = true;
-			del_box.add (del_label);
-			this.navigation_box.pack_start (del_box, true, false, 0);
-			if (del_box.allocation.width < 22)
-				del_box.set_size_request (22, -1);
-			this.navigation_box.show_all ();
-			this.content_box.pack_start (this.navigation_box, false, false, 1);
-
 			/* Connect mouse click signals */
 			menu_evbox.button_press_event.connect (menu_evbox_pressed_cb);
 			this.left_arrow_button.clicked.connect (action_prev_note);
 			this.right_arrow_button.clicked.connect (action_next_note);
 			this.close_button.clicked.connect (() => { hide (); });
-			add_box.clicked.connect (action_new_note);
-			del_box.clicked.connect (action_delete_note);
 
 			/* Connect extra signals */
 			delete_event.connect (() => {
@@ -333,8 +291,6 @@ namespace Xnp {
 				close_button.sensitive = false;
 				return false;
 			});
-			leave_notify_event.connect (navigation_leaved_cb);
-			motion_notify_event.connect (navigation_motion_cb);
 			leave_notify_event.connect (window_leaved_cb);
 			motion_notify_event.connect (window_motion_cb);
 			button_press_event.connect (window_pressed_cb);
@@ -366,8 +322,6 @@ namespace Xnp {
 		}
 
 		~Window () {
-			if (this.navigation_timeout != 0)
-				Source.remove (this.navigation_timeout);
 		}
 
 		/*
@@ -390,48 +344,6 @@ namespace Xnp {
 		}
 
 		/**
-		 * navigation_leaved_cb:
-		 *
-		 * 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;
-				get_pointer (out x, out y);
-				if (x >= 0 && x < allocation.width && y >= 0 && y < allocation.height) {
-					timeout = 10;
-				}
-			}
-			navigation_timeout = Timeout.add_seconds (timeout, () => {
-				navigation_box.hide ();
-				navigation_timeout = 0;
-				return false;
-				});
-			return false;
-		}
-
-		/**
-		 * navigation_motion_cb:
-		 *
-		 * 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;
-			}
-			navigation_box.show ();
-			return false;
-		}
-
-		/**
 		 * window_leaved_cb:
 		 *
 		 * Reset the mouse cursor.
diff --git a/src/xfce4-notes-settings.c b/src/xfce4-notes-settings.c
index 570ea3f..557ac9d 100644
--- a/src/xfce4-notes-settings.c
+++ b/src/xfce4-notes-settings.c
@@ -124,13 +124,6 @@ prop_dialog_new (void)
                           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);
-
   /* Tabs position */
   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