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

Browser: Move menu management from Tab to BrowserWindow

It was very confusing for every Tab to have their own GUI::Menubar that
got dynamically swapped in/out when switching tabs.

This change moves us to a single menubar per window, and BrowserWindow
is the owner of its own menubar.
This commit is contained in:
Andreas Kling 2021-05-18 17:32:28 +02:00
parent e5367c13d8
commit aed695d4b2
6 changed files with 345 additions and 304 deletions

View file

@ -8,6 +8,7 @@
#include "BookmarksBarWidget.h"
#include "WindowActions.h"
#include <LibGUI/ActionGroup.h>
#include <LibGUI/Window.h>
namespace Browser {
@ -22,17 +23,23 @@ public:
virtual ~BrowserWindow() override;
GUI::TabWidget& tab_widget();
Tab& active_tab();
void create_new_tab(URL, bool activate);
private:
explicit BrowserWindow(CookieJar&, URL);
void build_menus();
void set_window_title_for_tab(Tab const&);
CookieJar& m_cookie_jar;
WindowActions m_window_actions;
RefPtr<GUI::TabWidget> m_tab_widget;
RefPtr<BookmarksBarWidget> m_bookmarks_bar;
GUI::ActionGroup m_user_agent_spoof_actions;
GUI::ActionGroup m_search_engine_actions;
RefPtr<GUI::Action> m_disable_user_agent_spoofing;
};
}