summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-11-20 05:31:14 -0800
committerSzabolcs David <davidsz@inf.u-szeged.hu>2015-01-16 11:28:44 +0100
commitdb2f69bb58ab369e44ea8bb30dcdbe90660578a2 (patch)
treedd25a6b7561fedb8e7abc5cd61f19d74360ffaae /examples
parente57b02dc9fe39a4ac8cc56f5d09eab4452a90210 (diff)
Widgets: Implement mouse lock permission API
If the user grants the permission with mouse click on the feature permission bar, the RenderWidgetHostView loses the focus but the focus is necessary for the pointer lock. Change-Id: Ifafd86b472e400c5690194dce2ea8a829a51c313 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/browser/featurepermissionbar.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/webenginewidgets/browser/featurepermissionbar.cpp b/examples/webenginewidgets/browser/featurepermissionbar.cpp
index a47cbcd9e..1b6d446cd 100644
--- a/examples/webenginewidgets/browser/featurepermissionbar.cpp
+++ b/examples/webenginewidgets/browser/featurepermissionbar.cpp
@@ -53,15 +53,17 @@ static QString textForPermissionType(QWebEnginePage::Feature type)
{
switch (type) {
case QWebEnginePage::Notifications:
- return QObject::tr("desktop notifications");
+ return QObject::tr("use desktop notifications");
case QWebEnginePage::Geolocation:
- return QObject::tr("your position");
+ return QObject::tr("use your position");
case QWebEnginePage::MediaAudioCapture:
- return QObject::tr("your microphone");
+ return QObject::tr("use your microphone");
case QWebEnginePage::MediaVideoCapture:
- return QObject::tr("your camera");
+ return QObject::tr("use your camera");
case QWebEnginePage::MediaAudioVideoCapture:
- return QObject::tr("your camera and microphone");
+ return QObject::tr("use your camera and microphone");
+ case QWebEnginePage::MouseLock:
+ return QObject::tr("lock your mouse");
default:
Q_UNREACHABLE();
}
@@ -97,7 +99,7 @@ void FeaturePermissionBar::requestPermission(const QUrl &securityOrigin, QWebEng
{
m_securityOrigin = securityOrigin;
m_feature = feature;
- m_messageLabel->setText(tr("%1 wants to use %2.").arg(securityOrigin.host()).arg(textForPermissionType(feature)));
+ m_messageLabel->setText(tr("%1 wants to %2.").arg(securityOrigin.host()).arg(textForPermissionType(feature)));
show();
// Ease in
QPropertyAnimation *animation = new QPropertyAnimation(this);