diff options
author | Andreas Kling <kling@serenityos.org> | 2023-05-27 16:25:22 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-27 17:26:29 +0200 |
commit | 7603f8dcae15650a350311c45f46df4403fcda26 (patch) | |
tree | 45972199c76383de0fd4a8e86264964bae210aae | |
parent | a98f5c7251dec834d82734d68f4bf6ad8efea069 (diff) | |
download | serenity-7603f8dcae15650a350311c45f46df4403fcda26.zip |
Ladybird: Use the DALL-E ladybird globe as the application icon
This looks a lot more "at home" than usual pixel art logo on
non-SerenityOS systems. :^)
Also, stop using site favicons as the app icon as that made it
annoyingly hard to find Ladybird in task switchers sometimes.
-rw-r--r-- | Ladybird/BrowserWindow.cpp | 16 | ||||
-rw-r--r-- | Ladybird/Icons/ladybird.png | bin | 0 -> 101263 bytes | |||
-rw-r--r-- | Ladybird/ladybird.qrc | 1 |
3 files changed, 13 insertions, 4 deletions
diff --git a/Ladybird/BrowserWindow.cpp b/Ladybird/BrowserWindow.cpp index 4805ad693b..c03d85e656 100644 --- a/Ladybird/BrowserWindow.cpp +++ b/Ladybird/BrowserWindow.cpp @@ -28,12 +28,23 @@ extern DeprecatedString s_serenity_resource_root; extern Browser::Settings* s_settings; +static QIcon const& app_icon() +{ + static QIcon icon; + if (icon.isNull()) { + QPixmap pixmap; + pixmap.load(":/Icons/ladybird.png"); + icon = QIcon(pixmap); + } + return icon; +} + BrowserWindow::BrowserWindow(Browser::CookieJar& cookie_jar, StringView webdriver_content_ipc_path, WebView::EnableCallgrindProfiling enable_callgrind_profiling) : m_cookie_jar(cookie_jar) , m_webdriver_content_ipc_path(webdriver_content_ipc_path) , m_enable_callgrind_profiling(enable_callgrind_profiling) - { + setWindowIcon(app_icon()); m_tabs_container = new QTabWidget(this); m_tabs_container->installEventFilter(this); m_tabs_container->setElideMode(Qt::TextElideMode::ElideRight); @@ -333,7 +344,6 @@ BrowserWindow::BrowserWindow(Browser::CookieJar& cookie_jar, StringView webdrive QObject::connect(quit_action, &QAction::triggered, this, &QMainWindow::close); QObject::connect(m_tabs_container, &QTabWidget::currentChanged, [this](int index) { setWindowTitle(QString("%1 - Ladybird").arg(m_tabs_container->tabText(index))); - setWindowIcon(m_tabs_container->tabIcon(index)); set_current_tab(verify_cast<Tab>(m_tabs_container->widget(index))); }); QObject::connect(m_tabs_container, &QTabWidget::tabCloseRequested, this, &BrowserWindow::close_tab); @@ -513,8 +523,6 @@ void BrowserWindow::tab_title_changed(int index, QString const& title) void BrowserWindow::tab_favicon_changed(int index, QIcon icon) { m_tabs_container->setTabIcon(index, icon); - if (m_tabs_container->currentIndex() == index) - setWindowIcon(icon); } void BrowserWindow::open_next_tab() diff --git a/Ladybird/Icons/ladybird.png b/Ladybird/Icons/ladybird.png Binary files differnew file mode 100644 index 0000000000..924c419350 --- /dev/null +++ b/Ladybird/Icons/ladybird.png diff --git a/Ladybird/ladybird.qrc b/Ladybird/ladybird.qrc index c3e8907822..882e3ed796 100644 --- a/Ladybird/ladybird.qrc +++ b/Ladybird/ladybird.qrc @@ -1,5 +1,6 @@ <!DOCTYPE RCC><RCC version="1.0"> <qresource> + <file>Icons/ladybird.png</file> <file>Icons/back.svg</file> <file>Icons/forward.svg</file> <file>Icons/reload.svg</file> |