From 67ca76baa1f2abb85b3b634a4ce8cac5e306e55e Mon Sep 17 00:00:00 2001 From: vladest Date: Thu, 4 Jan 2018 23:11:42 +0100 Subject: [PATCH 1/4] Magninfication --- .../resources/qml/hifi/tablet/TabletHome.qml | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/TabletHome.qml b/interface/resources/qml/hifi/tablet/TabletHome.qml index e934f18ab6..d643574810 100644 --- a/interface/resources/qml/hifi/tablet/TabletHome.qml +++ b/interface/resources/qml/hifi/tablet/TabletHome.qml @@ -127,9 +127,15 @@ Item { GridView { id: gridView + keyNavigationEnabled: false highlightFollowsCurrentItem: false + property int previousGridIndex: -1 + + // true if any of the buttons contains mouse + property bool containsMouse: false + anchors { fill: parent topMargin: 20 @@ -162,15 +168,29 @@ Item { flow: GridView.LeftToRight model: page.proxyModel - delegate: Item { + delegate: Control { id: wrapper width: gridView.cellWidth height: gridView.cellHeight + hoverEnabled: true + + property bool containsMouse: gridView.containsMouse + onHoveredChanged: { + if (hovered && !gridView.containsMouse) { + gridView.containsMouse = true + } else { + gridView.containsMouse = false + } + } + property var proxy: modelData TabletButton { id: tabletButton + scale: wrapper.hovered ? 1.25 : wrapper.containsMouse ? 0.75 : 1.0 + Behavior on scale { NumberAnimation { duration: 200; easing.type: Easing.Linear } } + anchors.centerIn: parent gridView: wrapper.GridView.view buttonIndex: page.proxyModel.buttonIndex(uuid); From f563b8ca2ec479cc335b485aafa3e4a7d686c0a4 Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Fri, 5 Jan 2018 17:49:43 -0800 Subject: [PATCH 2/4] Make zones and lights not default grabbable --- scripts/system/edit.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index e28f877d85..4ffccb3383 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -239,6 +239,7 @@ var toolBar = (function () { var dimensions = properties.dimensions ? properties.dimensions : DEFAULT_DIMENSIONS; var position = getPositionToCreateEntity(); var entityID = null; + if (position !== null && position !== undefined) { var direction; if (Camera.mode === "entity" || Camera.mode === "independent") { @@ -281,6 +282,12 @@ var toolBar = (function () { if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM)) { properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } }); } + + if (properties.type === "Zone" || properties.type === "Light") { + properties.userData = JSON.stringify({ grabbableKey: { grabbable: false } }); + properties.dynamic = false; + } + entityID = Entities.addEntity(properties); if (properties.type === "ParticleEffect") { From 4e582975b651ed7ca90f41cc279d2b7a5cb2f7fe Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Fri, 5 Jan 2018 18:03:20 -0800 Subject: [PATCH 3/4] cleanup --- scripts/system/edit.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 4ffccb3383..813dc4ae5b 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -279,13 +279,11 @@ var toolBar = (function () { position = grid.snapToSurface(grid.snapToGrid(position, false, dimensions), dimensions); properties.position = position; - if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM)) { + if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM) && + !(properties.type === "Zone" || properties.type === "Light")) { properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } }); - } - - if (properties.type === "Zone" || properties.type === "Light") { + } else { properties.userData = JSON.stringify({ grabbableKey: { grabbable: false } }); - properties.dynamic = false; } entityID = Entities.addEntity(properties); From d1e176ee9d236350a13288505f009572601f9508 Mon Sep 17 00:00:00 2001 From: Liv Erickson Date: Mon, 8 Jan 2018 11:31:09 -0800 Subject: [PATCH 4/4] Update menu to reflect non-grabbable entity types, include particles --- scripts/system/edit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 813dc4ae5b..5fb75748d5 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -225,7 +225,7 @@ function adjustPositionPerBoundingBox(position, direction, registration, dimensi var TOOLS_PATH = Script.resolvePath("assets/images/tools/"); var GRABBABLE_ENTITIES_MENU_CATEGORY = "Edit"; -var GRABBABLE_ENTITIES_MENU_ITEM = "Create Entities As Grabbable"; +var GRABBABLE_ENTITIES_MENU_ITEM = "Create Entities As Grabbable (except Zones, Particles, and Lights)"; var toolBar = (function () { var EDIT_SETTING = "io.highfidelity.isEditing"; // for communication with other scripts @@ -280,7 +280,7 @@ var toolBar = (function () { position = grid.snapToSurface(grid.snapToGrid(position, false, dimensions), dimensions); properties.position = position; if (Menu.isOptionChecked(GRABBABLE_ENTITIES_MENU_ITEM) && - !(properties.type === "Zone" || properties.type === "Light")) { + !(properties.type === "Zone" || properties.type === "Light" || properties.type === "ParticleEffect")) { properties.userData = JSON.stringify({ grabbableKey: { grabbable: true } }); } else { properties.userData = JSON.stringify({ grabbableKey: { grabbable: false } });