mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
parent
eca74088a0
commit
5e823d3de0
2 changed files with 12 additions and 2 deletions
|
@ -297,8 +297,17 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event)
|
||||||
case GUI::Event::WM_WindowIconBitmapChanged: {
|
case GUI::Event::WM_WindowIconBitmapChanged: {
|
||||||
auto& changed_event = static_cast<GUI::WMWindowIconBitmapChangedEvent&>(event);
|
auto& changed_event = static_cast<GUI::WMWindowIconBitmapChangedEvent&>(event);
|
||||||
if (auto* window = WindowList::the().window(identifier)) {
|
if (auto* window = WindowList::the().window(identifier)) {
|
||||||
if (window->button())
|
if (window->button()) {
|
||||||
window->button()->set_icon(changed_event.bitmap());
|
auto icon = changed_event.bitmap();
|
||||||
|
if (icon->height() != taskbar_icon_size() || icon->width() != taskbar_icon_size()) {
|
||||||
|
auto sw = taskbar_icon_size() / (float)icon->width();
|
||||||
|
auto sh = taskbar_icon_size() / (float)icon->height();
|
||||||
|
auto scaled_bitmap = icon->scaled(sw, sh);
|
||||||
|
window->button()->set_icon(move(scaled_bitmap));
|
||||||
|
} else {
|
||||||
|
window->button()->set_icon(icon);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ public:
|
||||||
virtual ~TaskbarWindow() override;
|
virtual ~TaskbarWindow() override;
|
||||||
|
|
||||||
static int taskbar_height() { return 27; }
|
static int taskbar_height() { return 27; }
|
||||||
|
static int taskbar_icon_size() { return 16; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
|
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue