1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 11:34:59 +00:00

Browser: Use GUI::CommonActions::make_about_action()

Browser had bespoke code for showing the exact same AboutDialog, in a
more convoluted way.
This commit is contained in:
Sam Atkins 2023-02-02 16:17:57 +00:00 committed by Sam Atkins
parent 900cd78121
commit c2082b45ee
3 changed files with 1 additions and 15 deletions

View file

@ -20,8 +20,6 @@
#include <LibCore/DateTime.h>
#include <LibCore/StandardPaths.h>
#include <LibCore/Stream.h>
#include <LibCore/Version.h>
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Application.h>
#include <LibGUI/Clipboard.h>
#include <LibGUI/Icon.h>
@ -131,11 +129,6 @@ BrowserWindow::BrowserWindow(CookieJar& cookie_jar, URL url)
m_tab_widget->activate_last_tab();
});
m_window_actions.on_about = [this] {
auto app_icon = GUI::Icon::default_icon("app-browser"sv);
GUI::AboutDialog::show("Browser"sv, Core::Version::read_long_version_string(), app_icon.bitmap_for_size(32), this);
};
m_window_actions.on_show_bookmarks_bar = [](auto& action) {
Browser::BookmarksBarWidget::the().set_visible(action.is_checked());
Config::write_bool("Browser"sv, "Preferences"sv, "ShowBookmarksBar"sv, action.is_checked());

View file

@ -75,13 +75,7 @@ WindowActions::WindowActions(GUI::Window& window)
&window));
m_tab_actions.last().set_status_tip("Switch to last tab");
m_about_action = GUI::Action::create(
"&About Browser", GUI::Icon::default_icon("app-browser"sv).bitmap_for_size(16), [this](const GUI::Action&) {
if (on_about)
on_about();
},
&window);
m_about_action->set_status_tip("Show application about box");
m_about_action = GUI::CommonActions::make_about_action("Browser", GUI::Icon::default_icon("app-browser"sv), &window);
m_show_bookmarks_bar_action = GUI::Action::create_checkable(
"&Bookmarks Bar", { Mod_Ctrl, Key_B },

View file

@ -22,7 +22,6 @@ public:
Function<void()> on_next_tab;
Function<void()> on_previous_tab;
Vector<Function<void()>> on_tabs;
Function<void()> on_about;
Function<void(GUI::Action&)> on_show_bookmarks_bar;
Function<void(GUI::Action&)> on_vertical_tabs;