mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibWeb+UI: Add internals API to set browser zoom
This commit is contained in:
parent
f39433d6b0
commit
5cc9a5802d
Notes:
github-actions[bot]
2025-01-21 15:12:32 +00:00
Author: https://github.com/InvalidUsernameException
Commit: 5cc9a5802d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2982
Reviewed-by: https://github.com/AtkinsSJ
17 changed files with 78 additions and 3 deletions
|
@ -229,6 +229,7 @@ void PageClient::set_viewport_size(Web::DevicePixelSize const& size)
|
|||
|
||||
m_backing_store_manager.restart_resize_timer();
|
||||
m_backing_store_manager.resize_backing_stores_if_needed(BackingStoreManager::WindowResizingInProgress::Yes);
|
||||
m_pending_set_browser_zoom_request = false;
|
||||
}
|
||||
|
||||
void PageClient::page_did_request_cursor_change(Gfx::StandardCursor cursor)
|
||||
|
@ -371,6 +372,17 @@ void PageClient::page_did_set_test_timeout(double milliseconds)
|
|||
client().async_did_set_test_timeout(m_id, milliseconds);
|
||||
}
|
||||
|
||||
void PageClient::page_did_set_browser_zoom(double factor)
|
||||
{
|
||||
m_pending_set_browser_zoom_request = true;
|
||||
client().async_did_set_browser_zoom(m_id, factor);
|
||||
|
||||
auto& event_loop = Web::HTML::main_thread_event_loop();
|
||||
event_loop.spin_until(GC::create_function(event_loop.heap(), [&]() {
|
||||
return !m_pending_set_browser_zoom_request || !is_connection_open();
|
||||
}));
|
||||
}
|
||||
|
||||
void PageClient::page_did_request_context_menu(Web::CSSPixelPoint content_position)
|
||||
{
|
||||
client().async_did_request_context_menu(m_id, page().css_to_device_point(content_position).to_type<int>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue