Merge branch 'tablet-ui' of github.com:highfidelity/hifi into tablet-ui-close-tablet-upon-goto

This commit is contained in:
Seth Alves 2017-01-24 09:42:20 -08:00
commit 4de0b94b6c
16 changed files with 51 additions and 17 deletions

View file

@ -6,9 +6,7 @@
{ "from": "Standard.DL", "to": "Actions.UiNavLateral", "filters": "invert" },
{ "from": "Standard.DR", "to": "Actions.UiNavLateral" },
{ "from": "Standard.LB", "to": "Actions.UiNavGroup","filters": "invert" },
{ "from": "Standard.RB", "to": "Actions.UiNavGroup" },
{ "from": [ "Standard.A", "Standard.X" ], "to": "Actions.UiNavSelect" },
{ "from": [ "Standard.B", "Standard.Y" ], "to": "Actions.UiNavBack" }
{ "from": "Standard.RB", "to": "Actions.UiNavGroup" }
]
}

View file

@ -56,6 +56,9 @@
{ "from": "GamePad.A", "to": "Standard.A" },
{ "from": "GamePad.B", "to": "Standard.B" },
{ "from": "GamePad.X", "to": "Standard.X" },
{ "from": "GamePad.Y", "to": "Standard.Y" }
{ "from": "GamePad.Y", "to": "Standard.Y" },
{ "from": [ "Standard.A", "Standard.X" ], "to": "Actions.UiNavSelect" },
{ "from": [ "Standard.B", "Standard.Y" ], "to": "Actions.UiNavBack" }
]
}

View file

@ -151,3 +151,10 @@ void MenuScriptingInterface::closeInfoView(const QString& path) {
QMetaObject::invokeMethod(Menu::getInstance(), "closeInfoView", Q_ARG(const QString&, path));
}
bool MenuScriptingInterface::isInfoViewVisible(const QString& path) {
bool result;
QMetaObject::invokeMethod(Menu::getInstance(), "isInfoViewVisible", Qt::BlockingQueuedConnection,
Q_RETURN_ARG(bool, result), Q_ARG(const QString&, path));
return result;
}

View file

