mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:37:35 +02:00
Implement avatar browser for tablet avatar settings
This commit is contained in:
parent
2e96b8a59b
commit
f3a99a2437
2 changed files with 99 additions and 6 deletions
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
|
|
||||||
import "../../dialogs"
|
|
||||||
import "../../controls-uit"
|
import "../../controls-uit"
|
||||||
|
import "../../hifi/tablet/tabletWindows/preferences"
|
||||||
|
|
||||||
Preference {
|
Preference {
|
||||||
id: root
|
id: root
|
||||||
|
@ -82,12 +82,26 @@ Preference {
|
||||||
verticalCenter: dataTextField.verticalCenter
|
verticalCenter: dataTextField.verticalCenter
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
// Load dialog via OffscreenUi so that JavaScript EventBridge is available.
|
if (typeof desktop !== "undefined") {
|
||||||
root.browser = OffscreenUi.load("dialogs/preferences/AvatarBrowser.qml");
|
// Load dialog via OffscreenUi so that JavaScript EventBridge is available.
|
||||||
root.browser.windowDestroyed.connect(function(){
|
root.browser = OffscreenUi.load("dialogs/preferences/AvatarBrowser.qml");
|
||||||
root.browser = null;
|
root.browser.windowDestroyed.connect(function(){
|
||||||
});
|
root.browser = null;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
root.browser = tabletAvatarBrowserBuilder.createObject(tabletRoot, {
|
||||||
|
createGlobalEventBridgeSource: eventBridgeJavaScriptToInject
|
||||||
|
});
|
||||||
|
|
||||||
|
// Make dialog modal.
|
||||||
|
tabletRoot.openModal = root.browser;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: tabletAvatarBrowserBuilder;
|
||||||
|
TabletAvatarBrowser { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
//
|
||||||
|
// TabletAvatarBrowser.qml
|
||||||
|
//
|
||||||
|
// Created by David Rowe on 14 Mar 2017
|
||||||
|
// Copyright 2017 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import QtWebChannel 1.0
|
||||||
|
import QtWebEngine 1.2
|
||||||
|
|
||||||
|
import "../../../../windows"
|
||||||
|
import "../../../../controls-uit"
|
||||||
|
import "../../../../styles-uit"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
objectName: "ModelBrowserDialog"
|
||||||
|
|
||||||
|
property string title: "Attachment Model"
|
||||||
|
|
||||||
|
property var result
|
||||||
|
|
||||||
|
signal selected(var modelUrl)
|
||||||
|
signal canceled()
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
/*
|
||||||
|
Rectangle {
|
||||||
|
id: pane // Surrogate for ScrollingWindow's pane.
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
BaseWebView {
|
||||||
|
id: webview
|
||||||
|
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
||||||
|
focus: true
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: footer.top
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: footer
|
||||||
|
height: 40
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
right: parent.right
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
color: hifi.colors.baseGray
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: hifi.dimensions.contentMargin.x
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Cancel"
|
||||||
|
color: hifi.buttons.white
|
||||||
|
onClicked: root.destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue