From 6f506d602301e9aa221613fb8a2b584be859404c Mon Sep 17 00:00:00 2001 From: Faye Li Date: Mon, 13 Feb 2017 14:40:45 -0800 Subject: [PATCH 1/8] some attempts to get icons in create tab --- interface/resources/images/sphere-01.svg | 108 +++++++++++++++++++ interface/resources/qml/hifi/tablet/Edit.qml | 46 ++++---- 2 files changed, 135 insertions(+), 19 deletions(-) create mode 100644 interface/resources/images/sphere-01.svg diff --git a/interface/resources/images/sphere-01.svg b/interface/resources/images/sphere-01.svg new file mode 100644 index 0000000000..975199c8da --- /dev/null +++ b/interface/resources/images/sphere-01.svg @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 44959395fa..5301ff78f8 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -4,6 +4,7 @@ import QtWebEngine 1.1 import QtWebChannel 1.0 import QtQuick.Controls.Styles 1.4 import "../../controls" +import "../toolbars" import HFWebEngineProfile 1.0 StackView { @@ -41,9 +42,17 @@ StackView { Flow { id: createEntitiesFlow spacing: 16 + anchors.right: parent.right + anchors.rightMargin: 30 + anchors.left: parent.left + anchors.leftMargin: 30 + anchors.bottom: parent.bottom + anchors.bottomMargin: 30 + anchors.top: parent.top + anchors.topMargin: 30 - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/assets-01.svg" + TabletButton { + icon: "icons/assets-01.svg" text: "ASSETS" onClicked: { editRoot.sendToScript({ @@ -52,8 +61,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/model-01.svg" + TabletButton { + icon: "model-01.svg" text: "MODEL" onClicked: { editRoot.sendToScript({ @@ -62,8 +71,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/cube-01.svg" + TabletButton { + icon: "../cube-01.svg" text: "CUBE" onClicked: { editRoot.sendToScript({ @@ -72,9 +81,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/sphere-01.svg" - text: "SPHERE" + ToolbarButton { + imageURL: "../images/sphere-01.svg" onClicked: { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newSphereButton" } @@ -82,8 +90,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/light-01.svg" + TabletButton { + icon: "../scripts/system/assets/images/tools/light-01.svg" text: "LIGHT" onClicked: { editRoot.sendToScript({ @@ -92,8 +100,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/text-01.svg" + TabletButton { + icon: "../scripts/system/assets/images/tools/text-01.svg" text: "TEXT" onClicked: { editRoot.sendToScript({ @@ -102,8 +110,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/web-01.svg" + TabletButton { + icon: "../scripts/system/assets/images/tools/web-01.svg" text: "WEB" onClicked: { editRoot.sendToScript({ @@ -112,8 +120,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/zone-01.svg" + TabletButton { + icon: "../scripts/system/assets/images/tools/zone-01.svg" text: "ZONE" onClicked: { editRoot.sendToScript({ @@ -122,8 +130,8 @@ StackView { } } - Button { - iconSource: "../../../../../scripts/system/assets/images/tools/particle-01.svg" + TabletButton { + icon: "../scripts/system/assets/images/tools/particle-01.svg" text: "PARTICLE" onClicked: { editRoot.sendToScript({ From 88318c1911f522925c81ab6f3fa3df6b92021bb2 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 11:40:26 -0800 Subject: [PATCH 2/8] create tab background and new entity buttons --- interface/resources/qml/hifi/tablet/Edit.qml | 169 ++++++++------- .../qml/hifi/tablet/NewEntityButton.qml | 204 ++++++++++++++++++ 2 files changed, 291 insertions(+), 82 deletions(-) create mode 100644 interface/resources/qml/hifi/tablet/NewEntityButton.qml diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 5301ff78f8..4a5930e6e7 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -39,106 +39,111 @@ StackView { enabled: true property string originalUrl: "" - Flow { - id: createEntitiesFlow - spacing: 16 - anchors.right: parent.right - anchors.rightMargin: 30 - anchors.left: parent.left - anchors.leftMargin: 30 - anchors.bottom: parent.bottom - anchors.bottomMargin: 30 - anchors.top: parent.top - anchors.topMargin: 30 + Rectangle { + color: "#383838" + Flow { + id: createEntitiesFlow + spacing: 35 + anchors.right: parent.right + anchors.rightMargin: 55 + anchors.left: parent.left + anchors.leftMargin: 55 + anchors.bottom: parent.bottom + anchors.bottomMargin: 30 + anchors.top: parent.top + anchors.topMargin: 70 - TabletButton { - icon: "icons/assets-01.svg" - text: "ASSETS" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "openAssetBrowserButton" } - }); + NewEntityButton { + icon: "icons/assets-01.svg" + text: "ASSETS" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "openAssetBrowserButton" } + }); + } } - } - TabletButton { - icon: "model-01.svg" - text: "MODEL" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newModelButton" } - }); + NewEntityButton { + icon: "model-01.svg" + text: "MODEL" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newModelButton" } + }); + } } - } - TabletButton { - icon: "../cube-01.svg" - text: "CUBE" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newCubeButton" } - }); + NewEntityButton { + icon: "../cube-01.svg" + text: "CUBE" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newCubeButton" } + }); + } } - } - ToolbarButton { - imageURL: "../images/sphere-01.svg" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newSphereButton" } - }); + NewEntityButton { + icon: "../images/sphere-01.svg" + text: "SPHERE" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newSphereButton" } + }); + } } - } - TabletButton { - icon: "../scripts/system/assets/images/tools/light-01.svg" - text: "LIGHT" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newLightButton" } - }); + NewEntityButton { + icon: "../scripts/system/assets/images/tools/light-01.svg" + text: "LIGHT" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newLightButton" } + }); + } } - } - TabletButton { - icon: "../scripts/system/assets/images/tools/text-01.svg" - text: "TEXT" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newTextButton" } - }); + NewEntityButton { + icon: "../scripts/system/assets/images/tools/text-01.svg" + text: "TEXT" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newTextButton" } + }); + } } - } - TabletButton { - icon: "../scripts/system/assets/images/tools/web-01.svg" - text: "WEB" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newWebButton" } - }); + NewEntityButton { + icon: "../scripts/system/assets/images/tools/web-01.svg" + text: "WEB" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newWebButton" } + }); + } } - } - TabletButton { - icon: "../scripts/system/assets/images/tools/zone-01.svg" - text: "ZONE" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newZoneButton" } - }); + NewEntityButton { + icon: "../scripts/system/assets/images/tools/zone-01.svg" + text: "ZONE" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newZoneButton" } + }); + } } - } - TabletButton { - icon: "../scripts/system/assets/images/tools/particle-01.svg" - text: "PARTICLE" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "newParticleButton" } - }); + NewEntityButton { + icon: "../scripts/system/assets/images/tools/particle-01.svg" + text: "PARTICLE" + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "newParticleButton" } + }); + } } - } + } + } } diff --git a/interface/resources/qml/hifi/tablet/NewEntityButton.qml b/interface/resources/qml/hifi/tablet/NewEntityButton.qml new file mode 100644 index 0000000000..93816be71b --- /dev/null +++ b/interface/resources/qml/hifi/tablet/NewEntityButton.qml @@ -0,0 +1,204 @@ +import QtQuick 2.0 +import QtGraphicalEffects 1.0 + +Item { + id: tabletButton + property var uuid; + property string text: "EDIT" + property string icon: "icons/edit-icon.svg" + property string activeText: tabletButton.text + property string activeIcon: tabletButton.icon + property bool isActive: false + property bool inDebugMode: false + property bool isEntered: false + property double sortOrder: 100 + property int stableOrder: 0 + property var tabletRoot; + width: 100 + height: 100 + + signal clicked() + + function changeProperty(key, value) { + tabletButton[key] = value; + } + + onIsActiveChanged: { + if (tabletButton.isEntered) { + tabletButton.state = (tabletButton.isActive) ? "hover active state" : "hover sate"; + } else { + tabletButton.state = (tabletButton.isActive) ? "active state" : "base sate"; + } + } + + Rectangle { + id: buttonBg + color: "#222222" + opacity: 1 + radius: 8 + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.top: parent.top + anchors.topMargin: 0 + } + + function urlHelper(src) { + if (src.match(/\bhttp/)) { + return src; + } else { + return "../../../" + src; + } + } + + Image { + id: icon + width: 50 + height: 50 + visible: false + anchors.bottom: text.top + anchors.bottomMargin: 5 + anchors.horizontalCenter: parent.horizontalCenter + fillMode: Image.Stretch + source: tabletButton.urlHelper(tabletButton.icon) + } + + ColorOverlay { + id: iconColorOverlay + anchors.fill: icon + source: icon + color: "#ffffff" + } + + Text { + id: text + color: "#ffffff" + text: tabletButton.text + font.bold: true + font.pixelSize: 18 + anchors.bottom: parent.bottom + anchors.bottomMargin: 10 + anchors.horizontalCenter: parent.horizontalCenter + horizontalAlignment: Text.AlignHCenter + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + enabled: true + onClicked: { + console.log("Tablet Button Clicked!"); + if (tabletButton.inDebugMode) { + if (tabletButton.isActive) { + tabletButton.isActive = false; + } else { + tabletButton.isActive = true; + } + } + tabletButton.clicked(); + if (tabletRoot) { + tabletRoot.playButtonClickSound(); + } + } + onEntered: { + tabletButton.isEntered = true; + if (tabletButton.isActive) { + tabletButton.state = "hover active state"; + } else { + tabletButton.state = "hover state"; + } + } + onExited: { + tabletButton.isEntered = false; + if (tabletButton.isActive) { + tabletButton.state = "active state"; + } else { + tabletButton.state = "base state"; + } + } + } + + states: [ + State { + name: "hover state" + + PropertyChanges { + target: buttonOutline + border.color: "#1fc6a6" + opacity: 1 + } + + PropertyChanges { + target: glow + visible: true + } + }, + State { + name: "active state" + + PropertyChanges { + target: buttonOutline + border.color: "#1fc6a6" + opacity: 1 + } + + PropertyChanges { + target: buttonBg + color: "#1fc6a6" + opacity: 1 + } + + PropertyChanges { + target: text + color: "#333333" + text: tabletButton.activeText + } + + PropertyChanges { + target: iconColorOverlay + color: "#333333" + } + + PropertyChanges { + target: icon + source: tabletButton.urlHelper(tabletButton.activeIcon) + } + }, + State { + name: "hover active state" + + PropertyChanges { + target: glow + visible: true + } + + PropertyChanges { + target: buttonOutline + border.color: "#ffffff" + opacity: 1 + } + + PropertyChanges { + target: buttonBg + color: "#1fc6a6" + opacity: 1 + } + + PropertyChanges { + target: text + color: "#333333" + } + + PropertyChanges { + target: iconColorOverlay + color: "#333333" + } + + } + ] +} + + From 8e89e0773211edb37d6259a6e5981e5e2a87f742 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 11:50:39 -0800 Subject: [PATCH 3/8] text choose an entity type to create --- interface/resources/qml/hifi/tablet/Edit.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 4a5930e6e7..6e0995779a 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -41,6 +41,18 @@ StackView { Rectangle { color: "#383838" + + Text { + color: "#ffffff" + text: "Choose an Entity Type to Create:" + font.pixelSize: 14 + font.bold: true + anchors.top: parent.top + anchors.topMargin: 28 + anchors.left: parent.left + anchors.leftMargin: 28 + } + Flow { id: createEntitiesFlow spacing: 35 From bd834097d59428b1e9bd53ebf10fb057078173a0 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 12:36:27 -0800 Subject: [PATCH 4/8] tab bar styling --- interface/resources/qml/hifi/tablet/Edit.qml | 32 +++++++++++++------ .../qml/hifi/tablet/NewEntityButton.qml | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 6e0995779a..3489af5fcb 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -34,13 +34,13 @@ StackView { height: 60 Tab { - title: "Create" + title: "CREATE" active: true enabled: true property string originalUrl: "" Rectangle { - color: "#383838" + color: "#404040" Text { color: "#ffffff" @@ -160,7 +160,7 @@ StackView { } Tab { - title: "List" + title: "LIST" active: true enabled: true property string originalUrl: "" @@ -175,7 +175,7 @@ StackView { } Tab { - title: "Properties" + title: "PROPERTIES" active: true enabled: true property string originalUrl: "" @@ -190,7 +190,7 @@ StackView { } Tab { - title: "Grid" + title: "GRID" active: true enabled: true property string originalUrl: "" @@ -205,7 +205,7 @@ StackView { } Tab { - title: "Particles" + title: "P" active: true enabled: true property string originalUrl: "" @@ -223,17 +223,29 @@ StackView { style: TabViewStyle { frameOverlap: 1 tab: Rectangle { - color: styleData.selected ? "slategrey" :"grey" - implicitWidth: text.width + 25 - implicitHeight: 60 - radius: 2 + color: styleData.selected ? "#404040" :"black" + implicitWidth: text.width + 42 + implicitHeight: 40 Text { id: text anchors.centerIn: parent text: styleData.title + font.pixelSize: 16 + font.bold: true color: styleData.selected ? "white" : "white" } } + tabBar: Rectangle { + color: "black" + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.top: parent.top + anchors.topMargin: 0 + } } } } diff --git a/interface/resources/qml/hifi/tablet/NewEntityButton.qml b/interface/resources/qml/hifi/tablet/NewEntityButton.qml index 93816be71b..5cb3d169e7 100644 --- a/interface/resources/qml/hifi/tablet/NewEntityButton.qml +++ b/interface/resources/qml/hifi/tablet/NewEntityButton.qml @@ -33,7 +33,7 @@ Item { Rectangle { id: buttonBg - color: "#222222" + color: "#1c1c1c" opacity: 1 radius: 8 anchors.right: parent.right From 3850bc35a9ffe90f0c7ce2cd78ff7e852dddfb09 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 13:31:03 -0800 Subject: [PATCH 5/8] icons on new entity buttons --- .../icons/create-icons/20-text-01.svg | 26 ++++ .../icons/create-icons/21-cube-01.svg | 17 +++ .../icons/create-icons/22-sphere-01.svg | 21 +++ .../icons/create-icons/23-zone-01.svg | 38 +++++ .../icons/create-icons/24-light-01.svg | 34 +++++ .../icons/create-icons/25-web-1-01.svg | 30 ++++ .../icons/create-icons/90-particles-01.svg | 29 ++++ .../icons/create-icons/94-model-01.svg | 20 +++ interface/resources/qml/hifi/tablet/Edit.qml | 20 +-- .../qml/hifi/tablet/NewEntityButton.qml | 134 ++++++------------ 10 files changed, 271 insertions(+), 98 deletions(-) create mode 100644 interface/resources/icons/create-icons/20-text-01.svg create mode 100644 interface/resources/icons/create-icons/21-cube-01.svg create mode 100644 interface/resources/icons/create-icons/22-sphere-01.svg create mode 100644 interface/resources/icons/create-icons/23-zone-01.svg create mode 100644 interface/resources/icons/create-icons/24-light-01.svg create mode 100644 interface/resources/icons/create-icons/25-web-1-01.svg create mode 100644 interface/resources/icons/create-icons/90-particles-01.svg create mode 100644 interface/resources/icons/create-icons/94-model-01.svg diff --git a/interface/resources/icons/create-icons/20-text-01.svg b/interface/resources/icons/create-icons/20-text-01.svg new file mode 100644 index 0000000000..337f3b70e3 --- /dev/null +++ b/interface/resources/icons/create-icons/20-text-01.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + diff --git a/interface/resources/icons/create-icons/21-cube-01.svg b/interface/resources/icons/create-icons/21-cube-01.svg new file mode 100644 index 0000000000..21a980ca35 --- /dev/null +++ b/interface/resources/icons/create-icons/21-cube-01.svg @@ -0,0 +1,17 @@ + + + + + + + + diff --git a/interface/resources/icons/create-icons/22-sphere-01.svg b/interface/resources/icons/create-icons/22-sphere-01.svg new file mode 100644 index 0000000000..5080a16e78 --- /dev/null +++ b/interface/resources/icons/create-icons/22-sphere-01.svg @@ -0,0 +1,21 @@ + + + + + + + + diff --git a/interface/resources/icons/create-icons/23-zone-01.svg b/interface/resources/icons/create-icons/23-zone-01.svg new file mode 100644 index 0000000000..5428257893 --- /dev/null +++ b/interface/resources/icons/create-icons/23-zone-01.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + diff --git a/interface/resources/icons/create-icons/24-light-01.svg b/interface/resources/icons/create-icons/24-light-01.svg new file mode 100644 index 0000000000..028ea22793 --- /dev/null +++ b/interface/resources/icons/create-icons/24-light-01.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + diff --git a/interface/resources/icons/create-icons/25-web-1-01.svg b/interface/resources/icons/create-icons/25-web-1-01.svg new file mode 100644 index 0000000000..4f0eccc11e --- /dev/null +++ b/interface/resources/icons/create-icons/25-web-1-01.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + diff --git a/interface/resources/icons/create-icons/90-particles-01.svg b/interface/resources/icons/create-icons/90-particles-01.svg new file mode 100644 index 0000000000..5e0105d7cd --- /dev/null +++ b/interface/resources/icons/create-icons/90-particles-01.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + diff --git a/interface/resources/icons/create-icons/94-model-01.svg b/interface/resources/icons/create-icons/94-model-01.svg new file mode 100644 index 0000000000..5d8c4c5eca --- /dev/null +++ b/interface/resources/icons/create-icons/94-model-01.svg @@ -0,0 +1,20 @@ + + + + + diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 3489af5fcb..601dbb5d73 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -76,7 +76,7 @@ StackView { } NewEntityButton { - icon: "model-01.svg" + icon: "icons/create-icons/94-model-01.svg" text: "MODEL" onClicked: { editRoot.sendToScript({ @@ -86,7 +86,7 @@ StackView { } NewEntityButton { - icon: "../cube-01.svg" + icon: "icons/create-icons/21-cube-01.svg" text: "CUBE" onClicked: { editRoot.sendToScript({ @@ -96,7 +96,7 @@ StackView { } NewEntityButton { - icon: "../images/sphere-01.svg" + icon: "icons/create-icons/22-sphere-01.svg" text: "SPHERE" onClicked: { editRoot.sendToScript({ @@ -106,7 +106,7 @@ StackView { } NewEntityButton { - icon: "../scripts/system/assets/images/tools/light-01.svg" + icon: "icons/create-icons/24-light-01.svg" text: "LIGHT" onClicked: { editRoot.sendToScript({ @@ -116,7 +116,7 @@ StackView { } NewEntityButton { - icon: "../scripts/system/assets/images/tools/text-01.svg" + icon: "icons/create-icons/20-text-01.svg" text: "TEXT" onClicked: { editRoot.sendToScript({ @@ -126,7 +126,7 @@ StackView { } NewEntityButton { - icon: "../scripts/system/assets/images/tools/web-01.svg" + icon: "icons/create-icons/25-web-1-01.svg" text: "WEB" onClicked: { editRoot.sendToScript({ @@ -136,7 +136,7 @@ StackView { } NewEntityButton { - icon: "../scripts/system/assets/images/tools/zone-01.svg" + icon: "icons/create-icons/23-zone-01.svg" text: "ZONE" onClicked: { editRoot.sendToScript({ @@ -146,7 +146,7 @@ StackView { } NewEntityButton { - icon: "../scripts/system/assets/images/tools/particle-01.svg" + icon: "icons/create-icons/90-particles-01.svg" text: "PARTICLE" onClicked: { editRoot.sendToScript({ @@ -154,7 +154,9 @@ StackView { }); } } - } + } + + } } diff --git a/interface/resources/qml/hifi/tablet/NewEntityButton.qml b/interface/resources/qml/hifi/tablet/NewEntityButton.qml index 5cb3d169e7..e5684fa791 100644 --- a/interface/resources/qml/hifi/tablet/NewEntityButton.qml +++ b/interface/resources/qml/hifi/tablet/NewEntityButton.qml @@ -2,12 +2,12 @@ import QtQuick 2.0 import QtGraphicalEffects 1.0 Item { - id: tabletButton + id: newEntityButton property var uuid; - property string text: "EDIT" + property string text: "ENTITY" property string icon: "icons/edit-icon.svg" - property string activeText: tabletButton.text - property string activeIcon: tabletButton.icon + property string activeText: newEntityButton.text + property string activeIcon: newEntityButton.icon property bool isActive: false property bool inDebugMode: false property bool isEntered: false @@ -54,6 +54,38 @@ Item { } } + Rectangle { + id: buttonOutline + color: "#00000000" + opacity: 0 + radius: 8 + z: 1 + border.width: 2 + border.color: "#ffffff" + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.top: parent.top + anchors.topMargin: 0 + } + + DropShadow { + id: glow + visible: false + anchors.fill: parent + horizontalOffset: 0 + verticalOffset: 0 + color: "#ffffff" + radius: 20 + z: -1 + samples: 41 + source: buttonOutline + } + + Image { id: icon width: 50 @@ -63,7 +95,7 @@ Item { anchors.bottomMargin: 5 anchors.horizontalCenter: parent.horizontalCenter fillMode: Image.Stretch - source: tabletButton.urlHelper(tabletButton.icon) + source: newEntityButton.urlHelper(newEntityButton.icon) } ColorOverlay { @@ -76,11 +108,11 @@ Item { Text { id: text color: "#ffffff" - text: tabletButton.text + text: newEntityButton.text font.bold: true - font.pixelSize: 18 + font.pixelSize: 16 anchors.bottom: parent.bottom - anchors.bottomMargin: 10 + anchors.bottomMargin: 12 anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter } @@ -90,34 +122,13 @@ Item { hoverEnabled: true enabled: true onClicked: { - console.log("Tablet Button Clicked!"); - if (tabletButton.inDebugMode) { - if (tabletButton.isActive) { - tabletButton.isActive = false; - } else { - tabletButton.isActive = true; - } - } - tabletButton.clicked(); - if (tabletRoot) { - tabletRoot.playButtonClickSound(); - } + newEntityButton.clicked(); } onEntered: { - tabletButton.isEntered = true; - if (tabletButton.isActive) { - tabletButton.state = "hover active state"; - } else { - tabletButton.state = "hover state"; - } + newEntityButton.state = "hover state"; } onExited: { - tabletButton.isEntered = false; - if (tabletButton.isActive) { - tabletButton.state = "active state"; - } else { - tabletButton.state = "base state"; - } + newEntityButton.state = "base state"; } } @@ -127,7 +138,6 @@ Item { PropertyChanges { target: buttonOutline - border.color: "#1fc6a6" opacity: 1 } @@ -137,66 +147,12 @@ Item { } }, State { - name: "active state" - - PropertyChanges { - target: buttonOutline - border.color: "#1fc6a6" - opacity: 1 - } - - PropertyChanges { - target: buttonBg - color: "#1fc6a6" - opacity: 1 - } - - PropertyChanges { - target: text - color: "#333333" - text: tabletButton.activeText - } - - PropertyChanges { - target: iconColorOverlay - color: "#333333" - } - - PropertyChanges { - target: icon - source: tabletButton.urlHelper(tabletButton.activeIcon) - } - }, - State { - name: "hover active state" + name: "base state" PropertyChanges { target: glow - visible: true + visible: false } - - PropertyChanges { - target: buttonOutline - border.color: "#ffffff" - opacity: 1 - } - - PropertyChanges { - target: buttonBg - color: "#1fc6a6" - opacity: 1 - } - - PropertyChanges { - target: text - color: "#333333" - } - - PropertyChanges { - target: iconColorOverlay - color: "#333333" - } - } ] } From d4ea0c116dbba42f15346a95ed48d3c04e132702 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 14:36:39 -0800 Subject: [PATCH 6/8] asset server button --- interface/resources/qml/hifi/tablet/Edit.qml | 102 +++++++++++++++++-- 1 file changed, 91 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index 601dbb5d73..b3f28569cc 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -6,6 +6,7 @@ import QtQuick.Controls.Styles 1.4 import "../../controls" import "../toolbars" import HFWebEngineProfile 1.0 +import QtGraphicalEffects 1.0 StackView { id: editRoot @@ -60,20 +61,9 @@ StackView { anchors.rightMargin: 55 anchors.left: parent.left anchors.leftMargin: 55 - anchors.bottom: parent.bottom - anchors.bottomMargin: 30 anchors.top: parent.top anchors.topMargin: 70 - NewEntityButton { - icon: "icons/assets-01.svg" - text: "ASSETS" - onClicked: { - editRoot.sendToScript({ - method: "newEntityButtonClicked", params: { buttonName: "openAssetBrowserButton" } - }); - } - } NewEntityButton { icon: "icons/create-icons/94-model-01.svg" @@ -156,8 +146,98 @@ StackView { } } + Item { + id: assetServerButton + width: 370 + height: 38 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: createEntitiesFlow.bottom + anchors.topMargin: 35 + + Rectangle { + id: assetServerButtonBg + color: "black" + opacity: 1 + radius: 6 + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.top: parent.top + anchors.topMargin: 0 + } + Rectangle { + id: assetServerButtonGradient + gradient: Gradient { + GradientStop { + position: 0 + color: "#383838" + } + GradientStop { + position: 1 + color: "black" + } + } + opacity: 1 + radius: 6 + anchors.right: parent.right + anchors.rightMargin: 0 + anchors.left: parent.left + anchors.leftMargin: 0 + anchors.bottom: parent.bottom + anchors.bottomMargin: 0 + anchors.top: parent.top + anchors.topMargin: 0 + } + + Text { + color: "#ffffff" + text: "OPEN THIS DOMAIN'S ASSET SERVER" + font.bold: true + font.pixelSize: 14 + anchors.centerIn: parent + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + enabled: true + onClicked: { + editRoot.sendToScript({ + method: "newEntityButtonClicked", params: { buttonName: "openAssetBrowserButton" } + }); + } + onEntered: { + assetServerButton.state = "hover state"; + } + onExited: { + assetServerButton.state = "base state"; + } + } + + states: [ + State { + name: "hover state" + + PropertyChanges { + target: assetServerButtonGradient + opacity: 0 + } + }, + State { + name: "base state" + + PropertyChanges { + target: assetServerButtonGradient + opacity: 1 + } + } + ] + } } } From 80c3c003984b58b5a1f57833780b4e72aa3b8b85 Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 14:48:06 -0800 Subject: [PATCH 7/8] switch to properties tab when you create an entity --- interface/resources/qml/hifi/tablet/Edit.qml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index b3f28569cc..a4e3db73f4 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -72,6 +72,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newModelButton" } }); + editTabView.currentIndex = 2 } } @@ -82,6 +83,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newCubeButton" } }); + editTabView.currentIndex = 2 } } @@ -92,6 +94,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newSphereButton" } }); + editTabView.currentIndex = 2 } } @@ -102,6 +105,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newLightButton" } }); + editTabView.currentIndex = 2 } } @@ -112,6 +116,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newTextButton" } }); + editTabView.currentIndex = 2 } } @@ -122,6 +127,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newWebButton" } }); + editTabView.currentIndex = 2 } } @@ -132,6 +138,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newZoneButton" } }); + editTabView.currentIndex = 2 } } @@ -142,6 +149,7 @@ StackView { editRoot.sendToScript({ method: "newEntityButtonClicked", params: { buttonName: "newParticleButton" } }); + editTabView.currentIndex = 2 } } } From c60360b6e070cf29c01a89d8d8bf5b70089cfcbe Mon Sep 17 00:00:00 2001 From: Faye Li Date: Thu, 23 Feb 2017 16:34:10 -0800 Subject: [PATCH 8/8] particle explorer icon --- interface/resources/qml/hifi/tablet/Edit.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/Edit.qml b/interface/resources/qml/hifi/tablet/Edit.qml index a4e3db73f4..00856f8212 100644 --- a/interface/resources/qml/hifi/tablet/Edit.qml +++ b/interface/resources/qml/hifi/tablet/Edit.qml @@ -1,5 +1,5 @@ import QtQuick 2.5 -import QtQuick.Controls 1.0 +import QtQuick.Controls 1.4 import QtWebEngine 1.1 import QtWebChannel 1.0 import QtQuick.Controls.Styles 1.4 @@ -7,6 +7,7 @@ import "../../controls" import "../toolbars" import HFWebEngineProfile 1.0 import QtGraphicalEffects 1.0 +import "../../styles-uit" StackView { id: editRoot @@ -323,6 +324,17 @@ StackView { font.pixelSize: 16 font.bold: true color: styleData.selected ? "white" : "white" + property string glyphtext: "" + HiFiGlyphs { + anchors.centerIn: parent + size: 30 + color: "#ffffff" + text: text.glyphtext + } + Component.onCompleted: if (styleData.title == "P") { + text.text = " "; + text.glyphtext = "\ue004"; + } } } tabBar: Rectangle {