@ -183,6 +183,7 @@ public slots:
void setMenuEnabled(const QString& menuName, bool isEnabled);
void closeInfoView(const QString& path);
bool isInfoViewVisible(const QString& path);
signals:
/**jsdoc

View file

@ -32,7 +32,7 @@ void injectorFromScriptValue(const QScriptValue& object, ScriptAudioInjector*& o
ScriptAudioInjector::ScriptAudioInjector(AudioInjector* injector) :
_injector(injector)
{
QObject::connect(injector, &AudioInjector::finished, this, &ScriptAudioInjector::finished);
}
ScriptAudioInjector::~ScriptAudioInjector() {

View file

@ -130,6 +130,15 @@ void OffscreenUi::hide(const QString& name) {
}
}
bool OffscreenUi::isVisible(const QString& name) {
QQuickItem* item = getRootItem()->findChild<QQuickItem*>(name);
if (item) {
return QQmlProperty(item, OFFSCREEN_VISIBILITY_PROPERTY).read().toBool();
} else {
return false;
}
}
class ModalDialogListener : public QObject {
Q_OBJECT
friend class OffscreenUi;

View file

@ -40,6 +40,7 @@ public:
void createDesktop(const QUrl& url);
void show(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
void hide(const QString& name);
bool isVisible(const QString& name);
void toggle(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
bool shouldSwallowShortcut(QEvent* event);
bool navigationFocused();

View file

@ -261,6 +261,11 @@ void Menu::closeInfoView(const QString& path) {
offscreenUi->hide(path);
}
bool Menu::isInfoViewVisible(const QString& path) {
auto offscreenUi = DependencyManager::get<OffscreenUi>();
return offscreenUi->isVisible(path);
}
void Menu::triggerOption(const QString& menuOption) {
QAction* action = _actionHash.value(menuOption);
if (action) {

View file

@ -115,6 +115,7 @@ public slots:
void toggleDeveloperMenus();
void toggleAdvancedMenus();
bool isInfoViewVisible(const QString& path);
void closeInfoView(const QString& path);
void triggerOption(const QString& menuOption);

View file

@ -1549,7 +1549,7 @@ var PropertiesTool = function (opts) {
Camera.cameraEntity = selectionManager.selections[0];
}
} else if (data.action === "rescaleDimensions") {
var multiplier = data.percentage / 100;
var multiplier = data.percentage / 100.0;
if (selectionManager.hasSelection()) {
selectionManager.saveProperties();
for (i = 0; i < selectionManager.selections.length; i++) {

View file

@ -14,7 +14,6 @@
(function() { // BEGIN LOCAL_SCOPE
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
var isActive = false
var button = tablet.addButton({
icon: "icons/tablet-icons/goto-i.svg",
text:"GOTO"
@ -22,14 +21,13 @@ var button = tablet.addButton({
function onAddressBarShown(visible) {
button.editProperties({isActive: visible});
}
function setActive(active) {
isActive = active;
}
function onClicked(){
setActive(!isActive);
button.editProperties({isActive: isActive});
DialogsManager.toggleAddressBar();
}
button.clicked.connect(onClicked);

View file

@ -53,7 +53,17 @@
button.clicked.connect(onClicked);
var POLL_RATE = 500;
var interval = Script.setInterval(function () {
var visible = Menu.isInfoViewVisible('InfoView_html/help.html');
if (visible !== enabled) {
enabled = visible;
button.editProperties({isActive: enabled});
}
}, POLL_RATE);
Script.scriptEnding.connect(function () {
Script.clearInterval(interval);
tablet.removeButton(button);
});

View file

@ -593,7 +593,7 @@ hr {
.dropdown dl {
font-family: FiraSans-SemiBold;
font-size: 15px;
width: 172px;
width: 292px;
height: 28px;
padding: 0 28px 0 12px;
color: #afafaf;
@ -645,7 +645,7 @@ hr {
.dropdown li {
list-style-type: none;
padding: 3px 0 1px 12px;
width: 200px;
width: 320px;
height: auto;
font-family: FiraSans-SemiBold;
font-size: 15px;

View file

@ -328,13 +328,13 @@
<div class="model-group model-section zone-section property dropdown">
<label>Collision shape type</label>
<select name="SelectShapeType" id="property-shape-type">
<option value="none">None</option>
<option value="none">No Collision</option>
<option value="box">Box</option>
<option value="sphere">Sphere</option>
<option value="compound">Compound</option>
<option value="simple-hull">One Hull</option>
<option value="simple-compound">Hull Per Submesh</option>
<option value="static-mesh">Static Mesh</option>
<option value="simple-hull">Basic - Whole model</option>
<option value="simple-compound">Good - Sub-meshes</option>
<option value="static-mesh">Exact - All polygons (non-dynamic only)</option>
</select>
</div>
<div class="model-group model-section zone-section property url ">

View file

@ -1392,7 +1392,7 @@ function loaded() {
EventBridge.emitWebEvent(JSON.stringify({
type: "action",
action: "rescaleDimensions",
percentage: parseInt(elRescaleDimensionsPct.value),
percentage: parseFloat(elRescaleDimensionsPct.value),
}));
});
elReloadScriptButton.addEventListener("click", function() {

View file

@ -64,9 +64,10 @@ function calcSpawnInfo(hand, height) {
} else {
var front = Quat.getFront(Camera.orientation);
finalPosition = Vec3.sum(Camera.position, Vec3.multiply(0.6, front));
var orientation = Quat.lookAt({x: 0, y: 0, z: 0}, front, {x: 0, y: 1, z: 0});
return {
position: finalPosition,
rotation: Quat.multiply(Camera.orientation, {x: 0, y: 1, z: 0, w: 0})
rotation: Quat.multiply(orientation, {x: 0, y: 1, z: 0, w: 0})
};
}
}