mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
UI: Add an option to enable autoplay globally
This commit is contained in:
committed by
Tim Ledbetter
parent
973f774e56
commit
63632159ce
@@ -103,6 +103,12 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, IsPopupWindow
|
||||
});
|
||||
});
|
||||
|
||||
QObject::connect(Settings::the(), &Settings::enable_autoplay_changed, this, [this](bool enable) {
|
||||
for_each_tab([enable](auto& tab) {
|
||||
tab.set_enable_autoplay(enable);
|
||||
});
|
||||
});
|
||||
|
||||
QObject::connect(Settings::the(), &Settings::preferred_languages_changed, this, [this](QStringList languages) {
|
||||
Vector<String> preferred_languages;
|
||||
preferred_languages.ensure_capacity(languages.length());
|
||||
@@ -818,6 +824,7 @@ void BrowserWindow::initialize_tab(Tab* tab)
|
||||
tab->set_preferred_languages(preferred_languages);
|
||||
tab->set_navigator_compatibility_mode(navigator_compatibility_mode());
|
||||
tab->set_enable_do_not_track(Settings::the()->enable_do_not_track());
|
||||
tab->set_enable_autoplay(WebView::Application::web_content_options().enable_autoplay == WebView::EnableAutoplay::Yes || Settings::the()->enable_autoplay());
|
||||
tab->view().set_preferred_color_scheme(m_preferred_color_scheme);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user