summaryrefslogtreecommitdiff
path: root/Userland/Applications/Browser/Tab.cpp
diff options
context:
space:
mode:
authorKemal Zebari <kemalzebra@gmail.com>2023-02-24 01:10:57 -0800
committerSam Atkins <atkinssj@gmail.com>2023-03-17 13:43:11 +0000
commit3918a8492be9b162d94f5b3bf8ba6d4fd2a7fce0 (patch)
tree303962fe3c5b550e84da3fd6a8f155bf0e50c323 /Userland/Applications/Browser/Tab.cpp
parent5ec727deb43f6d7a64657b72992a4b82ded5b91f (diff)
downloadserenity-3918a8492be9b162d94f5b3bf8ba6d4fd2a7fce0.zip
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.
Diffstat (limited to 'Userland/Applications/Browser/Tab.cpp')
-rw-r--r--Userland/Applications/Browser/Tab.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Applications/Browser/Tab.cpp b/Userland/Applications/Browser/Tab.cpp
index c18ff748c5..83e724166e 100644
--- a/Userland/Applications/Browser/Tab.cpp
+++ b/Userland/Applications/Browser/Tab.cpp
@@ -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());