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

LibGUI: Add a ToolBarContainer widget and put most ToolBars in one

This mimics the Explorer toolbar container from Windows 2000 and looks
pretty neat! :^)
This commit is contained in:
Andreas Kling 2020-04-23 17:44:49 +02:00
parent 5b6c2f3bd6
commit ab336e895f
12 changed files with 179 additions and 18 deletions

View file

@ -38,6 +38,7 @@
#include <LibGUI/StatusBar.h>
#include <LibGUI/TextBox.h>
#include <LibGUI/ToolBar.h>
#include <LibGUI/ToolBarContainer.h>
#include <LibGUI/Window.h>
#include <LibWeb/CSS/StyleResolver.h>
#include <LibWeb/DOM/Element.h>
@ -104,8 +105,9 @@ int main(int argc, char** argv)
bool bookmarksbar_enabled = true;
auto& toolbar = widget.add<GUI::ToolBar>();
auto& bookmarksbar = widget.add<BookmarksBarWidget>(bookmarks_filename, bookmarksbar_enabled);
auto& toolbar_container = widget.add<GUI::ToolBarContainer>();
auto& toolbar = toolbar_container.add<GUI::ToolBar>();
auto& bookmarksbar = toolbar_container.add<BookmarksBarWidget>(bookmarks_filename, bookmarksbar_enabled);
auto& html_widget = widget.add<Web::HtmlView>();
bookmarksbar.on_bookmark_click = [&](auto&, auto& url) {