From 3a537cdcc32067673234604cceec410b5b9562b8 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Thu, 28 Sep 2017 13:21:55 -0700 Subject: [PATCH] Make usernameDropdown collapse when clicking anywhere outside it --- .../resources/qml/hifi/commerce/checkout/Checkout.qml | 7 +++++++ .../qml/hifi/commerce/common/EmulatedMarketplaceHeader.qml | 1 + .../resources/qml/hifi/commerce/purchases/Purchases.qml | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index 182a8df055..fe3e9fd78f 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -176,6 +176,13 @@ Rectangle { } } } + MouseArea { + enabled: titleBarContainer.usernameDropdownVisible; + anchors.fill: parent; + onClicked: { + titleBarContainer.usernameDropdownVisible = false; + } + } // // TITLE BAR END // diff --git a/interface/resources/qml/hifi/commerce/common/EmulatedMarketplaceHeader.qml b/interface/resources/qml/hifi/commerce/common/EmulatedMarketplaceHeader.qml index 5786350721..9e52b2c50a 100644 --- a/interface/resources/qml/hifi/commerce/common/EmulatedMarketplaceHeader.qml +++ b/interface/resources/qml/hifi/commerce/common/EmulatedMarketplaceHeader.qml @@ -27,6 +27,7 @@ Item { id: root; property string referrerURL: "https://metaverse.highfidelity.com/marketplace?"; readonly property int additionalDropdownHeight: usernameDropdown.height - myUsernameButton.anchors.bottomMargin; + property alias usernameDropdownVisible: usernameDropdown.visible; height: mainContainer.height + additionalDropdownHeight; diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index 5e0c7b9e99..7983ab5211 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -179,6 +179,13 @@ Rectangle { } } } + MouseArea { + enabled: titleBarContainer.usernameDropdownVisible; + anchors.fill: parent; + onClicked: { + titleBarContainer.usernameDropdownVisible = false; + } + } // // TITLE BAR END //