[Xfce4-commits] [apps/mousepad] 08/09: Add menubar action to textview menu

noreply at xfce.org noreply at xfce.org
Sun Jul 13 05:10:26 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit f70c88b0e35a9ea2120f145374f1bb7600c52ca0
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Sat Jul 12 19:06:47 2014 -0700

    Add menubar action to textview menu
    
    When the menubar is hidden so that users can easily get it back.
---
 mousepad/mousepad-window-ui.xml |    2 ++
 mousepad/mousepad-window.c      |   10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/mousepad/mousepad-window-ui.xml b/mousepad/mousepad-window-ui.xml
index 30e4b2b..e03223d 100644
--- a/mousepad/mousepad-window-ui.xml
+++ b/mousepad/mousepad-window-ui.xml
@@ -204,5 +204,7 @@
     <menuitem action="duplicate" />
     <menuitem action="increase-indent" />
     <menuitem action="decrease-indent" />
+    <separator name="menubar-visible-separator" />
+    <menuitem name="menubar-visible-item" action="menubar" />
   </popup>
 </ui>
diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index d5d19b4..e18fc42 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -996,6 +996,16 @@ mousepad_window_init (MousepadWindow *window)
   gtk_drag_dest_set (GTK_WIDGET (window), GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP, drop_targets, G_N_ELEMENTS (drop_targets), GDK_ACTION_COPY | GDK_ACTION_MOVE);
   g_signal_connect (G_OBJECT (window), "drag-data-received", G_CALLBACK (mousepad_window_drag_data_received), window);
 
+  /* Add menubar action to the textview menu when the menubar is hidden */
+  item = gtk_ui_manager_get_widget (window->ui_manager, "/textview-menu/menubar-visible-separator");
+  g_object_bind_property (window->menubar, "visible",
+                          item,            "visible",
+                          G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+  item = gtk_ui_manager_get_widget (window->ui_manager, "/textview-menu/menubar-visible-item");
+  g_object_bind_property (window->menubar, "visible",
+                          item,            "visible",
+                          G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE | G_BINDING_INVERT_BOOLEAN);
+
   /* update the window title when 'path-in-title' setting changes */
   MOUSEPAD_SETTING_CONNECT (PATH_IN_TITLE,
                             G_CALLBACK (mousepad_window_update_window_title),

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list