From 7e688f9f7b39747af8204efec3288f6d52c7d1ac Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 3 Jul 2019 17:30:05 +0300 Subject: [PATCH] revert "mouseExited" parameter: it was extremely unreliable anyway GitOrigin-RevId: fe89a162ddfaae6d277a635b832358fcedfa5265 --- .../hints/presentation/ChangeOnHoverPresentation.kt | 6 ++---- .../codeInsight/hints/presentation/PresentationFactory.kt | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/ChangeOnHoverPresentation.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/ChangeOnHoverPresentation.kt index 994c03c843c3..8196fba6316e 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/ChangeOnHoverPresentation.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/ChangeOnHoverPresentation.kt @@ -10,10 +10,9 @@ import java.awt.event.MouseEvent * @param onHoverPredicate predicate, that considers state is hovered (additional to fact, that it is in bounds) */ class ChangeOnHoverPresentation( - private val noHover: InlayPresentation, + val noHover: InlayPresentation, private val hover: () -> InlayPresentation, - private val onHoverPredicate: (MouseEvent) -> Boolean = { true }, - private val onMouseExited: () -> Unit = {} + private val onHoverPredicate: (MouseEvent) -> Boolean = { true } ) : StatefulPresentation(State(false), STATE_MARK) { override fun getPresentation(): InlayPresentation = when (state.isInside) { true -> hover() @@ -43,7 +42,6 @@ class ChangeOnHoverPresentation( if (state.isInside) { state = State(false) } - onMouseExited() } data class State(val isInside: Boolean) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/PresentationFactory.kt b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/PresentationFactory.kt index 1c525c349808..f3cfc425f2b8 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/PresentationFactory.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/hints/presentation/PresentationFactory.kt @@ -245,9 +245,8 @@ class PresentationFactory(private val editor: EditorImpl) { fun changeOnHover( base: InlayPresentation, onHover: () -> InlayPresentation, - onHoverPredicate: (MouseEvent) -> Boolean = { true }, - onMouseExited: () -> Unit = {} - ): InlayPresentation = ChangeOnHoverPresentation(base, onHover, onHoverPredicate, onMouseExited) + onHoverPredicate: (MouseEvent) -> Boolean = { true } + ): InlayPresentation = ChangeOnHoverPresentation(base, onHover, onHoverPredicate) @Contract(pure = true) fun reference(base: InlayPresentation, onClickAction: () -> Unit): InlayPresentation {