mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 15:30:11 +02:00
Restore mouseover events for items in windows
This commit is contained in:
parent
a6d71f508e
commit
43e045c22a
3 changed files with 7 additions and 19 deletions
|
@ -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: []
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue