mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 23:19:44 +00:00
LibWebView: Add defaultZoomLevelFactor setting and necessary plumbing
This commit is contained in:
parent
73266c8498
commit
333164ecf9
Notes:
github-actions[bot]
2025-08-26 10:32:48 +00:00
Author: https://github.com/rmg-x
Commit: 333164ecf9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5969
Reviewed-by: https://github.com/trflynn89
6 changed files with 45 additions and 0 deletions
|
@ -24,6 +24,9 @@ void SettingsUI::register_interfaces()
|
|||
register_interface("setNewTabPageURL"sv, [this](auto const& data) {
|
||||
set_new_tab_page_url(data);
|
||||
});
|
||||
register_interface("setDefaultZoomLevelFactor"sv, [this](auto const& data) {
|
||||
set_default_zoom_level_factor(data);
|
||||
});
|
||||
register_interface("setLanguages"sv, [this](auto const& data) {
|
||||
set_languages(data);
|
||||
});
|
||||
|
@ -93,6 +96,15 @@ void SettingsUI::set_new_tab_page_url(JsonValue const& new_tab_page_url)
|
|||
WebView::Application::settings().set_new_tab_page_url(parsed_new_tab_page_url.release_value());
|
||||
}
|
||||
|
||||
void SettingsUI::set_default_zoom_level_factor(JsonValue const& default_zoom_level_factor)
|
||||
{
|
||||
auto const maybe_factor = default_zoom_level_factor.get_double_with_precision_loss();
|
||||
if (!maybe_factor.has_value())
|
||||
return;
|
||||
|
||||
WebView::Application::settings().set_default_zoom_level_factor(maybe_factor.value());
|
||||
}
|
||||
|
||||
void SettingsUI::set_languages(JsonValue const& languages)
|
||||
{
|
||||
auto parsed_languages = Settings::parse_json_languages(languages);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue