From e6d077a6f22533be7f150a4cf81f616a1d7cc3cc Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 16 Mar 2004 10:48:52 +0000 Subject: [PATCH] r3375: Option to make the File menu appear directly when the menu is opened with files selected (Peter Geer). --- ROX-Filer/Help/Changes | 5 +++++ ROX-Filer/Options.xml | 2 ++ ROX-Filer/src/menu.c | 16 +++++++++++----- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ROX-Filer/Help/Changes b/ROX-Filer/Help/Changes index 1ea18baa..e04af3ea 100644 --- a/ROX-Filer/Help/Changes +++ b/ROX-Filer/Help/Changes @@ -2,6 +2,11 @@ A RISC OS-like filer for X by Thomas Leonard +16-Mar-2004 +~~~~~~~~~~~ +Option to make the File menu appear directly when the menu is opened with +files selected (Peter Geer). + 15-Mar-2004 ~~~~~~~~~~~ Added an arrow to the comparison area of the action box so you can see diff --git a/ROX-Filer/Options.xml b/ROX-Filer/Options.xml index 06e925ab..fc9e2525 100644 --- a/ROX-Filer/Options.xml +++ b/ROX-Filer/Options.xml @@ -260,6 +260,8 @@ operation, such as copying or deleting some files. + Show the File menu instead of the main menu when right-clicking with files selected (the main menu can be accessed by holding down Control). + The program to launch when you choose `Xterm Here' from the menu. diff --git a/ROX-Filer/src/menu.c b/ROX-Filer/src/menu.c index 964ec3b4..e0850baa 100644 --- a/ROX-Filer/src/menu.c +++ b/ROX-Filer/src/menu.c @@ -93,7 +93,7 @@ static GtkWidget *popup_menu = NULL; /* Currently open menu */ static gint updating_menu = 0; /* Non-zero => ignore activations */ static GList *send_to_paths = NULL; -static Option o_menu_iconsize, o_menu_xterm; +static Option o_menu_iconsize, o_menu_xterm, o_menu_quick; /* Static prototypes */ @@ -329,6 +329,7 @@ void menu_init(void) option_add_string(&o_menu_xterm, "menu_xterm", "xterm"); option_add_int(&o_menu_iconsize, "menu_iconsize", MIS_SMALL); + option_add_int(&o_menu_quick, "menu_quick", FALSE); option_add_saver(save_menus); option_register_widget("menu-set-keys", set_keys_button); @@ -780,14 +781,19 @@ void show_filer_menu(FilerWindow *filer_window, GdkEvent *event, ViewIter *iter) gtk_widget_set_sensitive(filer_follow_sym, strcmp(filer_window->sym_path, filer_window->real_path) != 0); - popup_menu = (state & GDK_CONTROL_MASK) - ? filer_file_menu - : filer_menu; + if (n_selected && o_menu_quick.int_value) + popup_menu = (state & GDK_CONTROL_MASK) + ? filer_menu + : filer_file_menu; + else + popup_menu = (state & GDK_CONTROL_MASK) + ? filer_file_menu + : filer_menu; updating_menu--; show_popup_menu(popup_menu, event, - popup_menu == filer_file_menu ? (n_added + 7) : 1); + popup_menu == filer_file_menu ? n_added : 1); } static void menu_closed(GtkWidget *widget) -- 2.11.4.GIT