changeset 2039:45541ab7b1cc

Made SHIFT+{Left,Right} keyboard events work from the findbar
author Jorge Arellano Cid <jcid@dillo.org>
date Wed, 18 May 2011 14:05:55 -0400
parents 56134df9c63a
children 6c012332ba15
files src/findbar.cc src/uicmd.cc
diffstat 2 files changed, 4 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/findbar.cc	Tue May 17 18:58:20 2011 -0400
+++ b/src/findbar.cc	Wed May 18 14:05:55 2011 -0400
@@ -36,10 +36,10 @@
    unsigned modifier = Fl::event_state() & (FL_SHIFT| FL_CTRL| FL_ALT|FL_META);
 
    if (e == FL_KEYBOARD) {
-      if (k == FL_Left || k == FL_Right) {
-         if (modifier == FL_SHIFT) {
-            a_UIcmd_send_event_to_tabs_by_wid(e, this);
-            return 1;
+      if (modifier == FL_SHIFT) {
+         if (k == FL_Left || k == FL_Right) {
+            // Let these keys get to the UI
+            return 0;
          }
       } else if (k == FL_Escape && modifier == 0) {
          // Avoid clearing the text with Esc, just hide the findbar.
--- a/src/uicmd.cc	Tue May 17 18:58:20 2011 -0400
+++ b/src/uicmd.cc	Wed May 18 14:05:55 2011 -0400
@@ -341,20 +341,6 @@
 }
 
 /*
- * FLTK regards SHIFT + {Left, Right} as navigation keys.
- * Special handling is required to override it. Here we route
- * these events directly to the recipient.
- * TODO: focus is not remembered correctly.
- */
-void a_UIcmd_send_event_to_tabs_by_wid(int e, void *v_wid)
-{
-   BrowserWindow *bw = a_UIcmd_get_bw_by_widget(v_wid);
-   UI *ui = (UI*)bw->ui;
-   if (ui->tabs())
-      ui->tabs()->handle(e);
-}
-
-/*
  * Create a new UI and its associated BrowserWindow data structure.
  * Use style from v_ui. If non-NULL it must be of type UI*.
  */