mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:17:35 +00:00
parent
182f9582d2
commit
863bc35399
3 changed files with 24 additions and 2 deletions
|
@ -152,11 +152,29 @@ void AppletManager::relayout()
|
|||
if (m_window->rect() == rect)
|
||||
return;
|
||||
m_window->set_rect(rect);
|
||||
|
||||
repaint();
|
||||
|
||||
WindowManager::the().tell_wm_listeners_applet_area_size_changed(rect.size());
|
||||
}
|
||||
|
||||
void AppletManager::repaint()
|
||||
{
|
||||
if (!m_window) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto rect = Gfx::IntRect { { 0, 0 }, m_window->size() };
|
||||
|
||||
if (!rect.is_empty()) {
|
||||
Gfx::Painter painter(*m_window->backing_store());
|
||||
painter.fill_rect({ { 0, 0 }, rect.size() }, WindowManager::the().palette().window());
|
||||
painter.fill_rect(rect, WindowManager::the().palette().window());
|
||||
}
|
||||
WindowManager::the().tell_wm_listeners_applet_area_size_changed(rect.size());
|
||||
}
|
||||
|
||||
void AppletManager::did_change_theme()
|
||||
{
|
||||
repaint();
|
||||
}
|
||||
|
||||
void AppletManager::remove_applet(Window& applet)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue