mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +00:00
Browser: Provide ability to create new browser windows
This change allows a user to spawn new browser processes by either going to "File -> New Window" or by the shortcut "Ctrl + N".
This commit is contained in:
parent
48389f4179
commit
90719d34af
4 changed files with 21 additions and 0 deletions
|
@ -103,6 +103,10 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
|
|||
create_new_tab(Browser::url_from_user_input(Browser::g_new_tab_url), true);
|
||||
};
|
||||
|
||||
m_window_actions.on_create_new_window = [this] {
|
||||
GUI::Process::spawn_or_show_error(this, "/bin/Browser"sv);
|
||||
};
|
||||
|
||||
m_window_actions.on_next_tab = [this] {
|
||||
m_tab_widget->activate_next_tab();
|
||||
};
|
||||
|
@ -154,6 +158,7 @@ void BrowserWindow::build_menus()
|
|||
{
|
||||
auto& file_menu = add_menu("&File");
|
||||
file_menu.add_action(WindowActions::the().create_new_tab_action());
|
||||
file_menu.add_action(WindowActions::the().create_new_window_action());
|
||||
|
||||
auto close_tab_action = GUI::CommonActions::make_close_tab_action([this](auto&) {
|
||||
active_tab().on_tab_close_request(active_tab());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue