From bd719286d8049a85263e3b88bb119646c427875c Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Fri, 27 Apr 2018 13:10:58 +0300 Subject: [PATCH] move highlight under the green wearable indicator, use internal highlight of ShadowImage instead of extra Rectangle --- interface/resources/qml/hifi/AvatarApp.qml | 17 ++++++----------- .../qml/hifi/avatarapp/AvatarThumbnail.qml | 3 +++ .../qml/hifi/avatarapp/ShadowImage.qml | 1 + 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/AvatarApp.qml b/interface/resources/qml/hifi/AvatarApp.qml index 38a9ea2bb9..a7eb96ed94 100644 --- a/interface/resources/qml/hifi/AvatarApp.qml +++ b/interface/resources/qml/hifi/AvatarApp.qml @@ -467,9 +467,13 @@ Rectangle { } ] + property bool highlighted: delegateRoot.GridView.isCurrentItem + AvatarThumbnail { id: favoriteAvatarImage imageUrl: url + border.color: container.highlighted ? style.colors.blueHighlight : 'transparent' + border.width: container.highlighted ? 2 : 0 wearablesCount: (wearables && wearables !== '') ? wearables.split('|').length : 0 onWearablesCountChanged: { console.debug('delegate: AvatarThumbnail.wearablesCount: ', wearablesCount) @@ -546,26 +550,17 @@ Rectangle { } } - Rectangle { - id: highlight - anchors.fill: favoriteAvatarImage - visible: delegateRoot.GridView.isCurrentItem - color: 'transparent' - border.width: 2 - border.color: style.colors.blueHighlight - } - Colorize { anchors.fill: favoriteAvatarImage source: favoriteAvatarImage saturation: 0.2 - visible: isInManageState && !highlight.visible + visible: isInManageState && !container.highlighted } HiFiGlyphs { anchors.fill: parent text: "{" - visible: isInManageState && !highlight.visible + visible: isInManageState && !container.highlighted horizontalAlignment: Text.AlignHCenter size: 56 } diff --git a/interface/resources/qml/hifi/avatarapp/AvatarThumbnail.qml b/interface/resources/qml/hifi/avatarapp/AvatarThumbnail.qml index d19e6395ed..e70ee6af1d 100644 --- a/interface/resources/qml/hifi/avatarapp/AvatarThumbnail.qml +++ b/interface/resources/qml/hifi/avatarapp/AvatarThumbnail.qml @@ -3,6 +3,7 @@ import QtQuick 2.9 Item { width: 92 height: 92 + property alias wearableIndicator: indicator property int wearablesCount: 0 onWearablesCountChanged: { @@ -14,6 +15,7 @@ Item { property alias dropShadowVerticalOffset: avatarImage.dropShadowVerticalOffset property alias imageUrl: avatarImage.source + property alias border: avatarImage.border ShadowImage { id: avatarImage @@ -22,6 +24,7 @@ Item { } AvatarWearablesIndicator { + id: indicator anchors.left: avatarImage.left anchors.bottom: avatarImage.bottom anchors.leftMargin: 57 diff --git a/interface/resources/qml/hifi/avatarapp/ShadowImage.qml b/interface/resources/qml/hifi/avatarapp/ShadowImage.qml index 08552c12eb..be2089048c 100644 --- a/interface/resources/qml/hifi/avatarapp/ShadowImage.qml +++ b/interface/resources/qml/hifi/avatarapp/ShadowImage.qml @@ -8,6 +8,7 @@ Item { property alias dropShadowHorizontalOffset: shadow.horizontalOffset property alias dropShadowVerticalOffset: shadow.verticalOffset property alias radius: image.radius + property alias border: image.border RoundImage { id: image