1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:17:35 +00:00

Browser: Use OpenInNewTab parameter in on_bookmark_click handler

This patch makes the function signature of the on_bookmark_click handler
more readable by replacing `Mod_None` with `OpenInNewTab::No` and
`Mod_Ctrl` with `OpenInNewTab::Yes`.
This commit is contained in:
networkException 2022-07-10 16:29:35 +02:00 committed by Andreas Kling
parent f9212ac02e
commit 5c1f1209fc
3 changed files with 12 additions and 7 deletions

View file

@ -484,8 +484,8 @@ void Tab::update_bookmark_button(String const& url)
void Tab::did_become_active()
{
BookmarksBarWidget::the().on_bookmark_click = [this](auto& url, unsigned modifiers) {
if (modifiers & Mod_Ctrl)
BookmarksBarWidget::the().on_bookmark_click = [this](auto& url, auto open_in_new_tab) {
if (open_in_new_tab == BookmarksBarWidget::OpenInNewTab::Yes)
on_tab_open_request(url);
else
load(url);