mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 14:12:50 +02:00
more wip on adding qml to adjusting ui position
This commit is contained in:
parent
cb715c3e55
commit
6cf8b06c6d
2 changed files with 50 additions and 0 deletions
37
interface/resources/qml/hifi/EditAvatarInputsBar.qml
Normal file
37
interface/resources/qml/hifi/EditAvatarInputsBar.qml
Normal file
|
@ -0,0 +1,37 @@
|
|||
//
|
||||
// EditAvatarInputsBar.qml
|
||||
// qml/hifi
|
||||
//
|
||||
// Audio setup
|
||||
//
|
||||
// Created by Wayne Chen on 3/20/2019
|
||||
// Copyright 2019 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.7
|
||||
import QtQuick.Controls 2.2
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import stylesUit 1.0
|
||||
import controlsUit 1.0 as HifiControlsUit
|
||||
import "../windows"
|
||||
|
||||
Rectangle {
|
||||
id: editRect
|
||||
|
||||
HifiConstants { id: hifi; }
|
||||
|
||||
color: hifi.colors.baseGray;
|
||||
|
||||
signal sendToScript(var message);
|
||||
function emitSendToScript(message) {
|
||||
sendToScript(message);
|
||||
}
|
||||
|
||||
function fromScript(message) {
|
||||
}
|
||||
|
||||
}
|
|
@ -1,12 +1,20 @@
|
|||
"use strict";
|
||||
|
||||
(function(){
|
||||
var AppUi = Script.require("appUi");
|
||||
|
||||
var ui;
|
||||
|
||||
var button;
|
||||
var buttonName = "AVBAR";
|
||||
var onCreateAvatarInputsBarEntity = false;
|
||||
var micBarEntity, bubbleIconEntity;
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
var AVATAR_INPUTS_EDIT_QML_SOURCE = "hifi/EditAvatarInputsBar.qml";
|
||||
|
||||
function fromQml(message) {
|
||||
console.log("message from QML: " + JSON.stringify(message));
|
||||
};
|
||||
|
||||
function onClicked(){
|
||||
onCreateAvatarInputsBarEntity = !onCreateAvatarInputsBarEntity;
|
||||
|
@ -24,6 +32,7 @@
|
|||
if (onCreateAvatarInputsBarEntity) {
|
||||
var props = {
|
||||
type: "Web",
|
||||
name: "AvatarInputsMicBarEntity",
|
||||
parentID: MyAvatar.SELF_ID,
|
||||
parentJointIndex: MyAvatar.getJointIndex("_CAMERA_MATRIX"),
|
||||
localPosition: micBarLocalPosition,
|
||||
|
@ -32,6 +41,7 @@
|
|||
// cutoff alpha for detecting transparency
|
||||
alpha: 0.98,
|
||||
dimensions: MIC_BAR_DIMENSIONS,
|
||||
drawInFront: true,
|
||||
userData: {
|
||||
grabbable: false
|
||||
},
|
||||
|
@ -39,6 +49,7 @@
|
|||
micBarEntity = Entities.addEntity(props, "local");
|
||||
var props = {
|
||||
type: "Web",
|
||||
name: "AvatarInputsBubbleIconEntity",
|
||||
parentID: MyAvatar.SELF_ID,
|
||||
parentJointIndex: MyAvatar.getJointIndex("_CAMERA_MATRIX"),
|
||||
localPosition: bubbleIconLocalPosition,
|
||||
|
@ -47,11 +58,13 @@
|
|||
// cutoff alpha for detecting transparency
|
||||
alpha: 0.98,
|
||||
dimensions: BUBBLE_ICON_DIMENSIONS,
|
||||
drawInFront: true,
|
||||
userData: {
|
||||
grabbable: false
|
||||
},
|
||||
};
|
||||
bubbleIconEntity = Entities.addEntity(props, "local");
|
||||
tablet.loadQMLSource(AVATAR_INPUTS_EDIT_QML_SOURCE);
|
||||
} else {
|
||||
Entities.deleteEntity(micBarEntity);
|
||||
Entities.deleteEntity(bubbleIconEntity);
|
||||
|
|
Loading…
Reference in a new issue