Add HToolTip.instantToggle(), use for some buttons
Used for buttons that trigger a tooltip instantly: if the tooltip is currently visible, hide it.
This commit is contained in:
		@@ -12,7 +12,7 @@ HButton {
 | 
			
		||||
    iconItem.small: true
 | 
			
		||||
    toolTip.text: helpText
 | 
			
		||||
 | 
			
		||||
    onClicked: toolTip.instantShow()
 | 
			
		||||
    onClicked: toolTip.instantToggle()
 | 
			
		||||
    onActiveFocusChanged: if (! activeFocus && toolTip.visible) toolTip.hide()
 | 
			
		||||
 | 
			
		||||
    Layout.fillHeight: true
 | 
			
		||||
 
 | 
			
		||||
@@ -21,6 +21,10 @@ ToolTip {
 | 
			
		||||
        instant = false
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    function instantToggle(timeout=-1) {
 | 
			
		||||
        visible ? hide() : instantShow(timeout)
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    delay: instant ? 0 : theme.controls.toolTip.delay
 | 
			
		||||
    padding: background.border.width
 | 
			
		||||
 
 | 
			
		||||
@@ -159,7 +159,7 @@ Rectangle {
 | 
			
		||||
                     "unverified devices") :
 | 
			
		||||
                qsTr("All members in this encrypted room are verified")
 | 
			
		||||
 | 
			
		||||
            onClicked: toolTip.instantShow()
 | 
			
		||||
            onClicked: toolTip.instantToggle()
 | 
			
		||||
 | 
			
		||||
            Layout.preferredWidth: chat.roomInfo.encrypted ? avatar.width : 0
 | 
			
		||||
            Layout.fillHeight: true
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user