Skip to content

Commit

Permalink
Make DefaultTreeViewPointerEventAction open and annotate notifyItemCl…
Browse files Browse the repository at this point in the history
…icked with @InternalJewelApi. Additionally, adjust the key event handling in BasicSelectableLazyColumn to ensure proper return values, enhancing interaction behavior.
  • Loading branch information
fscarponi committed Oct 10, 2024
1 parent 455696a commit 6e66a70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion foundation/api/foundation.api
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,11 @@ public class org/jetbrains/jewel/foundation/lazy/tree/DefaultTreeViewOnKeyEvent
public fun onSelectPreviousItem (Ljava/util/List;Lorg/jetbrains/jewel/foundation/lazy/SelectableLazyListState;)V
}

public final class org/jetbrains/jewel/foundation/lazy/tree/DefaultTreeViewPointerEventAction : org/jetbrains/jewel/foundation/lazy/tree/DefaultSelectableLazyColumnEventAction {
public class org/jetbrains/jewel/foundation/lazy/tree/DefaultTreeViewPointerEventAction : org/jetbrains/jewel/foundation/lazy/tree/DefaultSelectableLazyColumnEventAction {
public static final field $stable I
public fun <init> (Lorg/jetbrains/jewel/foundation/lazy/tree/TreeState;)V
public fun handlePointerEventPress (Landroidx/compose/ui/input/pointer/PointerEvent;Lorg/jetbrains/jewel/foundation/lazy/SelectableColumnKeybindings;Lorg/jetbrains/jewel/foundation/lazy/SelectableLazyListState;Lorg/jetbrains/jewel/foundation/lazy/SelectionMode;Ljava/util/List;Ljava/lang/Object;)V
public final fun notifyItemClicked (Lorg/jetbrains/jewel/foundation/lazy/tree/Tree$Element;Lkotlinx/coroutines/CoroutineScope;JLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V
}

public abstract interface class org/jetbrains/jewel/foundation/lazy/tree/KeyActions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.ui.input.pointer.isCtrlPressed
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.jetbrains.jewel.foundation.InternalJewelApi
import org.jetbrains.jewel.foundation.lazy.DefaultMacOsSelectableColumnKeybindings
import org.jetbrains.jewel.foundation.lazy.DefaultSelectableColumnKeybindings
import org.jetbrains.jewel.foundation.lazy.DefaultSelectableOnKeyEvent
Expand Down Expand Up @@ -141,7 +142,7 @@ public open class DefaultSelectableLazyColumnEventAction : PointerEventActions {
}
}

public class DefaultTreeViewPointerEventAction(private val treeState: TreeState) :
public open class DefaultTreeViewPointerEventAction(private val treeState: TreeState) :
DefaultSelectableLazyColumnEventAction() {
override fun handlePointerEventPress(
pointerEvent: PointerEvent,
Expand Down Expand Up @@ -176,7 +177,8 @@ public class DefaultTreeViewPointerEventAction(private val treeState: TreeState)
// for item click that lose focus and fail to match if a operation is a double-click
private var elementClickedTmpHolder: Any? = null

internal fun <T> notifyItemClicked(
@InternalJewelApi
public fun <T> notifyItemClicked(
item: Tree.Element<T>,
scope: CoroutineScope,
doubleClickTimeDelayMillis: Long,
Expand Down

0 comments on commit 6e66a70

Please sign in to comment.