aboutsummaryrefslogtreecommitdiff
path: root/src/ui.cc
diff options
context:
space:
mode:
authorRodrigo Arias Mallo <rodarima@gmail.com>2025-08-04 21:46:18 +0200
committerRodrigo Arias Mallo <rodarima@gmail.com>2025-08-04 22:23:21 +0200
commit8429930aecec8f5714c9e956171002fbb9c4eba3 (patch)
treec5d0992fc22fb90b2dbebc3875a803408ecc1188 /src/ui.cc
parent607e4acefeec5776dfff63090a79baef15c6c336 (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.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui.cc b/src/ui.cc
index 30e0a2d5..9a01cdd5 100644
--- a/src/ui.cc
+++ b/src/ui.cc
@@ -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 &&