mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 22:22:54 +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
|
width: content.width
|
||||||
height: content.height
|
height: content.height
|
||||||
// Disable this window from being able to call 'desktop.raise() and desktop.showDesktop'
|
// Disable this window from being able to call 'desktop.raise() and desktop.showDesktop'
|
||||||
activator: MouseArea {
|
activator: Item {}
|
||||||
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();
|
|
||||||
}
|
|
||||||
property bool horizontal: true
|
property bool horizontal: true
|
||||||
property real buttonSize: 50;
|
property real buttonSize: 50;
|
||||||
property var buttons: []
|
property var buttons: []
|
||||||
|
|
|
@ -43,8 +43,12 @@ Rectangle {
|
||||||
// Enable dragging of the window,
|
// Enable dragging of the window,
|
||||||
// detect mouseover of the window (including decoration)
|
// detect mouseover of the window (including decoration)
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
id: decorationMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
drag.target: window
|
drag.target: window
|
||||||
|
hoverEnabled: true
|
||||||
|
onEntered: window.mouseEntered();
|
||||||
|
onExited: window.mouseExited();
|
||||||
}
|
}
|
||||||
Connections {
|
Connections {
|
||||||
target: window
|
target: window
|
||||||
|
@ -59,7 +63,7 @@ Rectangle {
|
||||||
target: desktop
|
target: desktop
|
||||||
onHmdHandMouseActiveChanged: {
|
onHmdHandMouseActiveChanged: {
|
||||||
if (desktop.hmdHandMouseActive) {
|
if (desktop.hmdHandMouseActive) {
|
||||||
if (window.activator.containsMouse) {
|
if (decorationMouseArea.containsMouse) {
|
||||||
root.inflateDecorations();
|
root.inflateDecorations();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -115,14 +115,10 @@ Fadable {
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
enabled: window.visible
|
enabled: window.visible
|
||||||
hoverEnabled: true
|
|
||||||
onPressed: {
|
onPressed: {
|
||||||
//console.log("Pressed on activator area");
|
|
||||||
window.raise();
|
window.raise();
|
||||||
mouse.accepted = false;
|
mouse.accepted = false;
|
||||||
}
|
}
|
||||||
onEntered: window.mouseEntered();
|
|
||||||
onExited: window.mouseExited();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This mouse area serves to swallow mouse events while the mouse is over the window
|
// This mouse area serves to swallow mouse events while the mouse is over the window
|
||||||
|
|
Loading…
Reference in a new issue