LibWebView: Disable autocomplete when search is disabled

Search suggestions don't make much sense when search itself is disabled.
We now auto-disable autocomplete when search is disabled.
This commit is contained in:
Timothy Flynn 2025-05-11 09:05:37 -04:00 committed by Tim Flynn
parent 9267172e28
commit 1a9e78a774
Notes: github-actions[bot] 2025-05-11 15:48:59 +00:00
3 changed files with 13 additions and 5 deletions

View file

@ -120,10 +120,14 @@ void SettingsUI::load_available_engines()
void SettingsUI::set_search_engine(JsonValue const& search_engine)
{
if (search_engine.is_null())
if (search_engine.is_null()) {
WebView::Application::settings().set_search_engine({});
else if (search_engine.is_string())
WebView::Application::settings().set_autocomplete_engine({});
} else if (search_engine.is_string()) {
WebView::Application::settings().set_search_engine(search_engine.as_string());
}
load_current_settings();
}
void SettingsUI::add_custom_search_engine(JsonValue const& search_engine)