summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-02-02 16:17:57 +0000
committerSam Atkins <atkinssj@gmail.com>2023-02-07 10:43:15 +0000
commitc2082b45eeb39e8074d5421f200832efa659fcfe (patch)
treea58f853f7f5ee168a929d0338c36c977b13c7919 /Userland/Applications
parent900cd78121b7e84def3f5b45f6429263e525177f (diff)
downloadserenity-c2082b45eeb39e8074d5421f200832efa659fcfe.zip
Browser: Use `GUI::CommonActions::make_about_action()`
Browser had bespoke code for showing the exact same AboutDialog, in a more convoluted way.
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/Browser/BrowserWindow.cpp7
-rw-r--r--Userland/Applications/Browser/WindowActions.cpp8
-rw-r--r--Userland/Applications/Browser/WindowActions.h1
3 files changed, 1 insertions, 15 deletions
diff --git a/Userland/Applications/Browser/BrowserWindow.cpp b/Userland/Applications/Browser/BrowserWindow.cpp
index 9d315486ab..46931066ea 100644
--- a/Userland/Applications/Browser/BrowserWindow.cpp
+++ b/Userland/Applications/Browser/BrowserWindow.cpp
@@ -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());
diff --git a/Userland/Applications/Browser/WindowActions.cpp b/Userland/Applications/Browser/WindowActions.cpp
index a18e574307..ce2b9478cb 100644
--- a/Userland/Applications/Browser/WindowActions.cpp
+++ b/Userland/Applications/Browser/WindowActions.cpp
@@ -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 },
diff --git a/Userland/Applications/Browser/WindowActions.h b/Userland/Applications/Browser/WindowActions.h
index fb2a70335e..25a3a0f0ee 100644
--- a/Userland/Applications/Browser/WindowActions.h
+++ b/Userland/Applications/Browser/WindowActions.h
@@ -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;