JetBrains / jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Apache License 2.0
692 stars 35 forks source link

Add onTextClick to MarkdownBlockRenderer #366

Closed rock3r closed 5 months ago

rock3r commented 5 months ago

This is a workaround to the fact that ClickableText swallows all clicks, since its onClick lambda has no way of saying if it did handle a click.

Hopefully this won't be needed anymore when we move to Compose 1.7, which brings in a proper LinkAnnotation.

[!IMPORTANT] Please don't merge until #365 has been merged

devkanro commented 5 months ago

LGTM, but with some hardcoded numbers, what's the source for these magic numbers?

rock3r commented 5 months ago

The numbers are coming from the pre-existing code — I had to duplicate a bunch of logic on our side to make it easier for users to use. The numbers were derived from the JBFont typography presets for headings, and the Int UI specs.