[Xfce4-commits] <xfce4-panel:master> Add (un)lock option to panel menu (bug #6980).

Nick Schermer noreply at xfce.org
Sat Mar 10 20:46:01 CET 2012


Updating branch refs/heads/master
         to dcc851a3ff625af9617cc23027099bd1ae513354 (commit)
       from be76d74bf68d66880a302c68dcea301e0a72b8ea (commit)

commit dcc851a3ff625af9617cc23027099bd1ae513354
Author: Nick Schermer <nick at xfce.org>
Date:   Sat Mar 10 20:44:03 2012 +0100

    Add (un)lock option to panel menu (bug #6980).
    
    This add a difference to the panel and plugin submenu,
    but it is better then nothing.

 panel/panel-window.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/panel/panel-window.c b/panel/panel-window.c
index 1852ad5..982ea9b 100644
--- a/panel/panel-window.c
+++ b/panel/panel-window.c
@@ -2294,6 +2294,19 @@ panel_window_set_autohide (PanelWindow *window,
 
 
 static void
+panel_window_menu_toggle_locked (GtkCheckMenuItem *item,
+                                 PanelWindow      *window)
+{
+  panel_return_if_fail (GTK_IS_CHECK_MENU_ITEM (item));
+  panel_return_if_fail (PANEL_IS_WINDOW (window));
+
+  g_object_set (G_OBJECT (window), "position-locked",
+      gtk_check_menu_item_get_active (item), NULL);
+}
+
+
+
+static void
 panel_window_menu_help (void)
 {
   panel_utils_show_help (NULL, NULL, NULL);
@@ -2373,6 +2386,18 @@ panel_window_menu_popup (PanelWindow *window,
       item = gtk_separator_menu_item_new ();
       gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
       gtk_widget_show (item);
+
+      item = gtk_check_menu_item_new_with_mnemonic (_("_Lock Panel"));
+      gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+      gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
+          window->position_locked);
+      g_signal_connect (G_OBJECT (item), "toggled",
+          G_CALLBACK (panel_window_menu_toggle_locked), window);
+      gtk_widget_show (item);
+
+      item = gtk_separator_menu_item_new ();
+      gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+      gtk_widget_show (item);
     }
 
   /* logout item */


More information about the Xfce4-commits mailing list