switch over to metaverse server user story cards

This commit is contained in:
howard-stearns 2016-08-19 16:40:53 -07:00
parent 1e08914f8d
commit 993340811f
2 changed files with 2 additions and 110 deletions
interface/resources/qml

View file

@ -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;

View file

@ -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;
}
}
}
}