From 993340811f8c409d042f7dcda3bf96aef15033d9 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 19 Aug 2016 16:40:53 -0700 Subject: [PATCH] switch over to metaverse server user story cards --- interface/resources/qml/AddressBarDialog.qml | 29 +------ .../resources/qml/hifi/UserStoryCard.qml | 83 ------------------- 2 files changed, 2 insertions(+), 110 deletions(-) delete mode 100644 interface/resources/qml/hifi/UserStoryCard.qml diff --git a/interface/resources/qml/AddressBarDialog.qml b/interface/resources/qml/AddressBarDialog.qml index b61b4111d6..f7937f30e6 100644 --- a/interface/resources/qml/AddressBarDialog.qml +++ b/interface/resources/qml/AddressBarDialog.qml @@ -52,18 +52,8 @@ Window { } function goCard(card) { if (addressBarDialog.useFeed) { - if (useHTML) { - storyCardHTML.url = metaverseBase + "user_stories/" + card.storyId + ".html"; - storyCardFrame.shown = true; - } else { - storyCardQML.imageUrl = card.imageUrl; - storyCardQML.userName = card.userName; - storyCardQML.placeName = card.placeName; - storyCardQML.actionPhrase = card.actionPhrase; - storyCardQML.timePhrase = card.timePhrase; - storyCardQML.hifiUrl = card.hifiUrl; - storyCardQML.visible = true; - } + storyCardHTML.url = addressBarDialog.metaverseServerUrl + "/user_stories/" + card.storyId; + storyCardFrame.shown = true; return; } addressLine.text = card.hifiUrl; @@ -74,7 +64,6 @@ Window { property int cardWidth: 200; property int cardHeight: 152; property string metaverseBase: addressBarDialog.metaverseServerUrl + "/api/v1/"; - property bool useHTML: false; // fixme: remove this and all false branches after the server is updated AddressBarDialog { id: addressBarDialog @@ -227,20 +216,6 @@ Window { } } - UserStoryCard { - id: storyCardQML; - visible: false; - visitPlace: function (hifiUrl) { - storyCardQML.visible = false; - addressLine.text = hifiUrl; - toggleOrGo(true); - }; - anchors { - verticalCenter: scroll.verticalCenter; - horizontalCenter: scroll.horizontalCenter; - verticalCenterOffset: 50; - } - } Window { width: 750; height: 360; diff --git a/interface/resources/qml/hifi/UserStoryCard.qml b/interface/resources/qml/hifi/UserStoryCard.qml deleted file mode 100644 index ef8b03d406..0000000000 --- a/interface/resources/qml/hifi/UserStoryCard.qml +++ /dev/null @@ -1,83 +0,0 @@ -// -// UserStoryCard.qml -// qml/hifi -// -// Displays a clickable card representing a user story or destination. -// -// Created by Howard Stearns on 8/11/2016 -// Copyright 2016 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -import Hifi 1.0 -import QtQuick 2.5 -import "../styles-uit" as HifiStyles -import "../controls-uit" as HifiControls - -Rectangle { - id: storyCard; - width: 500; - height: 330; - property string userName: "User"; - property string placeName: "Home"; - property string actionPhrase: "did something"; - property string timePhrase: ""; - property string hifiUrl: storyCard.placeName; - property string imageUrl: Qt.resolvedUrl("../../images/default-domain.gif"); - property var visitPlace: function (ignore) { }; - color: "white"; - HifiStyles.HifiConstants { id: otherHifi } - MouseArea { - anchors.fill: parent; - acceptedButtons: Qt.LeftButton; - onClicked: storyCard.visible = false; - hoverEnabled: true; - // The content of the storyCard has buttons. For these to work without being - // blanketed by the MouseArea, they need to be children of the MouseArea. - Image { - id: storyImage; - source: storyCard.imageUrl; - width: storyCard.width - 100; - height: storyImage.width / 1.91; - fillMode: Image.PreserveAspectCrop; - anchors { - horizontalCenter: parent.horizontalCenter; - top: parent.top; - topMargin: 20; - } - } - HifiStyles.RalewayRegular { - id: storyLabel; - text: storyCard.userName + " " + storyCard.actionPhrase + " in " + storyCard.placeName - size: 20; - color: "black" - anchors { - horizontalCenter: storyImage.horizontalCenter; - top: storyImage.bottom; - topMargin: hifi.layout.spacing - } - } - HifiStyles.RalewayRegular { - text: storyCard.timePhrase; - size: 15; - color: "slategrey" - anchors { - verticalCenter: visitButton.verticalCenter; - left: storyImage.left; - } - } - HifiControls.Button { - id: visitButton; - text: "visit " + storyCard.placeName; - color: otherHifi.buttons.blue; - onClicked: visitPlace(storyCard.hifiUrl); - anchors { - top: storyLabel.bottom; - topMargin: hifi.layout.spacing; - right: storyImage.right; - } - } - } -}