Make usernameDropdown collapse when clicking anywhere outside it

This commit is contained in:
Zach Fox 2017-09-28 13:21:55 -07:00
parent 3742ccbdd3
commit 3a537cdcc3
3 changed files with 15 additions and 0 deletions

View file

@ -176,6 +176,13 @@ Rectangle {
}
}
}
MouseArea {
enabled: titleBarContainer.usernameDropdownVisible;
anchors.fill: parent;
onClicked: {
titleBarContainer.usernameDropdownVisible = false;
}
}
//
// TITLE BAR END
//

View file

@ -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;

View file

@ -179,6 +179,13 @@ Rectangle {
}
}
}
MouseArea {
enabled: titleBarContainer.usernameDropdownVisible;
anchors.fill: parent;
onClicked: {
titleBarContainer.usernameDropdownVisible = false;
}
}
//
// TITLE BAR END
//