Merge pull request #16107 from zfox23/emoteTrayLock

BUGZ-1342: Add lock icon to Emote tray when it's locked open; Make tray close when unlocking it
This commit is contained in:
Zach Fox 2019-08-27 14:44:21 -07:00 committed by GitHub
commit 796bfb5d67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 2 deletions

View file

@ -139,6 +139,28 @@ Rectangle {
opacity: emoteIndicator.source.toString().indexOf("Icon.svg") > -1 ? 1.0 : 0.0
}
Image {
id: lockIcon
width: 12
height: 12
anchors.top: parent.top
anchors.topMargin: 2
anchors.left: parent.left
anchors.leftMargin: 0
source: "images/lock_Icon.svg"
fillMode: Image.PreserveAspectFit
mipmap: true
visible: false
}
ColorOverlay {
id: lockIconColorOverlay
anchors.fill: lockIcon
source: lockIcon
color: "#ffffff"
visible: drawerContainer.keepDrawerExpanded
}
MouseArea {
id: emoteIndicatorMouseArea
anchors.fill: parent
@ -147,14 +169,21 @@ Rectangle {
onClicked: {
Tablet.playSound(TabletEnums.ButtonClick);
drawerContainer.keepDrawerExpanded = !drawerContainer.keepDrawerExpanded;
// If the drawer is no longer expanded, disable this MouseArea (which will close
// the emote tray) until the user's cursor leaves the MouseArea (see `onExited()` below).
if (!drawerContainer.keepDrawerExpanded) {
emoteIndicatorMouseArea.enabled = false;
}
}
onEntered: {
Tablet.playSound(TabletEnums.ButtonHover);
}
}
onExited: {
emoteIndicatorMouseArea.enabled = true;
}
}
}
Row {

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 42 64" style="enable-background:new 0 0 42 64;" xml:space="preserve">
<path d="M36.8,22.8v-7.1C36.8,7,29.7,0,21,0S5.2,7,5.2,15.7v7.1C2.2,23.8,0,26.7,0,30v26.3C0,60.5,3.5,64,7.8,64h26.5
c4.3,0,7.8-3.5,7.8-7.7V30C42,26.7,39.8,23.8,36.8,22.8z M27.1,50.5c0,3.3-2.8,6.1-6.1,6.1s-6.1-2.7-6.1-6.1v-2.3
c0-3.3,2.8-6.1,6.1-6.1s6.1,2.7,6.1,6.1V50.5z M30,22.4H12v-6.7c0-4.9,4-8.9,9-8.9s9,4,9,8.9V22.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 686 B