diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml b/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml index fb7987ca76..826504a85c 100644 --- a/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml +++ b/interface/resources/qml/hifi/avatarPackager/AvatarPackagerApp.qml @@ -19,6 +19,7 @@ Item { MouseArea { anchors.fill: parent + onClicked: { unfocusser.forceActiveFocus(); } @@ -352,8 +353,6 @@ Item { color: 'white' - visible: AvatarPackagerCore.currentAvatarProject !== null - anchors.top: parent.top anchors.left: parent.left anchors.topMargin: 16 diff --git a/interface/resources/qml/hifi/avatarPackager/AvatarPackagerHeader.qml b/interface/resources/qml/hifi/avatarPackager/AvatarPackagerHeader.qml index cd6fdb72fe..2289ce31ec 100644 --- a/interface/resources/qml/hifi/avatarPackager/AvatarPackagerHeader.qml +++ b/interface/resources/qml/hifi/avatarPackager/AvatarPackagerHeader.qml @@ -122,7 +122,6 @@ ShadowRectangle { anchors.verticalCenter: docs.verticalCenter text: qsTr("Docs") - color: "white" onClicked: { docsButtonClicked(); diff --git a/interface/resources/qml/hifi/avatarPackager/ClickableArea.qml b/interface/resources/qml/hifi/avatarPackager/ClickableArea.qml new file mode 100644 index 0000000000..ebe38364ec --- /dev/null +++ b/interface/resources/qml/hifi/avatarPackager/ClickableArea.qml @@ -0,0 +1,63 @@ +import QtQuick 2.6 + +import "../../controlsUit" 1.0 as HifiControls +import "../../stylesUit" 1.0 + +import TabletScriptingInterface 1.0 + +Item { + id: root + + readonly property bool pressed: mouseArea.state == "pressed" + readonly property bool hovered: mouseArea.state == "hovering" + + signal clicked() + + MouseArea { + id: mouseArea + + anchors.fill: parent + + hoverEnabled: true + + onClicked: { + root.focus = true + Tablet.playSound(TabletEnums.ButtonClick); + root.clicked(); + } + + property string lastState: "" + + states: [ + State { + name: "" + StateChangeScript { + script: { + mouseArea.lastState = mouseArea.state; + } + } + }, + State { + name: "pressed" + when: mouseArea.containsMouse && mouseArea.pressed + StateChangeScript { + script: { + mouseArea.lastState = mouseArea.state; + } + } + }, + State { + name: "hovering" + when: mouseArea.containsMouse + StateChangeScript { + script: { + if (mouseArea.lastState == "") { + Tablet.playSound(TabletEnums.ButtonHover); + } + mouseArea.lastState = mouseArea.state; + } + } + } + ] + } +} \ No newline at end of file diff --git a/interface/resources/qml/hifi/avatarPackager/CreateAvatarProject.qml b/interface/resources/qml/hifi/avatarPackager/CreateAvatarProject.qml index 1e9a3d9e84..c299417c27 100644 --- a/interface/resources/qml/hifi/avatarPackager/CreateAvatarProject.qml +++ b/interface/resources/qml/hifi/avatarPackager/CreateAvatarProject.qml @@ -31,6 +31,7 @@ Item { avatarPackager.displayErrorMessage(status); return; } + avatarProject.reset(); avatarPackager.state = AvatarPackagerState.project; } } diff --git a/interface/resources/qml/hifi/avatarPackager/InfoBox.qml b/interface/resources/qml/hifi/avatarPackager/InfoBox.qml index 301386acfa..e33e427af0 100644 --- a/interface/resources/qml/hifi/avatarPackager/InfoBox.qml +++ b/interface/resources/qml/hifi/avatarPackager/InfoBox.qml @@ -20,6 +20,12 @@ Rectangle { property alias boxWidth: mainContainer.width property alias boxHeight: mainContainer.height + onVisibleChanged: { + if (visible) { + focus = true; + } + } + function open() { visible = true; } diff --git a/interface/resources/qml/hifi/avatarPackager/RalewayButton.qml b/interface/resources/qml/hifi/avatarPackager/RalewayButton.qml index e7134b6934..edbc31b24f 100644 --- a/interface/resources/qml/hifi/avatarPackager/RalewayButton.qml +++ b/interface/resources/qml/hifi/avatarPackager/RalewayButton.qml @@ -8,61 +8,21 @@ import TabletScriptingInterface 1.0 RalewaySemiBold { id: root - text: "no text" - - signal clicked() - - color: "white" + anchors.fill: textItem + property var idleColor: "white" property var hoverColor: "#AFAFAF" property var pressedColor: "#575757" - MouseArea { - id: mouseArea + color: clickable.hovered ? root.hoverColor : (clickable.pressed ? root.pressedColor : root.idleColor); - anchors.fill: parent + signal clicked() - hoverEnabled: true + ClickableArea { + id: clickable - onClicked: { - Tablet.playSound(TabletEnums.ButtonClick); - root.clicked() - } + anchors.fill: root - property string lastState: "" - - states: [ - State { - name: "" - StateChangeScript { - script: { - mouseArea.lastState = mouseArea.state - } - } - }, - State { - name: "pressed" - when: mouseArea.containsMouse && mouseArea.pressed - PropertyChanges { target: root; color: pressedColor } - StateChangeScript { - script: { - mouseArea.lastState = mouseArea.state - } - } - }, - State { - name: "hovering" - when: mouseArea.containsMouse - PropertyChanges { target: root; color: hoverColor } - StateChangeScript { - script: { - if (mouseArea.lastState == "") { - Tablet.playSound(TabletEnums.ButtonHover); - } - mouseArea.lastState = mouseArea.state - } - } - } - ] + onClicked: root.clicked() } } \ No newline at end of file