From 43e045c22acae96d64f453dd74cd0d1a3f932a6b Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Thu, 14 Jul 2016 17:45:49 -0700 Subject: [PATCH] Restore mouseover events for items in windows --- interface/resources/qml/hifi/toolbars/Toolbar.qml | 14 +------------- interface/resources/qml/windows/Decoration.qml | 8 ++++++-- interface/resources/qml/windows/Window.qml | 4 ---- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/interface/resources/qml/hifi/toolbars/Toolbar.qml b/interface/resources/qml/hifi/toolbars/Toolbar.qml index 4e7eef62d5..30989be688 100644 --- a/interface/resources/qml/hifi/toolbars/Toolbar.qml +++ b/interface/resources/qml/hifi/toolbars/Toolbar.qml @@ -20,19 +20,7 @@ Window { width: content.width height: content.height // Disable this window from being able to call 'desktop.raise() and desktop.showDesktop' - activator: MouseArea { - width: frame.decoration ? frame.decoration.width : window.width - height: frame.decoration ? frame.decoration.height : window.height - x: frame.decoration ? frame.decoration.anchors.leftMargin : 0 - y: frame.decoration ? frame.decoration.anchors.topMargin : 0 - propagateComposedEvents: true - acceptedButtons: Qt.AllButtons - enabled: window.visible - hoverEnabled: true - onPressed: mouse.accepted = false; - onEntered: window.mouseEntered(); - onExited: window.mouseExited(); - } + activator: Item {} property bool horizontal: true property real buttonSize: 50; property var buttons: [] diff --git a/interface/resources/qml/windows/Decoration.qml b/interface/resources/qml/windows/Decoration.qml index edfb369c0f..0048c556eb 100644 --- a/interface/resources/qml/windows/Decoration.qml +++ b/interface/resources/qml/windows/Decoration.qml @@ -43,15 +43,19 @@ Rectangle { // Enable dragging of the window, // detect mouseover of the window (including decoration) MouseArea { + id: decorationMouseArea anchors.fill: parent drag.target: window + hoverEnabled: true + onEntered: window.mouseEntered(); + onExited: window.mouseExited(); } Connections { target: window onMouseEntered: { if (desktop.hmdHandMouseActive) { root.inflateDecorations() - } + } } onMouseExited: root.deflateDecorations(); } @@ -59,7 +63,7 @@ Rectangle { target: desktop onHmdHandMouseActiveChanged: { if (desktop.hmdHandMouseActive) { - if (window.activator.containsMouse) { + if (decorationMouseArea.containsMouse) { root.inflateDecorations(); } } else { diff --git a/interface/resources/qml/windows/Window.qml b/interface/resources/qml/windows/Window.qml index ca37c55f4d..c873872692 100644 --- a/interface/resources/qml/windows/Window.qml +++ b/interface/resources/qml/windows/Window.qml @@ -115,14 +115,10 @@ Fadable { propagateComposedEvents: true acceptedButtons: Qt.AllButtons enabled: window.visible - hoverEnabled: true onPressed: { - //console.log("Pressed on activator area"); window.raise(); mouse.accepted = false; } - onEntered: window.mouseEntered(); - onExited: window.mouseExited(); } // This mouse area serves to swallow mouse events while the mouse is over the window