[Xfce4-commits] <postler:master> Render app menu as toggle button and select first item

Christian Dywan noreply at xfce.org
Wed Dec 1 03:24:03 CET 2010


Updating branch refs/heads/master
         to 3129af78323aa2f762eb231909fa084792011755 (commit)
       from 17e864403a38e95a998d75008e356bfa50af156f (commit)

commit 3129af78323aa2f762eb231909fa084792011755
Author: Christian Dywan <christian at twotoasts.de>
Date:   Tue Nov 30 23:24:22 2010 +0100

    Render app menu as toggle button and select first item

 postler/postler-bureau.vala |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/postler/postler-bureau.vala b/postler/postler-bureau.vala
index 944c215..ec2c561 100644
--- a/postler/postler-bureau.vala
+++ b/postler/postler-bureau.vala
@@ -297,6 +297,10 @@ public class Postler.Bureau : Gtk.Window {
         }
         menu.popup (null, null, button_menu_position, 1,
                     Gtk.get_current_event_time ());
+        menu.select_first (true);
+        menu.deactivate.connect ((menu_shell) => {
+            (menu.attach_widget as Gtk.ToggleToolButton).active = false;
+        });
     }
 
     void action_zoom_in () {
@@ -505,7 +509,12 @@ public class Postler.Bureau : Gtk.Window {
         } );
         toolitem.add (search);
         toolitem.show_all ();
-        toolitem = actions.get_action ("View").create_tool_item () as Gtk.ToolItem;
+        toolitem = new Gtk.ToggleToolButton.from_stock (Gtk.STOCK_PROPERTIES);
+        toolitem.set ("label", _("Menu"));
+        actions.get_action ("View").connect_proxy (toolitem);
+        (toolitem as Gtk.ToggleToolButton).clicked.connect ((widget) => {
+            action_view (actions.get_action ("View"));
+        });
         toolbar.insert (toolitem, -1);
         shelf.pack_start (toolbar, false, false, 0);
         var hpaned = new Gtk.HPaned ();



More information about the Xfce4-commits mailing list