From 74320fe7be5c1ed0a8f9bc2160d1dceb3e523523 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 8 Mar 2019 17:24:43 -0800 Subject: [PATCH] Case 20622 - Qml Marketplace - Fix categories dropdown UI issues --- .../hifi/commerce/marketplace/Marketplace.qml | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml b/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml index 07ded49956..6f8150028a 100644 --- a/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml +++ b/interface/resources/qml/hifi/commerce/marketplace/Marketplace.qml @@ -382,6 +382,7 @@ Rectangle { id: categoriesDropdown anchors.fill: parent; + anchors.topMargin: 2 visible: false z: 10 @@ -420,6 +421,7 @@ Rectangle { model: categoriesModel delegate: ItemDelegate { + id: categoriesItemDelegate height: 34 width: parent.width @@ -431,6 +433,8 @@ Rectangle { color: hifi.colors.white visible: true + border.color: hifi.colors.blueHighlight + border.width: 0 RalewayRegular { id: categoriesItemText @@ -439,7 +443,7 @@ Rectangle { anchors.fill:parent text: model.name - color: ListView.isCurrentItem ? hifi.colors.lightBlueHighlight : hifi.colors.baseGray + color: categoriesItemDelegate.ListView.isCurrentItem ? hifi.colors.blueHighlight : hifi.colors.baseGray horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter size: 14 @@ -449,16 +453,22 @@ Rectangle { MouseArea { anchors.fill: parent z: 10 - hoverEnabled: true propagateComposedEvents: false - onEntered: { - categoriesItem.color = ListView.isCurrentItem ? hifi.colors.white : hifi.colors.lightBlueHighlight; + onPositionChanged: { + // Must use onPositionChanged and not onEntered + // due to a QML bug where a mouseenter event was + // being fired on open of the categories list even + // though the mouse was outside the borders + categoriesItem.border.width = 2; + } + onExited: { + categoriesItem.border.width = 0; } - onExited: { - categoriesItem.color = ListView.isCurrentItem ? hifi.colors.lightBlueHighlight : hifi.colors.white; + onCanceled: { + categoriesItem.border.width = 0; } onClicked: {