mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
Browser: Add Go menu and move Bookmarks bar toggle to View
This commit is contained in:
parent
38e70d2874
commit
fb5cdc670f
3 changed files with 14 additions and 6 deletions
|
@ -116,11 +116,12 @@ Tab::Tab(Type type)
|
||||||
|
|
||||||
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { go_back(); }, this);
|
m_go_back_action = GUI::CommonActions::make_go_back_action([this](auto&) { go_back(); }, this);
|
||||||
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { go_forward(); }, this);
|
m_go_forward_action = GUI::CommonActions::make_go_forward_action([this](auto&) { go_forward(); }, this);
|
||||||
|
m_go_home_action = GUI::CommonActions::make_go_home_action([this](auto&) { load(g_home_url); }, this);
|
||||||
|
|
||||||
toolbar.add_action(*m_go_back_action);
|
toolbar.add_action(*m_go_back_action);
|
||||||
toolbar.add_action(*m_go_forward_action);
|
toolbar.add_action(*m_go_forward_action);
|
||||||
|
toolbar.add_action(*m_go_home_action);
|
||||||
|
|
||||||
toolbar.add_action(GUI::CommonActions::make_go_home_action([this](auto&) { load(g_home_url); }, this));
|
|
||||||
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { reload(); }, this);
|
m_reload_action = GUI::CommonActions::make_reload_action([this](auto&) { reload(); }, this);
|
||||||
|
|
||||||
toolbar.add_action(*m_reload_action);
|
toolbar.add_action(*m_reload_action);
|
||||||
|
@ -290,13 +291,14 @@ Tab::Tab(Type type)
|
||||||
},
|
},
|
||||||
this));
|
this));
|
||||||
|
|
||||||
app_menu.add_action(*m_reload_action);
|
|
||||||
app_menu.add_separator();
|
app_menu.add_separator();
|
||||||
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) {
|
||||||
GUI::Application::the()->quit();
|
GUI::Application::the()->quit();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
auto& view_menu = m_menubar->add_menu("View");
|
auto& view_menu = m_menubar->add_menu("View");
|
||||||
|
view_menu.add_action(WindowActions::the().show_bookmarks_bar_action());
|
||||||
|
view_menu.add_separator();
|
||||||
view_menu.add_action(GUI::CommonActions::make_fullscreen_action(
|
view_menu.add_action(GUI::CommonActions::make_fullscreen_action(
|
||||||
[this](auto&) {
|
[this](auto&) {
|
||||||
window()->set_fullscreen(!window()->is_fullscreen());
|
window()->set_fullscreen(!window()->is_fullscreen());
|
||||||
|
@ -315,6 +317,13 @@ Tab::Tab(Type type)
|
||||||
},
|
},
|
||||||
this));
|
this));
|
||||||
|
|
||||||
|
auto& go_menu = m_menubar->add_menu("Go");
|
||||||
|
go_menu.add_action(*m_go_back_action);
|
||||||
|
go_menu.add_action(*m_go_forward_action);
|
||||||
|
go_menu.add_action(*m_go_home_action);
|
||||||
|
go_menu.add_separator();
|
||||||
|
go_menu.add_action(*m_reload_action);
|
||||||
|
|
||||||
auto view_source_action = GUI::Action::create(
|
auto view_source_action = GUI::Action::create(
|
||||||
"View source", { Mod_Ctrl, Key_U }, [this](auto&) {
|
"View source", { Mod_Ctrl, Key_U }, [this](auto&) {
|
||||||
if (m_type == Type::InProcessWebView) {
|
if (m_type == Type::InProcessWebView) {
|
||||||
|
@ -430,9 +439,6 @@ Tab::Tab(Type type)
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
auto& bookmarks_menu = m_menubar->add_menu("Bookmarks");
|
|
||||||
bookmarks_menu.add_action(WindowActions::the().show_bookmarks_bar_action());
|
|
||||||
|
|
||||||
auto& help_menu = m_menubar->add_menu("Help");
|
auto& help_menu = m_menubar->add_menu("Help");
|
||||||
help_menu.add_action(WindowActions::the().about_action());
|
help_menu.add_action(WindowActions::the().about_action());
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ private:
|
||||||
|
|
||||||
RefPtr<GUI::Action> m_go_back_action;
|
RefPtr<GUI::Action> m_go_back_action;
|
||||||
RefPtr<GUI::Action> m_go_forward_action;
|
RefPtr<GUI::Action> m_go_forward_action;
|
||||||
|
RefPtr<GUI::Action> m_go_home_action;
|
||||||
RefPtr<GUI::Action> m_reload_action;
|
RefPtr<GUI::Action> m_reload_action;
|
||||||
RefPtr<GUI::TextBox> m_location_box;
|
RefPtr<GUI::TextBox> m_location_box;
|
||||||
RefPtr<GUI::Button> m_bookmark_button;
|
RefPtr<GUI::Button> m_bookmark_button;
|
||||||
|
|
|
@ -70,8 +70,9 @@ WindowActions::WindowActions(GUI::Window& window)
|
||||||
on_about();
|
on_about();
|
||||||
},
|
},
|
||||||
&window);
|
&window);
|
||||||
|
|
||||||
m_show_bookmarks_bar_action = GUI::Action::create_checkable(
|
m_show_bookmarks_bar_action = GUI::Action::create_checkable(
|
||||||
"Show bookmarks bar",
|
"Bookmarks bar", { Mod_Ctrl, Key_B },
|
||||||
[this](auto& action) {
|
[this](auto& action) {
|
||||||
if (on_show_bookmarks_bar)
|
if (on_show_bookmarks_bar)
|
||||||
on_show_bookmarks_bar(action);
|
on_show_bookmarks_bar(action);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue