From 1188a528e1f5de7e736785c549a6243523cd730f Mon Sep 17 00:00:00 2001 From: Nikolay Rykunov Date: Mon, 23 Oct 2023 14:46:44 +0200 Subject: [PATCH 1/2] Make lastActiveItemIndex public, so selection on hover can be implemented --- .../jetbrains/jewel/foundation/lazy/SelectableLazyListState.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/SelectableLazyListState.kt b/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/SelectableLazyListState.kt index 4bd726ba7..8e54675a1 100644 --- a/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/SelectableLazyListState.kt +++ b/foundation/src/main/kotlin/org/jetbrains/jewel/foundation/lazy/SelectableLazyListState.kt @@ -35,7 +35,7 @@ class SelectableLazyListState( internal var lastKeyEventUsedMouse: Boolean = false override var selectedKeys by mutableStateOf(emptyList()) - internal var lastActiveItemIndex: Int? = null + var lastActiveItemIndex: Int? = null /** * From 6d5cac61079dcdc1fdfcb1103ab881ff28207a7d Mon Sep 17 00:00:00 2001 From: Nikolay Rykunov Date: Mon, 23 Oct 2023 14:56:47 +0200 Subject: [PATCH 2/2] Update foundation.api --- foundation/api/foundation.api | 2 ++ 1 file changed, 2 insertions(+) diff --git a/foundation/api/foundation.api b/foundation/api/foundation.api index 70c588d63..926f7f2d0 100644 --- a/foundation/api/foundation.api +++ b/foundation/api/foundation.api @@ -296,6 +296,7 @@ public final class org/jetbrains/jewel/foundation/lazy/SelectableLazyListState : public final fun getFirstVisibleItemIndex ()I public final fun getFirstVisibleItemScrollOffset ()I public final fun getInteractionSource ()Landroidx/compose/foundation/interaction/InteractionSource; + public final fun getLastActiveItemIndex ()Ljava/lang/Integer; public final fun getLayoutInfo ()Landroidx/compose/foundation/lazy/LazyListLayoutInfo; public final fun getLazyListState ()Landroidx/compose/foundation/lazy/LazyListState; public fun getSelectedKeys ()Ljava/util/List; @@ -303,6 +304,7 @@ public final class org/jetbrains/jewel/foundation/lazy/SelectableLazyListState : public fun scroll (Landroidx/compose/foundation/MutatePriority;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public final fun scrollToItem (IZILkotlin/coroutines/Continuation;)Ljava/lang/Object; public static synthetic fun scrollToItem$default (Lorg/jetbrains/jewel/foundation/lazy/SelectableLazyListState;IZILkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public final fun setLastActiveItemIndex (Ljava/lang/Integer;)V public fun setSelectedKeys (Ljava/util/List;)V }