Mercurial > dillo_port1.3
changeset 378:003d3ebfd78d
- Made SHIFT + {Left, Right} work even with findbar focused.
author | jcid |
---|---|
date | Thu, 02 Oct 2008 16:57:58 +0200 |
parents | e22f6898fa6a |
children | 52f65d7a0e7c |
files | src/findbar.cc src/ui.cc src/uicmd.cc src/uicmd.hh |
diffstat | 4 files changed, 32 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/findbar.cc Wed Oct 01 23:38:43 2008 +0200 +++ b/src/findbar.cc Thu Oct 02 16:57:58 2008 +0200 @@ -34,12 +34,19 @@ _MSG("findbar MyInput::handle()\n"); int ret = 1, k = event_key(); unsigned modifier = event_state() & (SHIFT | CTRL | ALT | META); - if (modifier == 0) { - if (e == KEY && k == EscapeKey) { - _MSG("findbar MyInput: caught EscapeKey\n"); - ret = 0; + + if (e == KEY) { + if (k == LeftKey || k == RightKey) { + if (modifier == SHIFT) { + a_UIcmd_send_event_to_tabs_by_wid(e, this); + return 1; + } + } else if (k == EscapeKey && modifier == 0) { + // Avoid clearing the text with Esc, just hide the findbar. + return 0; } } + if (ret) ret = Input::handle(e); return ret;
--- a/src/ui.cc Wed Oct 01 23:38:43 2008 +0200 +++ b/src/ui.cc Thu Oct 02 16:57:58 2008 +0200 @@ -119,8 +119,11 @@ } else if (k == 'o' || k == 'r' || k == HomeKey || k == EndKey) return 0; } else if (modifier == SHIFT) { - if (k == LeftKey || k == RightKey) - return 0; + if (k == LeftKey || k == RightKey) { + _MSG(" CustInput::handle > SHIFT+RightKey\n"); + a_UIcmd_send_event_to_tabs_by_wid(e, this); + return 1; + } } } _MSG("\n");
--- a/src/uicmd.cc Wed Oct 01 23:38:43 2008 +0200 +++ b/src/uicmd.cc Thu Oct 02 16:57:58 2008 +0200 @@ -70,10 +70,9 @@ int i = value(); if (k == LeftKey) {i = i ? i-1 : children()-1;} else {i++; if (i >= children()) i = 0;} - if (value(i)) do_callback(); + selected_child(child(i)); return 1; } - return 0; } } return TabGroup::handle(e); @@ -137,6 +136,20 @@ } /* + * FLTK regards SHIFT + {LeftKey, 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*. */
--- a/src/uicmd.hh Wed Oct 01 23:38:43 2008 +0200 +++ b/src/uicmd.hh Thu Oct 02 16:57:58 2008 +0200 @@ -10,6 +10,7 @@ BrowserWindow *a_UIcmd_browser_window_new(int ww, int wh, const void *v_bw); BrowserWindow *a_UIcmd_get_bw_by_widget(void *v_wid); +void a_UIcmd_send_event_to_tabs_by_wid(int e, void *v_wid); void a_UIcmd_open_urlstr(void *vbw, const char *urlstr); void a_UIcmd_open_url(BrowserWindow *bw, const DilloUrl *url); void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url);