1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:47:35 +00:00

Browser: Share one BookmarksBarWidget between all Tabs

This commit is contained in:
Andreas Kling 2020-04-25 17:20:23 +02:00
parent dc6b61dbcc
commit bd45b2b8d3
7 changed files with 93 additions and 50 deletions

View file

@ -36,8 +36,18 @@
#include <LibGUI/Window.h>
#include <LibGfx/Palette.h>
namespace Browser {
static BookmarksBarWidget* s_the;
BookmarksBarWidget& BookmarksBarWidget::the()
{
return *s_the;
}
BookmarksBarWidget::BookmarksBarWidget(const String& bookmarks_file, bool enabled)
{
s_the = this;
set_layout<GUI::HorizontalBoxLayout>();
layout()->set_spacing(0);
@ -207,3 +217,5 @@ bool BookmarksBarWidget::add_bookmark(const String& url, const String& title)
}
return false;
}
}