urlToolBarPointer = toolBar(QLatin1String("url_toolbar"));
bookmarksToolBarPointer = toolBar(QLatin1String("bookmarks_toolbar"));
+ // Set the blocked requests action pointer widget object name (required to change the background color with a style sheet).
+ urlToolBarPointer->widgetForAction(blockedRequestsActionPointer)->setObjectName("blocked_requests");
+
// Populate the view bookmarks toolbar checkbox.
connect(bookmarksToolBarPointer, SIGNAL(visibilityChanged(bool)), this, SLOT(updateViewBookmarksToolBarCheckbox(bool)));
// Update the tool tips.
blockedRequestsActionPointer->setToolTip(i18nc("Blocked requests action tool tip", "%1 Blocked Requests (Ctrl+R)", blockedRequestsVector[PrivacyWebEngineView::TOTAL]));
+
+ // Update the blocked requests action background color.
+ if (blockedRequestsVector[PrivacyWebEngineView::TOTAL] > 0)
+ urlToolBarPointer->setStyleSheet(QLatin1String("QToolButton#blocked_requests { background-color: tomato; }"));
+ else
+ urlToolBarPointer->setStyleSheet(QLatin1String("QToolButton#blocked_requests { background-color: transparent; }"));
}
void BrowserWindow::updateCookiesAction(const int numberOfCookies) const