overte/interface/resources/qml/controls/TabletWebScreen.qml
Alexander Ivash 740123b853 rename stylues-uit => stylesUit & controls-uit => controlsUit
note:
the idea is to make imports like 'import controlsUit 1.0' to work
with 'styles-uit'/'controls-uit' it is not possible because of two reasons:

1. import controls-uit 1.0 is invalid syntax
2. qmldir inside controls-uit is 'module controlsUit'
2018-10-18 21:05:20 +03:00

62 lines
1.9 KiB
QML

import QtQuick 2.7
import controlsUit 1.0 as HiFiControls
Item {
id: root
property alias url: webroot.url
property alias scriptURL: webroot.userScriptUrl
property alias canGoBack: webroot.canGoBack;
property var goBack: webroot.webViewCore.goBack;
property alias urlTag: webroot.urlTag
property bool keyboardEnabled: true // FIXME - Keyboard HMD only: Default to false
property bool keyboardRaised: false
onKeyboardRaisedChanged: {
if(!keyboardRaised) {
webroot.unfocus();
}
}
property bool punctuationMode: false
// FIXME - Keyboard HMD only: Make Interface either set keyboardRaised property directly in OffscreenQmlSurface
// or provide HMDinfo object to QML in RenderableWebEntityItem and do the following.
/*
onKeyboardRaisedChanged: {
keyboardEnabled = HMDinfo.active;
}
*/
property alias viewProfile: webroot.webViewCoreProfile
FlickableWebViewCore {
id: webroot
width: parent.width
height: keyboardEnabled && keyboardRaised ? parent.height - keyboard.height : parent.height
onLoadingChangedCallback: {
keyboardRaised = false;
punctuationMode = false;
keyboard.resetShiftMode(false);
}
onNewViewRequestedCallback: {
// desktop is not defined for web-entities or tablet
if (typeof desktop !== "undefined") {
desktop.openBrowserWindow(request, webViewCoreProfile);
} else {
tabletRoot.openBrowserWindow(request, webViewCoreProfile);
}
}
}
HiFiControls.Keyboard {
id: keyboard
raised: parent.keyboardEnabled && parent.keyboardRaised
numeric: parent.punctuationMode
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
}
}
}