mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:57:59 +02:00
Add keyboard to avatar browser dialog
This commit is contained in:
parent
827c2b015b
commit
d0900ec75e
1 changed files with 64 additions and 8 deletions
|
@ -10,23 +10,79 @@
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtWebEngine 1.1
|
import QtWebChannel 1.0
|
||||||
|
import QtWebEngine 1.2
|
||||||
|
|
||||||
import "../../windows" as Windows
|
import "../../windows"
|
||||||
import "../../controls-uit" as Controls
|
import "../../controls-uit"
|
||||||
import "../../styles-uit"
|
import "../../styles-uit"
|
||||||
|
|
||||||
Windows.Window {
|
Window {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
width: 900; height: 700
|
width: 900; height: 700
|
||||||
resizable: true
|
resizable: true
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
|
|
||||||
Controls.WebView {
|
property alias eventBridge: eventBridgeWrapper.eventBridge
|
||||||
id: webview
|
|
||||||
|
Item {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
|
property bool keyboardRaised: true
|
||||||
|
property bool punctuationMode: false
|
||||||
|
|
||||||
|
BaseWebView {
|
||||||
|
id: webview
|
||||||
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: keyboard.top
|
||||||
|
}
|
||||||
|
|
||||||
|
property alias eventBridgeWrapper: eventBridgeWrapper
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: eventBridgeWrapper
|
||||||
|
WebChannel.id: "eventBridgeWrapper"
|
||||||
|
property var eventBridge;
|
||||||
|
}
|
||||||
|
|
||||||
|
webChannel.registeredObjects: [eventBridgeWrapper]
|
||||||
|
|
||||||
|
// Create a global EventBridge object for raiseAndLowerKeyboard.
|
||||||
|
WebEngineScript {
|
||||||
|
id: createGlobalEventBridge
|
||||||
|
sourceCode: eventBridgeJavaScriptToInject
|
||||||
|
injectionPoint: WebEngineScript.DocumentCreation
|
||||||
|
worldId: WebEngineScript.MainWorld
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect when may want to raise and lower keyboard.
|
||||||
|
WebEngineScript {
|
||||||
|
id: raiseAndLowerKeyboard
|
||||||
|
injectionPoint: WebEngineScript.Deferred
|
||||||
|
sourceUrl: resourceDirectoryUrl + "html/raiseAndLowerKeyboard.js"
|
||||||
|
worldId: WebEngineScript.MainWorld
|
||||||
|
}
|
||||||
|
|
||||||
|
userScripts: [ createGlobalEventBridge, raiseAndLowerKeyboard ]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Keyboard {
|
||||||
|
id: keyboard
|
||||||
|
raised: parent.keyboardRaised
|
||||||
|
numeric: parent.punctuationMode
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue