From 8e9b743515aade784c2dc615d25206cb3419af99 Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 21 Sep 2016 19:15:01 -0700 Subject: [PATCH] rollover images --- interface/resources/images/more-info.svg | 96 ++++++++++++++++++++++++ interface/resources/images/snapshot.svg | 75 ++++++++++++++++++ interface/resources/qml/hifi/Card.qml | 41 ++++++++-- 3 files changed, 206 insertions(+), 6 deletions(-) create mode 100644 interface/resources/images/more-info.svg create mode 100644 interface/resources/images/snapshot.svg diff --git a/interface/resources/images/more-info.svg b/interface/resources/images/more-info.svg new file mode 100644 index 0000000000..48e4d46f3a --- /dev/null +++ b/interface/resources/images/more-info.svg @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/images/snapshot.svg b/interface/resources/images/snapshot.svg new file mode 100644 index 0000000000..497db433d9 --- /dev/null +++ b/interface/resources/images/snapshot.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/qml/hifi/Card.qml b/interface/resources/qml/hifi/Card.qml index fc28ecc197..c819787f99 100644 --- a/interface/resources/qml/hifi/Card.qml +++ b/interface/resources/qml/hifi/Card.qml @@ -25,6 +25,7 @@ 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; @@ -88,8 +89,9 @@ Rectangle { color: hifi.colors.black; spread: dropSpread; } + property bool usersVisible: true; DropShadow { - visible: desktop.gradientsSupported; + visible: users.visible && desktop.gradientsSupported; source: users; anchors.fill: users; horizontalOffset: dropHorizontalOffset; @@ -112,7 +114,8 @@ Rectangle { } RalewayRegular { id: users; - text: (action === 'concurrency') ? (onlineUsers + ((onlineUsers === 1) ? ' person' : ' people')) : action; + visible: usersVisible && isConcurrency; + text: onlineUsers + ((onlineUsers === 1) ? ' person' : ' people'); size: textSizeSmall; color: hifi.colors.white; anchors { @@ -121,6 +124,32 @@ Rectangle { 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. @@ -141,8 +170,8 @@ Rectangle { acceptedButtons: Qt.LeftButton; onClicked: goFunction("/places/" + placeName); hoverEnabled: true; - onEntered: place.color = hifi.colors.blueHighlight; - onExited: place.color = hifi.colors.white; + onEntered: { place.visible = false; placeInfo.visible = true; } + onExited: { placeInfo.visible = false; place.visible = true; } } MouseArea { id: usersMouseArea; @@ -150,7 +179,7 @@ Rectangle { acceptedButtons: Qt.LeftButton; onClicked: goFunction("/user_stories/" + storyId); hoverEnabled: true; - onEntered: users.color = hifi.colors.blueHighlight; - onExited: users.color = hifi.colors.white; + onEntered: { usersVisible = false; usersInfo.visible = true; } + onExited: { usersInfo.visible = false; usersVisible = true; } } }