mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:17:34 +00:00
Taskbar: Show default window icons when no icons are set
To be consistent with WindowServer.
This commit is contained in:
parent
8c5fa05c39
commit
7a61ed4178
2 changed files with 5 additions and 0 deletions
|
@ -56,6 +56,8 @@ TaskbarWindow::TaskbarWindow()
|
||||||
widget.set_frame_shape(Gfx::FrameShape::Panel);
|
widget.set_frame_shape(Gfx::FrameShape::Panel);
|
||||||
widget.set_frame_shadow(Gfx::FrameShadow::Raised);
|
widget.set_frame_shadow(Gfx::FrameShadow::Raised);
|
||||||
|
|
||||||
|
m_default_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png");
|
||||||
|
|
||||||
WindowList::the().aid_create_button = [this](auto& identifier) {
|
WindowList::the().aid_create_button = [this](auto& identifier) {
|
||||||
return create_button(identifier);
|
return create_button(identifier);
|
||||||
};
|
};
|
||||||
|
@ -137,6 +139,7 @@ NonnullRefPtr<GUI::Button> TaskbarWindow::create_button(const WindowIdentifier&
|
||||||
button.set_preferred_size(140, 22);
|
button.set_preferred_size(140, 22);
|
||||||
button.set_checkable(true);
|
button.set_checkable(true);
|
||||||
button.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
button.set_text_alignment(Gfx::TextAlignment::CenterLeft);
|
||||||
|
button.set_icon(*m_default_icon);
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,4 +42,6 @@ private:
|
||||||
NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
|
NonnullRefPtr<GUI::Button> create_button(const WindowIdentifier&);
|
||||||
|
|
||||||
virtual void wm_event(GUI::WMEvent&) override;
|
virtual void wm_event(GUI::WMEvent&) override;
|
||||||
|
|
||||||
|
RefPtr<Gfx::Bitmap> m_default_icon;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue