revert "mouseExited" parameter: it was extremely unreliable anyway

GitOrigin-RevId: fe89a162ddfaae6d277a635b832358fcedfa5265
This commit is contained in:
Alexey Kudravtsev
2019-07-03 18:50:15 +03:00
committed by intellij-monorepo-bot
parent b159b9f730
commit 7e688f9f7b
2 changed files with 4 additions and 7 deletions
@@ -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<ChangeOnHoverPresentation.State>(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)
@@ -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 {