You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
810 B

package org.jetbrains.codeviewer.platform
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.DesktopSelectionContainer
import androidx.compose.ui.selection.Selection
@Composable
actual fun SelectionContainer(children: @Composable () -> Unit) {
val selection = remember { mutableStateOf<Selection?>(null) }
DesktopSelectionContainer(
selection = selection.value,
onSelectionChange = { selection.value = it },
children = children
)
}
@Composable
actual fun WithoutSelection(children: @Composable () -> Unit) {
androidx.compose.ui.selection.SelectionContainer(
selection = null,
onSelectionChange = {},
children = children
)
}