1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:47:34 +00:00

Browser: Have the bookmark button use the editor dialog

Now when the bookmark button that has not yet bookmarked the current
URL is pressed, it will add the bookmark but also prompt the user
with the BookmarkEditor dialog in case they wish to make final
touches to their bookmark title or URL. If they cancel or escape
the dialog, the bookmark will be removed.
This commit is contained in:
Kemal Zebari 2023-02-24 01:10:57 -08:00 committed by Sam Atkins
parent 5ec727deb4
commit 3918a8492b
3 changed files with 55 additions and 20 deletions

View file

@ -610,6 +610,12 @@ void Tab::did_become_active()
m_statusbar->set_text(url);
};
BookmarksBarWidget::the().on_bookmark_add = [this](auto& url) {
auto current_url = this->url().to_deprecated_string();
if (current_url == url)
update_bookmark_button(current_url);
};
BookmarksBarWidget::the().remove_from_parent();
m_toolbar_container->add_child(BookmarksBarWidget::the());