summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2018-02-12 12:14:46 +0100
committerKai Koehne <kai.koehne@qt.io>2018-03-06 07:26:50 +0000
commit2b77016013a1cc05fc4f02a171dfb1a21353c296 (patch)
tree6a8739893b3e01375f56e33320260267670468e4 /examples
parent027d7f61078ffc95df84fce73ec935ebf67ed8c3 (diff)
downloadqtwebengine-2b77016013a1cc05fc4f02a171dfb1a21353c296.tar.gz
Add ninja icon to simplebrowser
Task-number: QTBUG-65944 Change-Id: Ie30f2088ca3be90a75d3592433f0c6cf56381dde Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/simplebrowser/data/ninja.pngbin0 -> 1671 bytes
-rw-r--r--examples/webenginewidgets/simplebrowser/data/simplebrowser.qrc1
-rw-r--r--examples/webenginewidgets/simplebrowser/tabwidget.cpp9
3 files changed, 10 insertions, 0 deletions
diff --git a/examples/webenginewidgets/simplebrowser/data/ninja.png b/examples/webenginewidgets/simplebrowser/data/ninja.png
new file mode 100644
index 000000000..e5d7b6fd7
--- /dev/null
+++ b/examples/webenginewidgets/simplebrowser/data/ninja.png
Binary files differ
diff --git a/examples/webenginewidgets/simplebrowser/data/simplebrowser.qrc b/examples/webenginewidgets/simplebrowser/data/simplebrowser.qrc
index ec8716721..d81b08a64 100644
--- a/examples/webenginewidgets/simplebrowser/data/simplebrowser.qrc
+++ b/examples/webenginewidgets/simplebrowser/data/simplebrowser.qrc
@@ -9,5 +9,6 @@
<file>process-stop.png</file>
<file>text-html.png</file>
<file>view-refresh.png</file>
+ <file>ninja.png</file>
</qresource>
</RCC>
diff --git a/examples/webenginewidgets/simplebrowser/tabwidget.cpp b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
index 8b458a9af..369bebfd9 100644
--- a/examples/webenginewidgets/simplebrowser/tabwidget.cpp
+++ b/examples/webenginewidgets/simplebrowser/tabwidget.cpp
@@ -51,6 +51,7 @@
#include "tabwidget.h"
#include "webpage.h"
#include "webview.h"
+#include <QLabel>
#include <QMenu>
#include <QTabBar>
#include <QWebEngineProfile>
@@ -75,6 +76,14 @@ TabWidget::TabWidget(QWebEngineProfile *profile, QWidget *parent)
setElideMode(Qt::ElideRight);
connect(this, &QTabWidget::currentChanged, this, &TabWidget::handleCurrentChanged);
+
+ if (profile->isOffTheRecord()) {
+ QLabel *icon = new QLabel(this);
+ QPixmap pixmap(QStringLiteral(":ninja.png"));
+ icon->setPixmap(pixmap.scaledToHeight(tabBar->height()));
+ setStyleSheet(QStringLiteral("QTabWidget::tab-bar { left: %1px; }").
+ arg(icon->pixmap()->width()));
+ }
}
void TabWidget::handleCurrentChanged(int index)