Hi,

I am resending this mail, as i forgot to register first on the mailing list.

I have created a patch to fix bug 1888882, as a requirement for GSoC,
I have also enabled tabbing support in the gtk verision netsurf.

Sorry about (being lazy and :) submitting it late.

-- pranabendu (afterstep13)

PATCH START
=======

--- netsurf/desktop/textinput.c (revision 7039)
+++ netsurf/desktop/textinput.c (working copy)
@@ -466,6 +466,63 @@
               reflow = true;
               break;

+       case KEY_TAB:
+       {
+               struct form_control *next_input;
+               struct box *widget = textarea;
+               /* Find next text entry field that is actually
+                * displayed (i.e. has an associated box) */
+               for (next_input = widget->gadget->next;
+                               next_input &&
+                               ((next_input->type != GADGET_TEXTBOX &&
+                               next_input->type != GADGET_TEXTAREA &&
+                               next_input->type != GADGET_PASSWORD) ||
+                               !next_input->box);
+                               next_input = next_input->next)
+                       ;
+               if (!next_input)
+                       return true;
+
+               widget = next_input->box;
+               // text_box = widget->children->children;
+               // box_offset = 0;
+               bool to_textarea = next_input->type == GADGET_TEXTAREA;
+
+               selection_clear(bw->sel, true);
+               input_update_display(bw, widget, 0, to_textarea, false);
+               return true;
+
+       }
+               break;
+
+       case KEY_SHIFT_TAB:
+       {
+               struct form_control *prev_input;
+               struct box *widget = textarea;
+               /* Find previous text entry field that is actually
+                * displayed (i.e. has an associated box) */
+               for (prev_input = widget->gadget->prev;
+                               prev_input &&
+                               ((prev_input->type != GADGET_TEXTBOX &&
+                               prev_input->type != GADGET_TEXTAREA &&
+                               prev_input->type != GADGET_PASSWORD) ||
+                               !prev_input->box);
+                               prev_input = prev_input->prev)
+                       ;
+               if (!prev_input)
+                       return true;
+
+               widget = prev_input->box;
+               bool to_textarea = prev_input->type == GADGET_TEXTAREA;
+
+               selection_clear(bw->sel, true);
+               input_update_display(bw, widget, 0, to_textarea, false);
+
+               return true;
+
+       }
+               break;
+
       case KEY_NL:
       case KEY_CR:    /* paragraph break */
               if (selection_exists) {
--- netsurf/gtk/gtk_window.c    (revision 7039)
+++ netsurf/gtk/gtk_window.c    (working copy)
@@ -460,6 +460,8 @@
                case GDK_Right:                 return KEY_RIGHT;
                case GDK_Up:                    return KEY_UP;
                case GDK_Down:                  return KEY_DOWN;
+                case GDK_Tab:                   return KEY_TAB;
+                case GDK_ISO_Left_Tab:          return KEY_SHIFT_TAB;

                /* Modifiers - do nothing for now */
                case GDK_Shift_L:

=======
PATCH END

-- 
Pranabendu Misra
[email protected]
[email protected]

eleven plus two ~ twelve plus one
(re-arrangement of alphabets :)

Reply via email to