David W
09/01/2022, 10:55 PM@Composable
fun SmolTooltipBackground(modifier: Modifier = Modifier, content: @Composable () -> Unit) {
Box(
modifier = modifier
.pointerMoveFilter(
onEnter = {
println("On Mouse(pointer) Enter")
// can i cancel/hide this composable from here?
false
})
) {
content.invoke()
}
}
David W
09/01/2022, 11:26 PMvar show by remember { mutableStateOf(true) }
if (show) {
and then just add this to the modifier of the tooltip background
.mouseClickable { show = false }
.pointerMoveFilter(
onEnter = {
show = false
false
},
onExit = {
false
})
plus i moved the tooltip's placement to -8, -8 offsetGreg Steckman
09/02/2022, 2:08 AMHoverableElementArea
composable that lets you then apply a hoverableElement
modifier on child components which allows you to specify a Composable to popup when the mouse enters the component (and it follows the mouse).David W
09/02/2022, 2:09 AMGreg Steckman
09/02/2022, 2:10 AMGreg Steckman
09/02/2022, 2:10 AMGreg Steckman
09/02/2022, 2:10 AMDavid W
09/02/2022, 4:21 AMTooltipArea
or Box
, but it doesn't render content properlyDavid W
09/02/2022, 4:22 AMDavid W
09/02/2022, 4:40 AMDavid W
09/02/2022, 4:40 AMGreg Steckman
09/02/2022, 5:06 AMGreg Steckman
09/02/2022, 5:10 AMHoverableElementArea {
Column {
Card(modifier = Modifier.hoverableElement { Text("Hello World") }) {
Text("This is a card with a hover element")
}
}
}
Greg Steckman
09/02/2022, 5:10 AMDragos Rachieru
09/22/2022, 7:53 AM