Browser: Introduce action for opening bookmarks in a new window

This change introduces an action to bookmarks that allows them to be
opened in a new browser window. This is done by accessing any
bookmark's context menu and pressing "Open in New Window".
This commit is contained in:
Kemal Zebari 2022-12-20 23:28:00 -08:00 committed by Sam Atkins
commit 1dddefa737
Notes: sideshowbarker 2024-07-17 02:55:37 +09:00
6 changed files with 32 additions and 11 deletions

View file

@ -580,9 +580,11 @@ void Tab::update_bookmark_button(DeprecatedString const& url)
void Tab::did_become_active()
{
BookmarksBarWidget::the().on_bookmark_click = [this](auto& url, auto open_in_new_tab) {
if (open_in_new_tab == BookmarksBarWidget::OpenInNewTab::Yes)
BookmarksBarWidget::the().on_bookmark_click = [this](auto& url, auto open) {
if (open == BookmarksBarWidget::Open::InNewTab)
on_tab_open_request(url);
else if (open == BookmarksBarWidget::Open::InNewWindow)
on_window_open_request(url);
else
load(url);
};