Ladybird/Qt: Display an audio button on tabs that are playing audio

When audio begins playing, add a button to the left of the favicon with
a speaker icon to indicate which tab is playing audio. This button is
currently disabled, but in the future may be used to mute the tab.
This commit is contained in:
Timothy Flynn
2024-03-28 11:16:10 -04:00
committed by Andreas Kling
parent 8503bcb897
commit 18821d3509
4 changed files with 31 additions and 0 deletions

View File

@@ -389,6 +389,10 @@ Tab::Tab(BrowserWindow* window, WebContentOptions const& web_content_options, St
clipboard->setMimeData(mime_data);
};
view().on_audio_play_state_changed = [this](auto play_state) {
emit audio_play_state_changed(tab_index(), play_state);
};
auto* search_selected_text_action = new QAction("&Search for <query>", this);
search_selected_text_action->setIcon(load_icon_from_uri("resource://icons/16x16/find.png"sv));
QObject::connect(search_selected_text_action, &QAction::triggered, this, [this]() {