From 51d56ddf22ffd2cedb2ab26f9da6ffc981debf02 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 26 Oct 2018 12:17:04 +1300 Subject: [PATCH] Make tablet page indicators clickable to scroll tablet --- .../resources/qml/hifi/tablet/TabletHome.qml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletHome.qml b/interface/resources/qml/hifi/tablet/TabletHome.qml index 1922b02f93..c2dd847821 100644 --- a/interface/resources/qml/hifi/tablet/TabletHome.qml +++ b/interface/resources/qml/hifi/tablet/TabletHome.qml @@ -251,17 +251,29 @@ Item { height: 15 Rectangle { + property bool isHovered: false anchors.centerIn: parent - opacity: index === pageIndicator.currentIndex ? 0.95 : 0.45 - implicitWidth: index === pageIndicator.currentIndex ? 15 : 10 + opacity: index === pageIndicator.currentIndex || isHovered ? 0.95 : 0.45 + implicitWidth: index === pageIndicator.currentIndex || isHovered ? 15 : 10 implicitHeight: implicitWidth radius: width/2 - color: "white" + color: isHovered && index !== pageIndicator.currentIndex ? "#1fc6a6" : "white" Behavior on opacity { OpacityAnimator { duration: 100 } } + + MouseArea { + anchors.centerIn: parent + width: 20 + height: 30 // Make it easier to target with laser. + hoverEnabled: true + enabled: true + onEntered: parent.isHovered = true; + onExited: parent.isHovered = false; + onClicked: swipeView.currentIndex = index; + } } }