GNOME Bugzilla – Bug 735511
too hard to move focus from the header bar to the text area
Last modified: 2014-08-28 19:17:22 UTC
While F10 moves focus from the text area to the header bar, getting back to the text area requires multiple TAB keypresses. I suggest using ESC for this purpose. Also, I think F10 should focus the gear/hamburger menu rather than the Open button.
Created attachment 284605 [details] [review] focus active view on 'Escape'
Review of attachment 284605 [details] [review]: commited as cf8b96a
(14:43:46) pbor: I do not think we do anything specific with F10 (14:44:02) pbor: I guess focusing the headerbar is some weird side effect (14:44:24) pbor: we should definitely make it pop up the gear menu slaf, should I open a separate bug for F10?
paolo, hi, it's fine on this bug, i'll do this soon
I was taking a quick look, and started out with the following patch, but it needs a bugfix in gtk, so I filed bug #735545 Anyway this is trickier than how it looks at first sight since - we need to handle switch between toggling the normal and the fullscreen button - when toggling the fullscreen button we need to show/hide the bar - when dismissing the popover we need to focus the view diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c index 7a4231e..ef77587 100644 --- a/gedit/gedit-app.c +++ b/gedit/gedit-app.c @@ -575,6 +575,7 @@ gedit_app_startup (GApplication *application) add_accelerator (app, "app.quit", "<Primary>Q"); add_accelerator (app, "app.help", "F1"); + add_accelerator (app, "win.gear-menu", "F10"); add_accelerator (app, "win.open", "<Primary>O"); add_accelerator (app, "win.save", "<Primary>S"); add_accelerator (app, "win.save-as", "<Primary><Shift>S"); diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c index d8de113..f8b99c7 100644 --- a/gedit/gedit-window.c +++ b/gedit/gedit-window.c @@ -2667,7 +2667,23 @@ extension_removed (PeasExtensionSet *extensions, gedit_window_activatable_deactivate (GEDIT_WINDOW_ACTIVATABLE (exten)); } +static void +gedit_window_toggle_gear_menu (GSimpleAction *action, + GVariant *state, + gpointer user_data) +{ + GeditWindow *window = GEDIT_WINDOW (user_data); + gboolean open; + + open = g_variant_get_boolean (state); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (window->priv->gear_button), + open); + + g_simple_action_set_state (action, state); +} + static GActionEntry win_entries[] = { + { "gear-menu", NULL, NULL, "false", gedit_window_toggle_gear_menu }, { "new-tab", _gedit_cmd_file_new }, { "open", _gedit_cmd_file_open }, { "revert", _gedit_cmd_file_revert },
Created attachment 284640 [details] [review] patch actually I think I found a more elegant way to solve it by using a g_property_action... However the fullscreen part is tricky with all the magic to handle enter/leave events for the bar autohide. Slaf: can you double check?
pbor, add this in gedit_window_init : window->priv->fullscreen_eventbox_leave_state = TRUE;
Created attachment 284658 [details] [review] patch Thanks for the suggestion. I changed the name of the variable to in_fullscreen_eventbox (reversing the boolean values) since I think it is more readable. This will go in as soon as the GTK patch is accepted
Review of attachment 284658 [details] [review]: I'd say push already the parts that just change the name?
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.