[gnome-commander] Made shortcuts visible also for toggleable menu items



commit 0bc272d3b0615db00e418835d42e47ad82f4dc8b
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sat Dec 21 23:56:45 2013 +0100

    Made shortcuts visible also for toggleable menu items
    
    For this, MENU_TYPE_TOGGLEITEM in src/gnome-cmd-main-menu.cc had to be extended.

 src/gnome-cmd-main-menu.cc |   20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/src/gnome-cmd-main-menu.cc b/src/gnome-cmd-main-menu.cc
index aa10269..89be63e 100644
--- a/src/gnome-cmd-main-menu.cc
+++ b/src/gnome-cmd-main-menu.cc
@@ -145,7 +145,8 @@ static void on_con_list_list_changed (GnomeCmdConList *con_list, GnomeCmdMainMen
 static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent, MenuData *spec)
 {
     GtkWidget *item=NULL;
-    GtkWidget *desc, *shortcut;
+    GtkWidget *desc=NULL;
+    GtkWidget *shortcut=NULL;
     GtkWidget *content = NULL;
     GtkWidget *pixmap = NULL;
 
@@ -189,8 +190,19 @@ static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent
             break;
 
         case MENU_TYPE_TOGGLEITEM:
-            item = gtk_check_menu_item_new_with_label (spec->label);
-            g_signal_connect (item, "toggled", G_CALLBACK (spec->moreinfo), spec->user_data);
+            item = gtk_check_menu_item_new ();
+            content = create_hbox (*main_win, FALSE, 12);
+
+            desc = create_label (*main_win, spec->label);
+            gtk_misc_set_alignment (GTK_MISC (desc), 0.0, 0.5);
+            gtk_box_pack_start (GTK_BOX (content), desc, TRUE, TRUE, 0);
+
+            shortcut = create_label (*main_win, spec->shortcut);
+            gtk_misc_set_alignment (GTK_MISC (shortcut), 1.0, 0.5);
+            gtk_box_pack_start (GTK_BOX (content), shortcut, TRUE, TRUE, 0);
+
+            gtk_container_add (GTK_CONTAINER (item), content);
+           g_signal_connect (item, "toggled", G_CALLBACK (spec->moreinfo), spec->user_data);
             break;
 
         case MENU_TYPE_SEPARATOR:
@@ -660,7 +672,7 @@ static void init (GnomeCmdMainMenu *main_menu)
         },
         MENUTYPE_SEPARATOR,
         {
-            MENU_TYPE_TOGGLEITEM, _("Show Hidden Files"), "", NULL,
+            MENU_TYPE_TOGGLEITEM, _("Show Hidden Files"), "Ctrl+Shift+H", NULL,
             (gpointer) view_hidden_files, NULL,
             GNOME_APP_PIXMAP_NONE, NULL,
             NULL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]