Tray buttons swap color on hover

This commit is contained in:
RebeccaStankus 2019-08-15 16:44:50 -07:00
parent 98eff6ebb6
commit 876ae771d4

View file

@ -11,6 +11,7 @@
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtGraphicalEffects 1.0
import stylesUit 1.0 as HifiStylesUit import stylesUit 1.0 as HifiStylesUit
import TabletScriptingInterface 1.0 import TabletScriptingInterface 1.0
import hifi.simplifiedUI.simplifiedConstants 1.0 as SimplifiedConstants import hifi.simplifiedUI.simplifiedConstants 1.0 as SimplifiedConstants
@ -59,7 +60,14 @@ Rectangle {
height: 30 height: 30
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
source: "../../resources/images/emote_Icon.svg" source: "images/emote_Icon.svg"
}
ColorOverlay {
anchors.fill: emoteIndicator
opacity: emoteIndicatorMouseArea.containsMouse ? 1.0 : 0.7
source: emoteIndicator
color: "#ffffff"
} }
MouseArea { MouseArea {
@ -102,9 +110,10 @@ Rectangle {
width: mainEmojiContainer.width width: mainEmojiContainer.width
height: drawerContainer.height height: drawerContainer.height
// For the below to work, the This Rectangle's second child must be the `MouseArea` // For the below to work, the This Rectangle's second child must be the `MouseArea`
color: children[1].containsMouse ? "#CCCCCC" : simplifiedUI.colors.white color: children[1].containsMouse ? "#000000" : simplifiedUI.colors.white
Image { Image {
id: emoteTrayButtonImage
width: 30 width: 30
height: 30 height: 30
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -114,6 +123,7 @@ Rectangle {
} }
MouseArea { MouseArea {
id: emoteTrayMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onClicked: { onClicked: {
@ -128,6 +138,13 @@ Rectangle {
Tablet.playSound(TabletEnums.ButtonHover); Tablet.playSound(TabletEnums.ButtonHover);
} }
} }
ColorOverlay {
anchors.fill: emoteTrayButtonImage
opacity: emoteTrayMouseArea.containsMouse ? 1.0 : 0
source: emoteTrayButtonImage
color: "#ffffff"
}
} }
} }
} }