aboutsummaryrefslogtreecommitdiff
path: root/src/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/webview.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/webengine/webview.cpp b/src/webengine/webview.cpp
index 25f7b70..d7281e9 100644
--- a/src/webengine/webview.cpp
+++ b/src/webengine/webview.cpp
@@ -145,8 +145,6 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
});
buttonsLayout->addWidget(forwardButton);
- buttonsLayout->addStretch();
-
auto *refreshButton = new QToolButton(this);
refreshButton->setIcon(style()->standardIcon(QStyle::SP_BrowserReload));
connect(refreshButton, &QToolButton::clicked, this, [this, menu]() {
@@ -155,6 +153,21 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
});
buttonsLayout->addWidget(refreshButton);
+ buttonsLayout->addStretch();
+
+ auto *muteButton = new QToolButton(this);
+ muteButton->setCheckable(true);
+ muteButton->setChecked(this->page()->isAudioMuted());
+ QIcon muteIcon;
+ muteIcon.addPixmap(style()->standardPixmap(QStyle::SP_MediaVolume), QIcon::Normal, QIcon::Off);
+ muteIcon.addPixmap(style()->standardPixmap(QStyle::SP_MediaVolumeMuted), QIcon::Normal, QIcon::On);
+ muteButton->setIcon(muteIcon);
+ connect(muteButton, &QToolButton::clicked, this, [this, menu](bool checked) {
+ this->page()->setAudioMuted(checked);
+ menu->close();
+ });
+ buttonsLayout->addWidget(muteButton);
+
buttons->setLayout(buttonsLayout);
navButtons->setDefaultWidget(buttons);