mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
WindowServer: Add window icons. Every window has the same icon for now.
The icons show up both in the title bars and in the window switcher. Eventually I'd like to be able to minimize to icon, and maybe even have myself a taskbar.
This commit is contained in:
parent
3729f7cc6a
commit
67ee579113
5 changed files with 34 additions and 5 deletions
|
@ -5,9 +5,18 @@
|
|||
#include <WindowServer/WSAPITypes.h>
|
||||
#include <WindowServer/WSClientConnection.h>
|
||||
|
||||
static GraphicsBitmap& default_window_icon()
|
||||
{
|
||||
static GraphicsBitmap* s_icon;
|
||||
if (!s_icon)
|
||||
s_icon = GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/window16.rgb", { 16, 16 }).leak_ref();
|
||||
return *s_icon;
|
||||
}
|
||||
|
||||
WSWindow::WSWindow(WSMessageReceiver& internal_owner, WSWindowType type)
|
||||
: m_internal_owner(&internal_owner)
|
||||
, m_type(type)
|
||||
, m_icon(default_window_icon())
|
||||
{
|
||||
WSWindowManager::the().add_window(*this);
|
||||
}
|
||||
|
@ -16,6 +25,7 @@ WSWindow::WSWindow(WSClientConnection& client, int window_id)
|
|||
: m_client(&client)
|
||||
, m_type(WSWindowType::Normal)
|
||||
, m_window_id(window_id)
|
||||
, m_icon(default_window_icon())
|
||||
{
|
||||
WSWindowManager::the().add_window(*this);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue