After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764219 - Using the TAB-key for navigation does not focus correctly
Using the TAB-key for navigation does not focus correctly
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: preferences
3.20.x
Other Linux
: Normal minor
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-25 23:04 UTC by Leo Sperling
Modified: 2016-12-24 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Preferences: navigate to next GtkEntry with single tab/arrow (5.25 KB, patch)
2016-12-15 22:41 UTC, Kritarth
none Details | Review
Preferences: navigate to next GtkEntry with single tab/arrow (5.33 KB, patch)
2016-12-22 20:32 UTC, Kritarth
committed Details | Review

Description Leo Sperling 2016-03-25 23:04:11 UTC
When you go to settings -> Version Control you type your Author name and when you press TAB you should be in the text field of Email
Comment 1 Kritarth 2016-12-15 22:41:29 UTC
Created attachment 342046 [details] [review]
Preferences: navigate to next GtkEntry with single tab/arrow

Earlier, on TAB/arrow the focus was shifted from GtkEntry to next
GtkListBoxRow. This required one more tab/arrow key press to focus
the required GtkEntry. Continued work on an implementation by
Sébastien Lafargue (https://paste.fedoraproject.org/506997/).
Implemented single tab_backward to navigate to previous GtkEntry.
This was achieved with the help of 'focus' signal.
If (GtkEntry is focused and direction=TAB_BACKWARD) then
        shift focus to GtkListBoxRow of that GtkEntry
Comment 2 sébastien lafargue 2016-12-22 19:17:11 UTC
Review of attachment 342046 [details] [review]:

::: libide/preferences/ide-preferences-group.c
@@ +286,3 @@
+  self->last_focused_tab_backward = (dir == GTK_DIR_TAB_BACKWARD);
+
+  child = gtk_bin_get_child (GTK_BIN (row));

if we're not on a IdePreferencesEntry, we get:
CRITICAL: ide_preferences_entry_get_entry_widget: assertion 'IDE_IS_PREFERENCES_ENTRY (self)' failed

you need to check that before casting:
if (IDE_IS_PREFERENCES_ENTRY (child))
{

@@ +292,3 @@
+      if (gtk_widget_is_focus (entry) && dir == GTK_DIR_TAB_BACKWARD)
+          gtk_widget_grab_focus (GTK_WIDGET (row));
+

use && better than cascading the condition:
if (a &&
    b &&
    c)
 {
   ...
 }

@@ +356,3 @@
+                               G_CALLBACK (ide_preferences_group_row_grab_focus),
+                               self,
+                               G_CONNECT_AFTER | G_CONNECT_SWAPPED);

params are misaligned
Comment 3 Kritarth 2016-12-22 20:32:07 UTC
Created attachment 342401 [details] [review]
Preferences: navigate to next GtkEntry with single tab/arrow

Earlier, on TAB/arrow the focus was shifted from GtkEntry to next
GtkListBoxRow. This required one more tab/arrow key press to focus
the required GtkEntry. Continued work on an implementation by
Sébastien Lafargue (https://paste.fedoraproject.org/506997/).
Implemented single tab_backward to navigate to previous GtkEntry.
This was achieved with the help of 'focus' signal.
If (GtkEntry is focused and direction=TAB_BACKWARD) then
        shift focus to GtkListBoxRow of that GtkEntry
Comment 4 sébastien lafargue 2016-12-24 11:24:50 UTC
Attachment 342401 [details] pushed as ae543d5 - Preferences: navigate to next GtkEntry with single tab/arrow