https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
f

frank

06/11/2023, 1:13 AM
Hi guys, How can implement select event in
Cards
? Wanted behavior: When Drag the mouse in a single-click, select only the
Cards
not the content. Suggestions for this?
Copy code
fun filesCard(files: List<Directory> = listOf(), onOpenDoc: (Path) -> Unit) {
  Card (modifier = Modifier.fillMaxHeight(0.9f).fillMaxWidth()) {
  	LazyColumn(modifier = Modifier.fillMaxHeight()) {
  		items(files) {file ->
  			Card(
  				backgroundColor = Color(245, 238, 254),
  				shape = RoundedCornerShape(8.dp),
  				modifier = Modifier
  					.padding(vertical = 4.dp, horizontal = 4.dp)
  					.combinedClickable(
  						onClick  = {
  							println("Clicked File!")
  						},
  						onDoubleClick = {
  							onOpenDoc(file.path)
  						}
  					)
  			) {
  				Row {
  					Column(modifier = Modifier.padding(start = 8.dp)
  					) {
  						Text(file.name, fontWeight = FontWeight.Bold, modifier = Modifier.fillMaxWidth())
  						Text("..\\${file.relativePath}")
  					}
  				}
  			}
  		}
  	}
  }
}
3 Views