1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:47:35 +00:00

Ladybird/WebView: Plumb visibility state changes from Qt to LibWeb

This commit is contained in:
Andreas Kling 2022-09-19 20:56:19 +02:00 committed by Andrew Kaster
parent d007160ad6
commit 561303829e
2 changed files with 15 additions and 0 deletions

View file

@ -587,3 +587,15 @@ void WebView::set_color_scheme(ColorScheme color_scheme)
if (auto* document = m_page_client->page().top_level_browsing_context().active_document())
document->invalidate_style();
}
void WebView::showEvent(QShowEvent* event)
{
QAbstractScrollArea::showEvent(event);
m_page_client->page().top_level_browsing_context().set_system_visibility_state(Web::HTML::VisibilityState::Visible);
}
void WebView::hideEvent(QHideEvent* event)
{
QAbstractScrollArea::hideEvent(event);
m_page_client->page().top_level_browsing_context().set_system_visibility_state(Web::HTML::VisibilityState::Hidden);
}