Hide tooltips when window not hovered anymore
This commit is contained in:
		@@ -11,6 +11,10 @@ ToolTip {
 | 
				
			|||||||
    property alias label: label
 | 
					    property alias label: label
 | 
				
			||||||
    property alias backgroundColor: background.color
 | 
					    property alias backgroundColor: background.color
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    readonly property bool hideNow: visible && ! window.hovered
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    onHideNowChanged: if (hideNow) toolTip.hide()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    background: Rectangle {
 | 
					    background: Rectangle {
 | 
				
			||||||
        id: background
 | 
					        id: background
 | 
				
			||||||
@@ -46,7 +50,7 @@ ToolTip {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TapHandler {
 | 
					    TapHandler {
 | 
				
			||||||
        onTapped: { toolTip.hide() }
 | 
					        onTapped: toolTip.hide()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    HoverHandler {
 | 
					    HoverHandler {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -13,6 +13,8 @@ ApplicationWindow {
 | 
				
			|||||||
    color: "transparent"
 | 
					    color: "transparent"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    readonly property alias hovered: windowHover.hovered
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    readonly property bool hidden:
 | 
					    readonly property bool hidden:
 | 
				
			||||||
            Qt.application.state == Qt.ApplicationSuspended ||
 | 
					            Qt.application.state == Qt.ApplicationSuspended ||
 | 
				
			||||||
            Qt.application.state == Qt.ApplicationHidden ||
 | 
					            Qt.application.state == Qt.ApplicationHidden ||
 | 
				
			||||||
@@ -36,8 +38,11 @@ ApplicationWindow {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    readonly property alias py: py
 | 
					    readonly property alias py: py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    Python { id: py }
 | 
					    Python { id: py }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    HoverHandler { id: windowHover }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    HLoader {
 | 
					    HLoader {
 | 
				
			||||||
        anchors.fill: parent
 | 
					        anchors.fill: parent
 | 
				
			||||||
        source: py.ready ? "" : "LoadingScreen.qml"
 | 
					        source: py.ready ? "" : "LoadingScreen.qml"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user