mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
revert "mouseExited" parameter: it was extremely unreliable anyway
GitOrigin-RevId: fe89a162ddfaae6d277a635b832358fcedfa5265
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b159b9f730
commit
7e688f9f7b
+2
-4
@@ -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)
|
||||
|
||||
+2
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user