1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 00:58:12 +00:00

Ladybird: Add Favicon to the window

This commit is contained in:
Keir Davis 2022-07-05 05:53:11 +01:00 committed by Andrew Kaster
parent 47d7f1efec
commit 95e3e06a1e
4 changed files with 14 additions and 1 deletions

View file

@ -48,6 +48,7 @@
#include <LibWebSocket/ConnectionInfo.h>
#include <LibWebSocket/Message.h>
#include <LibWebSocket/WebSocket.h>
#include <QIcon>
#include <QMouseEvent>
#include <QPaintEvent>
#include <QPainter>
@ -210,8 +211,11 @@ public:
m_view.viewport()->update();
}
virtual void page_did_change_favicon(Gfx::Bitmap const&) override
virtual void page_did_change_favicon(Gfx::Bitmap const& bitmap) override
{
ByteBuffer bytebuffer = bitmap.serialize_to_byte_buffer();
QPixmap icon = QPixmap::fromImage(QImage(bytebuffer.bytes().data(), bitmap.width(), bitmap.height(), QImage::Format_ARGB32));
emit m_view.favicon_changed(QIcon(icon));
}
virtual void page_did_layout() override