diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-08-04 21:46:18 +0200 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2025-08-04 22:23:21 +0200 |
commit | 8429930aecec8f5714c9e956171002fbb9c4eba3 (patch) | |
tree | c5d0992fc22fb90b2dbebc3875a803408ecc1188 /src/ui.cc | |
parent | 607e4acefeec5776dfff63090a79baef15c6c336 (diff) |
Focus the N-th tab with Alt-<number>
Allows jumping directly to a given tab. It encourages a low number of
tabs opened, otherwise it will exceed the 1 to 10 range.
Diffstat (limited to 'src/ui.cc')
-rw-r--r-- | src/ui.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -794,6 +794,10 @@ int UI::handle(int event) const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw)); a_UIcmd_view_page_source(bw, url); ret = 1; + } else if (cmd >= KEYS_FOCUS_TAB1 && cmd <= KEYS_FOCUS_TAB10) { + int index = cmd - KEYS_FOCUS_TAB1; /* zero-based index */ + a_UIcmd_focus_tab(a_UIcmd_get_bw_by_widget(this), index); + ret = 1; } } else if (event == FL_RELEASE) { if (Fl::event_button() == FL_MIDDLE_MOUSE && |