Hi everyone. I’d like to get your opinion on the <...
# compose-desktop
a
Hi everyone. I’d like to get your opinion on the current tooltips API vs. an API where you would provide a
TooltipHost
(similar to SnackbarHost) somewhere near the root of the window, and then use
Modifier.tooltip(String)
or
Modifier.tooltip(@Composable () -> Unit)
to specify the tooltip on elements.
g
Material3 has a TooltipBox - I'd prefer to see harmonization of the API so they can be used from Common code and behave in an expected way on every supported platform. I have less of a preference between using it with Modifers vs the way currently implemented. The last time I tried RichTooltipBox on Desktop it didn't do anything, I believe because it only responds to long presses, e.g. on a mobile device, and not mouse events. Is ToolTipArea going to be available from Common code also?
a
It’s more likely that TooltipBox will be commonized, rather than TooltipArea. But the reason I’m asking is that I personally find it inconvenient to have to wrap each widget in another box/area just to add a tooltip to it. So I want to understand whether others shared this.
But I guess everyone’s on their xmas vacation.
g
I see your point, the Modifier approach is more compact, but if it is Desktop only then that will limit its use to Desktop-only applications.
a
Whatever the eventual stable API there will be, it will be commonized, you don’t need to worry about that.
👍 1
m
I also feel that the current TooltipArea approach is somewhat cumbersome but, as others have said already, the most annoying aspect is that it is currently not cross-platform.