mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
parent
eca74088a0
commit
5e823d3de0
Notes:
sideshowbarker
2024-07-18 09:26:01 +09:00
Author: https://github.com/luk1337 Commit: https://github.com/SerenityOS/serenity/commit/5e823d3de04 Pull-request: https://github.com/SerenityOS/serenity/pull/8607 Issue: https://github.com/SerenityOS/serenity/issues/5806 Reviewed-by: https://github.com/linusg
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: {
|
||||
auto& changed_event = static_cast<GUI::WMWindowIconBitmapChangedEvent&>(event);
|
||||
if (auto* window = WindowList::the().window(identifier)) {
|
||||
if (window->button())
|
||||
window->button()->set_icon(changed_event.bitmap());
|
||||
if (window->button()) {
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ public:
|
|||
virtual ~TaskbarWindow() override;
|
||||
|
||||
static int taskbar_height() { return 27; }
|
||||
static int taskbar_icon_size() { return 16; }
|
||||
|
||||
private:
|
||||
explicit TaskbarWindow(NonnullRefPtr<GUI::Menu> start_menu);
|
||||
|
|
Loading…
Reference in a new issue