mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
Browser: Add Ctrl-<number> actions to changes tabs
It is now possible to quickly switch to specific tabs directly without having to 'search linearly'. Pressing Ctrl plus a number from 1 to 8 switches to the tab of that index. Pressing Ctrl-9 swithes to the last tab. This feature already exists in Firefox and Chrome.
This commit is contained in:
parent
1b7850f511
commit
3818840ee6
Notes:
sideshowbarker
2024-07-17 18:23:22 +09:00
Author: https://github.com/iCristalrope
Commit: 3818840ee6
Pull-request: https://github.com/SerenityOS/serenity/pull/13080
Reviewed-by: https://github.com/awesomekling
3 changed files with 28 additions and 0 deletions
|
@ -114,6 +114,15 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
|||
m_tab_widget->activate_previous_tab();
|
||||
};
|
||||
|
||||
for (int i = 0; i <= 7; ++i) {
|
||||
m_window_actions.on_tabs.append([this, i] {
|
||||
m_tab_widget->set_tab_index(i);
|
||||
});
|
||||
}
|
||||
m_window_actions.on_tabs.append([this] {
|
||||
m_tab_widget->activate_last_tab();
|
||||
});
|
||||
|
||||
m_window_actions.on_about = [this] {
|
||||
auto app_icon = GUI::Icon::default_icon("app-browser");
|
||||
GUI::AboutDialog::show("Browser", app_icon.bitmap_for_size(32), this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue