From 20d7e00ea8d0b66d48e18853711ff88ca994f0ce Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 14 Feb 2019 08:48:37 -0800 Subject: [PATCH] Standalone Tags - Checkpoint --- interface/resources/qml/hifi/Card.qml | 20 ++++ .../hifi/commerce/marketplace/Marketplace.qml | 5 +- .../commerce/marketplace/MarketplaceItem.qml | 97 +++++++++++++++---- .../marketplace/MarketplaceListItem.qml | 33 ++++++- .../hifi/commerce/purchases/PurchasedItem.qml | 21 ++++ .../qml/hifi/commerce/purchases/Purchases.qml | 2 + 6 files changed, 158 insertions(+), 20 deletions(-) diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index 238c26236f..67abc1c3f9 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -39,6 +39,7 @@ Item { property bool isConcurrency: action === 'concurrency'; property bool isAnnouncement: action === 'announcement'; property bool isStacked: !isConcurrency && drillDownToPlace; + property bool standaloneOptimized: true; property int textPadding: 10; property int smallMargin: 4; @@ -281,7 +282,26 @@ Item { right: parent.right; margins: smallMargin; } + } + HiFiGlyphs { + id: standaloneOptomizedBadge + + anchors { + right: actionIcon.left + verticalCenter: parent.verticalCenter + bottom: parent.bottom; + } + height: root.standaloneOptimized ? 34 : 0 + + visible: standaloneOptimized + + text: hifi.glyphs.hmd + size: 34 + horizontalAlignment: Text.AlignHCenter + color: hifi.colors.blueHighlight + } + function go() { Tablet.playSound(TabletEnums.ButtonClick); goFunction(drillDownToPlace ? ("/places/" + placeName) : ("/user_stories/" + storyId)); diff --git a/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml b/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml index 0d42cb599e..ba83b0b61f 100644 --- a/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml +++ b/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml @@ -122,6 +122,8 @@ Rectangle { marketplaceItem.license = result.data.license; marketplaceItem.available = result.data.availability === "available"; marketplaceItem.created_at = result.data.created_at; + marketplaceItem.standaloneOptimized = result.data.standalone_optimized; + marketplaceItem.standaloneVisible = result.data.standalone_optimized || result.data.standalone_incompatible; marketplaceItemScrollView.contentHeight = marketplaceItemContent.height; itemsList.visible = false; marketplaceItemView.visible = true; @@ -534,7 +536,8 @@ Rectangle { price: model.cost available: model.availability === "available" isLoggedIn: root.isLoggedIn; - + standaloneOptimized: model.standalone_optimized + onShowItem: { MarketplaceScriptingInterface.getMarketplaceItem(item_id); } diff --git a/interface/resources/qml/hifi/commerce/marketplace/MarketplaceItem.qml b/interface/resources/qml/hifi/commerce/marketplace/MarketplaceItem.qml index 0a57e56099..9784e422f1 100644 --- a/interface/resources/qml/hifi/commerce/marketplace/MarketplaceItem.qml +++ b/interface/resources/qml/hifi/commerce/marketplace/MarketplaceItem.qml @@ -39,9 +39,11 @@ Rectangle { property string posted: "" property bool available: false property string created_at: "" - property bool isLoggedIn: false; - property int edition: -1; - property bool supports3DHTML: false; + property bool isLoggedIn: false + property int edition: -1 + property bool supports3DHTML: false + property bool standaloneVisible: false + property bool standaloneOptimized: false onCategoriesChanged: { @@ -50,16 +52,6 @@ Rectangle { categoriesListModel.append({"category":category}); }); } - - onDescriptionChanged: { - - if(root.supports3DHTML) { - descriptionTextModel.clear(); - descriptionTextModel.append({text: description}); - } else { - descriptionText.text = description; - } - } onAttributionsChanged: { attributionsModel.clear(); @@ -246,11 +238,38 @@ Rectangle { right: parent.right; top: itemImage.bottom; } - height: categoriesList.y - buyButton.y + categoriesList.height + height: categoriesList.y - badges.y + categoriesList.height function evalHeight() { - height = categoriesList.y - buyButton.y + categoriesList.height; - console.log("HEIGHT: " + height); + height = categoriesList.y - badges.y + categoriesList.height; + } + + Item { + id: badges + + anchors { + left: parent.left + top: parent.top + right: parent.right + } + height: childrenRect.height + + HiFiGlyphs { + id: standaloneOptomizedBadge + + anchors { + left: parent.left + verticalCenter: parent.verticalCenter + } + height: root.standaloneOptimized ? 34 : 0 + + visible: root.standaloneOptimized + + text: hifi.glyphs.hmd + size: 34 + horizontalAlignment: Text.AlignHCenter + color: hifi.colors.blueHighlight + } } HifiControlsUit.Button { @@ -258,7 +277,7 @@ Rectangle { anchors { right: parent.right - top: parent.top + top: badges.bottom left: parent.left topMargin: 15 } @@ -529,13 +548,55 @@ Rectangle { } } } + + Item { + id: standaloneItem + + anchors { + top: licenseItem.bottom + topMargin: 15 + left: parent.left + right: parent.right + } + height: root.standaloneVisible ? childrenRect.height : 0 + + visible: root.standaloneVisible + + RalewaySemiBold { + id: standaloneLabel + + anchors.top: parent.top + anchors.left: parent.left + width: paintedWidth + height: 20 + + text: root.standaloneOptimized ? "STAND-ALONE OPTIMIZED:" : "STAND-ALONE INCOMPATIBLE:" + size: 14 + color: hifi.colors.lightGrayText + verticalAlignment: Text.AlignVCenter + } + + RalewaySemiBold { + id: standaloneOptimizedText + + anchors.top: standaloneLabel.bottom + anchors.left: parent.left + anchors.topMargin: 5 + width: paintedWidth + + text: root.standaloneOptimized ? "This item is stand-alone optimized" : "This item is incompatible with stand-alone devices" + size: 14 + color: hifi.colors.lightGray + verticalAlignment: Text.AlignVCenter + } + } Item { id: descriptionItem property string text: "" anchors { - top: licenseItem.bottom + top: standaloneItem.bottom topMargin: 15 left: parent.left right: parent.right diff --git a/interface/resources/qml/hifi/commerce/marketplace/MarketplaceListItem.qml b/interface/resources/qml/hifi/commerce/marketplace/MarketplaceListItem.qml index 2f37637e40..9da6d8552e 100644 --- a/interface/resources/qml/hifi/commerce/marketplace/MarketplaceListItem.qml +++ b/interface/resources/qml/hifi/commerce/marketplace/MarketplaceListItem.qml @@ -35,7 +35,8 @@ Rectangle { property string category: "" property int price: 0 property bool available: false - property bool isLoggedIn: false; + property bool isLoggedIn: false + property bool standaloneOptimized: false signal buy() signal showItem() @@ -288,8 +289,38 @@ Rectangle { onClicked: root.categoryClicked(root.category); } } + Item { + id: badges + + anchors { + left: parent.left + top: categoryLabel.bottom + right: buyButton.left + } + height: childrenRect.height + + HiFiGlyphs { + id: standaloneOptomizedBadge + + anchors { + left: parent.left + leftMargin: 15 + verticalCenter: parent.verticalCenter + + } + height: 24 + + visible: root.standaloneOptimized + + text: hifi.glyphs.hmd + size: 24 + horizontalAlignment: Text.AlignHCenter + color: hifi.colors.blueHighlight + } + } HifiControlsUit.Button { + id: buyButton anchors { right: parent.right top: parent.top diff --git a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml index df6e216b32..ec49b596bc 100644 --- a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml +++ b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml @@ -50,6 +50,8 @@ Item { property string upgradeTitle; property bool updateAvailable: root.updateItemId && root.updateItemId !== ""; property bool valid; + property bool standaloneOptimized; + property bool standaloneIncompatible; property string originalStatusText; property string originalStatusColor; @@ -838,6 +840,25 @@ Item { root.sendToPurchases({ method: 'flipCard' }); } } + } + + HiFiGlyphs { + id: standaloneOptomizedBadge + + anchors { + right: parent.right + bottom: parent.bottom + rightMargin: 15 + bottomMargin:12 + } + height: root.standaloneOptimized ? 34 : 0 + + visible: root.standaloneOptimized + + text: hifi.glyphs.hmd + size: 34 + horizontalAlignment: Text.AlignHCenter + color: hifi.colors.blueHighlight } } diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index dc892e6640..a5446202a8 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -553,6 +553,8 @@ Rectangle { upgradeTitle: model.upgrade_title; itemType: model.item_type; valid: model.valid; + standaloneOptimized: model.standalone_optimized + standaloneIncompatible: model.standalone_incompatible anchors.topMargin: 10; anchors.bottomMargin: 10;