From 17549348b4a9c4bcb59a721d6961456105fa6731 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Thu, 22 Sep 2016 16:48:16 -0700 Subject: [PATCH] less busy hotspotting, and make use of restricted feed (by protocol) --- interface/resources/images/concurrency.svg | 53 +++++++++++ interface/resources/images/snapshot.svg | 96 ++++++-------------- interface/resources/qml/AddressBarDialog.qml | 7 +- interface/resources/qml/hifi/Card.qml | 71 ++++----------- 4 files changed, 106 insertions(+), 121 deletions(-) create mode 100644 interface/resources/images/concurrency.svg diff --git a/interface/resources/images/concurrency.svg b/interface/resources/images/concurrency.svg new file mode 100644 index 0000000000..b9e76e7d55 --- /dev/null +++ b/interface/resources/images/concurrency.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/images/snapshot.svg b/interface/resources/images/snapshot.svg index 497db433d9..7b3da80f3c 100644 --- a/interface/resources/images/snapshot.svg +++ b/interface/resources/images/snapshot.svg @@ -1,75 +1,33 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/interface/resources/qml/AddressBarDialog.qml b/interface/resources/qml/AddressBarDialog.qml index ae33eeb1d9..0bbe053897 100644 --- a/interface/resources/qml/AddressBarDialog.qml +++ b/interface/resources/qml/AddressBarDialog.qml @@ -290,7 +290,12 @@ Window { // could also require right protocolVersion } function getUserStoryPage(pageNumber, cb) { // cb(error) after all pages of domain data have been added to model - var url = metaverseBase + 'user_stories?include_actions=snapshot,concurrency&page=' + pageNumber; + var options = [ + 'include_actions=snapshot,concurrency', + 'protocol=' + encodeURIComponent(AddressManager.protocolVersion()), + 'page=' + pageNumber + ]; + var url = metaverseBase + 'user_stories?' + options.join('&'); getRequest(url, function (error, data) { if (handleError(url, error, data, cb)) { return; diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index c819787f99..8c1b78af79 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -14,6 +14,7 @@ import Hifi 1.0 import QtQuick 2.5 import QtGraphicalEffects 1.0 +import "toolbars" import "../styles-uit" Rectangle { @@ -25,12 +26,11 @@ Rectangle { property string thumbnail: defaultThumbnail; property var goFunction: null; property string storyId: ""; - property bool isConcurrency: action === 'concurrency'; property string timePhrase: pastTime(timestamp); property int onlineUsers: 0; - property int textPadding: 20; + property int textPadding: 10; property int textSize: 24; property int textSizeSmall: 18; property string defaultThumbnail: Qt.resolvedUrl("../../images/default-domain.gif"); @@ -89,7 +89,6 @@ Rectangle { color: hifi.colors.black; spread: dropSpread; } - property bool usersVisible: true; DropShadow { visible: users.visible && desktop.gradientsSupported; source: users; @@ -112,44 +111,18 @@ Rectangle { margins: textPadding; } } - RalewayRegular { + FiraSansRegular { id: users; - visible: usersVisible && isConcurrency; - text: onlineUsers + ((onlineUsers === 1) ? ' person' : ' people'); - size: textSizeSmall; + visible: action === 'concurrency'; + text: onlineUsers; + size: textSize; color: hifi.colors.white; anchors { - bottom: parent.bottom; - right: parent.right; + verticalCenter: usersImage.verticalCenter; + right: usersImage.left; margins: textPadding; } } - Image { - id: usersImage; - source: "../../images/" + action + ".svg"; - width: 100; - fillMode: Image.PreserveAspectFit; - visible: usersVisible && !isConcurrency; - anchors { - bottom: parent.bottom; - right: parent.right; - margins: textPadding; - } - } - Image { - id: placeInfo; - source: "../../images/more-info.svg" - anchors.fill: place; - fillMode: Image.PreserveAspectFit; - visible: false; - } - Image { - id: usersInfo; - source: "../../images/more-info.svg" - anchors.fill: users; - fillMode: Image.PreserveAspectFit; - visible: false; - } // These two can be supplied to provide hover behavior. // For example, AddressBarDialog provides functions that set the current list view item // to that which is being hovered over. @@ -164,22 +137,18 @@ Rectangle { onEntered: hoverThunk(); onExited: unhoverThunk(); } - MouseArea { - id: placeMouseArea; - anchors.fill: place; - acceptedButtons: Qt.LeftButton; - onClicked: goFunction("/places/" + placeName); - hoverEnabled: true; - onEntered: { place.visible = false; placeInfo.visible = true; } - onExited: { placeInfo.visible = false; place.visible = true; } - } - MouseArea { - id: usersMouseArea; - anchors.fill: users; - acceptedButtons: Qt.LeftButton; + ToolbarButton { + id: usersImage; + imageURL: "../../images/" + action + ".svg"; + size: 32; onClicked: goFunction("/user_stories/" + storyId); - hoverEnabled: true; - onEntered: { usersVisible = false; usersInfo.visible = true; } - onExited: { usersInfo.visible = false; usersVisible = true; } + buttonState: 0; + defaultState: 0; + hoverState: 1; + anchors { + bottom: parent.bottom; + right: parent.right; + margins: textPadding; + } } }