Skip to content

Commit

Permalink
Merge pull request #288 from Saif-Alhaider/fix/add-hover-icon-on-link…
Browse files Browse the repository at this point in the history
…ed-text

Hover icon on linked text
  • Loading branch information
mikepenz authored Feb 1, 2025
2 parents 856abaa + 61cb08d commit acab83c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import androidx.compose.foundation.gestures.waitForUpOrCancellation
import androidx.compose.foundation.text.InlineTextContent
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.PointerIcon
import androidx.compose.ui.input.pointer.pointerHoverIcon
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.onPlaced
import androidx.compose.ui.platform.LocalUriHandler
Expand Down Expand Up @@ -102,7 +104,7 @@ fun MarkdownText(
val imageState = rememberMarkdownImageState()

val hasUrl = content.getStringAnnotations(MARKDOWN_TAG_URL, 0, content.length).any()
val textModifier = if (hasUrl) modifier.pointerInput(Unit) {
val textModifier = if (hasUrl) modifier.pointerHoverIcon(PointerIcon.Hand, true).pointerInput(Unit) {
awaitEachGesture {
val pointer = awaitFirstDown()
val pos = pointer.position // current position
Expand Down

0 comments on commit acab83c

Please sign in to comment.