diff --git a/interface/resources/qml/controls-uit/CheckBox.qml b/interface/resources/qml/controls-uit/CheckBox.qml
index e13c9875e8..6e4a3df010 100644
--- a/interface/resources/qml/controls-uit/CheckBox.qml
+++ b/interface/resources/qml/controls-uit/CheckBox.qml
@@ -27,6 +27,9 @@ Original.CheckBox {
property bool wrap: true;
readonly property int checkSize: Math.max(boxSize - 8, 10)
readonly property int checkRadius: 2
+ property string labelFontFamily: "Raleway"
+ property int labelFontSize: 14;
+ property int labelFontWeight: Font.DemiBold;
focusPolicy: Qt.ClickFocus
hoverEnabled: true
@@ -105,6 +108,9 @@ Original.CheckBox {
contentItem: Label {
text: checkBox.text
color: checkBox.color
+ font.family: checkBox.labelFontFamily;
+ font.pixelSize: checkBox.labelFontSize;
+ font.weight: checkBox.labelFontWeight;
x: 2
verticalAlignment: Text.AlignVCenter
wrapMode: checkBox.wrap ? Text.Wrap : Text.NoWrap
diff --git a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml
index 4db98091c1..19b57354dc 100644
--- a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml
+++ b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml
@@ -49,6 +49,7 @@ Item {
property string upgradeTitle;
property bool updateAvailable: root.upgradeUrl !== "" && !root.isShowingMyItems;
property bool isShowingMyItems;
+ property bool valid;
property string originalStatusText;
property string originalStatusColor;
@@ -239,6 +240,7 @@ Item {
width: 62;
onLoaded: {
+ item.enabled = root.valid;
item.buttonGlyphText = hifi.glyphs.gift;
item.buttonText = "Gift";
item.buttonClicked = function() {
@@ -463,7 +465,7 @@ Item {
Item {
id: statusContainer;
- visible: root.purchaseStatus === "pending" || root.purchaseStatus === "invalidated" || root.numberSold > -1;
+ visible: root.purchaseStatus === "pending" || !root.valid || root.numberSold > -1;
anchors.left: itemName.left;
anchors.right: itemName.right;
anchors.top: itemName.bottom;
@@ -480,7 +482,7 @@ Item {
text: {
if (root.purchaseStatus === "pending") {
"PENDING..."
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
"INVALIDATED"
} else if (root.numberSold > -1) {
("Sales: " + root.numberSold + "/" + (root.limitedRun === -1 ? "\u221e" : root.limitedRun))
@@ -492,7 +494,7 @@ Item {
color: {
if (root.purchaseStatus === "pending") {
hifi.colors.blueAccent
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
hifi.colors.redAccent
} else {
hifi.colors.baseGray
@@ -506,7 +508,7 @@ Item {
text: {
if (root.purchaseStatus === "pending") {
hifi.glyphs.question
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
hifi.glyphs.question
} else {
""
@@ -523,7 +525,7 @@ Item {
color: {
if (root.purchaseStatus === "pending") {
hifi.colors.blueAccent
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
hifi.colors.redAccent
} else {
hifi.colors.baseGray
@@ -538,7 +540,7 @@ Item {
onClicked: {
if (root.purchaseStatus === "pending") {
sendToPurchases({method: 'showPendingLightbox'});
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
sendToPurchases({method: 'showInvalidatedLightbox'});
}
}
@@ -546,7 +548,7 @@ Item {
if (root.purchaseStatus === "pending") {
statusText.color = hifi.colors.blueHighlight;
statusIcon.color = hifi.colors.blueHighlight;
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
statusText.color = hifi.colors.redAccent;
statusIcon.color = hifi.colors.redAccent;
}
@@ -555,7 +557,7 @@ Item {
if (root.purchaseStatus === "pending") {
statusText.color = hifi.colors.blueAccent;
statusIcon.color = hifi.colors.blueAccent;
- } else if (root.purchaseStatus === "invalidated") {
+ } else if (!root.valid) {
statusText.color = hifi.colors.redHighlight;
statusIcon.color = hifi.colors.redHighlight;
}
@@ -645,8 +647,8 @@ Item {
width: 160;
height: 40;
enabled: root.hasPermissionToRezThis &&
- root.purchaseStatus !== "invalidated" &&
- MyAvatar.skeletonModelURL !== root.itemHref;
+ MyAvatar.skeletonModelURL !== root.itemHref &&
+ root.valid;
onHoveredChanged: {
if (hovered) {
diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
index d79b8d09fa..8fe1ebe6c9 100644
--- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
+++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml
@@ -616,6 +616,7 @@ Rectangle {
upgradeTitle: model.upgrade_title;
itemType: model.itemType;
isShowingMyItems: root.isShowingMyItems;
+ valid: model.valid;
anchors.topMargin: 10;
anchors.bottomMargin: 10;
@@ -995,10 +996,6 @@ Rectangle {
for (var i = 0; i < purchasesModel.count; i++) {
if (purchasesModel.get(i).title.toLowerCase().indexOf(filterBar.text.toLowerCase()) !== -1) {
- if (!purchasesModel.get(i).valid) {
- continue;
- }
-
if (purchasesModel.get(i).status !== "confirmed" && !root.isShowingMyItems) {
tempPurchasesModel.insert(0, purchasesModel.get(i));
} else if ((root.isShowingMyItems && purchasesModel.get(i).edition_number === "0") ||
@@ -1055,10 +1052,6 @@ Rectangle {
var currentId;
for (var i = 0; i < tempPurchasesModel.count; i++) {
currentId = tempPurchasesModel.get(i).id;
-
- if (!purchasesModel.get(i).valid) {
- continue;
- }
filteredPurchasesModel.append(tempPurchasesModel.get(i));
filteredPurchasesModel.setProperty(i, 'cardBackVisible', false);
filteredPurchasesModel.setProperty(i, 'isInstalled', ((root.installedApps).indexOf(currentId) > -1));
diff --git a/unpublishedScripts/marketplace/spectator-camera/SpectatorCamera.qml b/unpublishedScripts/marketplace/spectator-camera/SpectatorCamera.qml
index a38888d3c0..d73ec20142 100644
--- a/unpublishedScripts/marketplace/spectator-camera/SpectatorCamera.qml
+++ b/unpublishedScripts/marketplace/spectator-camera/SpectatorCamera.qml
@@ -13,6 +13,9 @@
import Hifi 1.0 as Hifi
import QtQuick 2.7
+import QtQuick.Controls 2.2
+import QtGraphicalEffects 1.0
+
import "qrc:////qml//styles-uit" as HifiStylesUit
import "qrc:////qml//controls-uit" as HifiControlsUit
import "qrc:////qml//controls" as HifiControls
@@ -56,8 +59,6 @@ Rectangle {
HifiStylesUit.RalewaySemiBold {
id: titleBarText;
text: "Spectator Camera";
- // Text size
- size: hifi.fontSizes.overlayTitle;
// Anchors
anchors.left: parent.left;
anchors.leftMargin: 30;
@@ -71,16 +72,51 @@ Rectangle {
verticalAlignment: Text.AlignVCenter;
}
- HifiControlsUit.Switch {
+ Switch {
id: masterSwitch;
+ focusPolicy: Qt.ClickFocus;
width: 65;
- height: parent.height;
+ height: 30;
+ anchors.verticalCenter: parent.verticalCenter;
anchors.right: parent.right;
anchors.rightMargin: 30;
+ hoverEnabled: true;
+
+ onHoveredChanged: {
+ if (hovered) {
+ switchHandle.color = hifi.colors.blueHighlight;
+ } else {
+ switchHandle.color = hifi.colors.lightGray;
+ }
+ }
+
onCheckedChanged: {
sendToScript({method: (checked ? 'spectatorCameraOn' : 'spectatorCameraOff')});
sendToScript({method: 'updateCameravFoV', vFoV: fieldOfViewSlider.value});
}
+
+ background: Rectangle {
+ color: parent.checked ? "#1FC6A6" : hifi.colors.white;
+ implicitWidth: masterSwitch.switchWidth;
+ implicitHeight: masterSwitch.height;
+ radius: height/2;
+ }
+
+ indicator: Rectangle {
+ id: switchHandle;
+ implicitWidth: masterSwitch.height - 4;
+ implicitHeight: implicitWidth;
+ radius: implicitWidth/2;
+ border.color: "#E3E3E3";
+ color: "#404040";
+ x: Math.max(4, Math.min(parent.width - width - 4, parent.visualPosition * parent.width - (width / 2) - 4))
+ y: parent.height / 2 - height / 2;
+ Behavior on x {
+ enabled: !masterSwitch.down
+ SmoothedAnimation { velocity: 200 }
+ }
+
+ }
}
}
//
@@ -132,19 +168,17 @@ Rectangle {
//
Item {
id: spectatorControlsContainer;
- // Size
- height: root.height - spectatorDescriptionContainer.height - titleBarContainer.height;
// Anchors
anchors.top: titleBarContainer.bottom;
anchors.left: parent.left;
anchors.right: parent.right;
+ anchors.bottom: parent.bottom;
// Instructions or Preview
Rectangle {
id: spectatorCameraImageContainer;
anchors.left: parent.left;
- anchors.top: cameraToggleButton.bottom;
- anchors.topMargin: 8;
+ anchors.top: parent.top;
anchors.right: parent.right;
height: 250;
color: masterSwitch.checked ? "transparent" : "black";
@@ -161,7 +195,7 @@ Rectangle {
id: spectatorCameraInstructions;
text: "Turn on Spectator Camera for a preview\nof " + (HMD.active ? "what your monitor shows." : "the camera's view.");
size: 16;
- color: hifi.colors.lightGrayText;
+ color: hifi.colors.white;
visible: !masterSwitch.checked;
anchors.fill: parent;
horizontalAlignment: Text.AlignHCenter;
@@ -172,7 +206,7 @@ Rectangle {
Hifi.ResourceImageItem {
id: spectatorCameraPreview;
visible: masterSwitch.checked;
- url: monitorShowsSwitch.checked || !HMD.active ? "resource://spectatorCameraFrame" : "resource://hmdPreviewFrame";
+ url: showCameraView.checked || !HMD.active ? "resource://spectatorCameraFrame" : "resource://hmdPreviewFrame";
ready: masterSwitch.checked;
mirrorVertically: true;
anchors.fill: parent;
@@ -183,13 +217,22 @@ Rectangle {
}
Item {
- visible: true//HMD.active;
+ visible: HMD.active;
anchors.top: parent.top;
anchors.left: parent.left;
anchors.right: parent.right;
- height: 80;
+ height: 40;
+
+ LinearGradient {
+ anchors.fill: parent;
+ start: Qt.point(0, 0);
+ end: Qt.point(0, height);
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: hifi.colors.black }
+ GradientStop { position: 1.0; color: Qt.rgba(0, 0, 0, 0) }
+ }
+ }
- // "Monitor Shows" Switch Label Glyph
HifiStylesUit.HiFiGlyphs {
id: monitorShowsSwitchLabelGlyph;
text: hifi.glyphs.screen;
@@ -200,10 +243,9 @@ Rectangle {
anchors.left: parent.left;
anchors.leftMargin: 16;
}
- // "Monitor Shows" Switch Label
HifiStylesUit.RalewayLight {
id: monitorShowsSwitchLabel;
- text: "MONITOR SHOWS:";
+ text: "Monitor View:";
anchors.top: parent.top;
anchors.bottom: parent.bottom;
anchors.left: monitorShowsSwitchLabelGlyph.right;
@@ -216,7 +258,7 @@ Rectangle {
}
Item {
anchors.left: monitorShowsSwitchLabel.right;
- anchors.leftMargin: 10;
+ anchors.leftMargin: 14;
anchors.right: parent.right;
anchors.rightMargin: 10;
anchors.top: parent.top;
@@ -225,8 +267,9 @@ Rectangle {
HifiControlsUit.RadioButton {
id: showCameraView;
text: "Camera View";
- width: 140;
+ width: 125;
anchors.left: parent.left;
+ anchors.leftMargin: 10;
anchors.verticalCenter: parent.verticalCenter;
colorScheme: hifi.colorSchemes.dark;
onClicked: {
@@ -248,8 +291,8 @@ Rectangle {
id: showHmdPreview;
text: "HMD";
anchors.left: showCameraView.right;
- anchors.leftMargin: 10;
- anchors.right: parent.right;
+ anchors.leftMargin: 20;
+ width: 70;
anchors.verticalCenter: parent.verticalCenter;
colorScheme: hifi.colorSchemes.dark;
onClicked: {
@@ -268,223 +311,245 @@ Rectangle {
}
}
}
+
+ HifiControlsUit.Button {
+ id: takeSnapshotButton;
+ enabled: masterSwitch.checked;
+ text: "SNAP PICTURE";
+ colorScheme: hifi.colorSchemes.dark;
+ color: hifi.buttons.white;
+ anchors.bottom: parent.bottom;
+ anchors.bottomMargin: 8;
+ anchors.right: take360SnapshotButton.left;
+ anchors.rightMargin: 12;
+ width: 135;
+ height: 35;
+ onClicked: {
+ sendToScript({method: 'takeSecondaryCameraSnapshot'});
+ }
+ }
+ HifiControlsUit.Button {
+ id: take360SnapshotButton;
+ enabled: masterSwitch.checked;
+ text: "SNAP 360";
+ colorScheme: hifi.colorSchemes.dark;
+ color: hifi.buttons.white;
+ anchors.bottom: parent.bottom;
+ anchors.bottomMargin: 8;
+ anchors.right: parent.right;
+ anchors.rightMargin: 12;
+ width: 135;
+ height: 35;
+ onClicked: {
+ root.processing360Snapshot = true;
+ sendToScript({method: 'takeSecondaryCamera360Snapshot'});
+ }
+ }
}
Item {
- id: fieldOfView;
anchors.top: spectatorCameraImageContainer.bottom;
anchors.topMargin: 8;
anchors.left: parent.left;
- anchors.leftMargin: 8;
+ anchors.leftMargin: 26;
anchors.right: parent.right;
- height: 35;
+ anchors.rightMargin: 26;
+ anchors.bottom: parent.bottom;
- HifiStylesUit.FiraSansRegular {
- id: fieldOfViewLabel;
- text: "Field of View (" + fieldOfViewSlider.value + "\u00B0): ";
- size: 16;
- color: hifi.colors.lightGrayText;
+ Item {
+ id: fieldOfView;
+ visible: masterSwitch.checked;
+ anchors.top: parent.top;
anchors.left: parent.left;
- anchors.top: parent.top;
- anchors.bottom: parent.bottom;
- width: 140;
- horizontalAlignment: Text.AlignLeft;
- verticalAlignment: Text.AlignVCenter;
- }
+ anchors.right: parent.right;
+ height: 35;
- HifiControlsUit.Slider {
- id: fieldOfViewSlider;
- anchors.top: parent.top;
- anchors.bottom: parent.bottom;
- anchors.right: resetvFoV.left;
- anchors.rightMargin: 8;
- anchors.left: fieldOfViewLabel.right;
- anchors.leftMargin: 8;
- colorScheme: hifi.colorSchemes.dark;
- from: 10.0;
- to: 120.0;
- value: 45.0;
- stepSize: 1;
-
- onValueChanged: {
- sendToScript({method: 'updateCameravFoV', vFoV: value});
+ HifiStylesUit.RalewaySemiBold {
+ id: fieldOfViewLabel;
+ text: "Field of View (" + fieldOfViewSlider.value + "\u00B0): ";
+ size: 20;
+ color: hifi.colors.white;
+ anchors.left: parent.left;
+ anchors.top: parent.top;
+ anchors.bottom: parent.bottom;
+ width: 172;
+ horizontalAlignment: Text.AlignLeft;
+ verticalAlignment: Text.AlignVCenter;
}
- onPressedChanged: {
- if (!pressed) {
+
+ HifiControlsUit.Slider {
+ id: fieldOfViewSlider;
+ anchors.top: parent.top;
+ anchors.bottom: parent.bottom;
+ anchors.right: resetvFoV.left;
+ anchors.rightMargin: 8;
+ anchors.left: fieldOfViewLabel.right;
+ anchors.leftMargin: 8;
+ colorScheme: hifi.colorSchemes.dark;
+ from: 10.0;
+ to: 120.0;
+ value: 45.0;
+ stepSize: 1;
+
+ onValueChanged: {
sendToScript({method: 'updateCameravFoV', vFoV: value});
}
+ onPressedChanged: {
+ if (!pressed) {
+ sendToScript({method: 'updateCameravFoV', vFoV: value});
+ }
+ }
+ }
+
+ HifiControlsUit.GlyphButton {
+ id: resetvFoV;
+ anchors.verticalCenter: parent.verticalCenter;
+ anchors.right: parent.right;
+ anchors.rightMargin: -8;
+ height: parent.height - 8;
+ width: height;
+ glyph: hifi.glyphs.reload;
+ onClicked: {
+ fieldOfViewSlider.value = 45.0;
+ }
}
}
- HifiControlsUit.GlyphButton {
- id: resetvFoV;
- anchors.verticalCenter: parent.verticalCenter;
+ Item {
+ visible: HMD.active;
+ anchors.top: fieldOfView.bottom;
+ anchors.topMargin: 18;
+ anchors.left: parent.left;
anchors.right: parent.right;
- anchors.rightMargin: 6;
- height: parent.height - 8;
- width: height;
- glyph: hifi.glyphs.reload;
- onClicked: {
- fieldOfViewSlider.value = 45.0;
+ height: childrenRect.height;
+
+ HifiStylesUit.RalewaySemiBold {
+ id: shortcutsHeaderText;
+ anchors.top: parent.top;
+ anchors.left: parent.left;
+ anchors.right: parent.right;
+ height: paintedHeight;
+ text: "Shortcuts";
+ size: 20;
+ color: hifi.colors.white;
+ }
+
+ // "Switch View From Controller" Checkbox
+ HifiControlsUit.CheckBox {
+ id: switchViewFromControllerCheckBox;
+ color: hifi.colors.white;
+ colorScheme: hifi.colorSchemes.dark;
+ anchors.left: parent.left;
+ anchors.top: shortcutsHeaderText.bottom;
+ anchors.topMargin: 8;
+ text: "";
+ labelFontSize: 20;
+ labelFontWeight: Font.Normal;
+ boxSize: 24;
+ onClicked: {
+ sendToScript({method: 'changeSwitchViewFromControllerPreference', params: checked});
+ }
+ }
+
+ // "Take Snapshot" Checkbox
+ HifiControlsUit.CheckBox {
+ id: takeSnapshotFromControllerCheckBox;
+ color: hifi.colors.white;
+ colorScheme: hifi.colorSchemes.dark;
+ anchors.left: parent.left;
+ anchors.top: switchViewFromControllerCheckBox.bottom;
+ anchors.topMargin: 4;
+ text: "";
+ labelFontSize: 20;
+ labelFontWeight: Font.Normal;
+ boxSize: 24;
+ onClicked: {
+ sendToScript({method: 'changeTakeSnapshotFromControllerPreference', params: checked});
+ }
+ }
+ }
+
+ Item {
+ id: spectatorDescriptionContainer;
+ // Size
+ height: childrenRect.height;
+ // Anchors
+ anchors.left: parent.left;
+ anchors.right: parent.right;
+ anchors.bottom: parent.bottom;
+ anchors.bottomMargin: 40;
+
+ // "Spectator" app description text
+ HifiStylesUit.RalewayRegular {
+ id: spectatorDescriptionText;
+ text: "While you're using a VR headset, you can use this app to change what your monitor shows. " +
+ "Try it when streaming or recording video.";
+ // Text size
+ size: 20;
+ // Size
+ height: paintedHeight;
+ // Anchors
+ anchors.left: parent.left;
+ anchors.right: parent.right;
+ anchors.top: parent.top;
+ // Style
+ color: hifi.colors.white;
+ wrapMode: Text.Wrap;
+ // Alignment
+ horizontalAlignment: Text.AlignHLeft;
+ verticalAlignment: Text.AlignVCenter;
+ }
+
+ // "Learn More" text
+ HifiStylesUit.RalewayRegular {
+ id: spectatorLearnMoreText;
+ text: "Learn More About Spectator";
+ // Text size
+ size: 20;
+ // Size
+ width: paintedWidth;
+ height: paintedHeight;
+ // Anchors
+ anchors.top: spectatorDescriptionText.bottom;
+ anchors.topMargin: 10;
+ anchors.left: parent.left;
+ anchors.right: parent.right;
+ // Style
+ color: hifi.colors.blueAccent;
+ wrapMode: Text.WordWrap;
+ font.underline: true;
+ // Alignment
+ horizontalAlignment: Text.AlignHLeft;
+ verticalAlignment: Text.AlignVCenter;
+
+ MouseArea {
+ anchors.fill: parent;
+ hoverEnabled: enabled;
+ onClicked: {
+ letterbox(hifi.glyphs.question,
+ "Spectator Camera",
+ "By default, your monitor shows a preview of what you're seeing in VR. " +
+ "Using the Spectator Camera app, your monitor can display the view " +
+ "from a virtual hand-held camera - perfect for taking selfies or filming " +
+ "your friends!
" +
+ "