Skip to content

Commit

Permalink
Remove underline on unhovered Links (#598)
Browse files Browse the repository at this point in the history
Co-authored-by: Francisco Noriega <[email protected]>
  • Loading branch information
2 people authored and rock3r committed Sep 24, 2024
1 parent 8285900 commit ba2fde9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.ui.graphics.PathEffect
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.TextStyle
Expand Down Expand Up @@ -339,19 +340,19 @@ public fun InlinesStyling.Companion.create(
defaultEditorTextStyle
.copy(fontSize = textStyle.fontSize * .85, background = inlineCodeBackgroundColor)
.toSpanStyle(),
link: SpanStyle =
textStyle
.copy(
color = JBUI.CurrentTheme.Link.Foreground.ENABLED.toComposeColor(),
textDecoration = TextDecoration.Underline,
)
.toSpanStyle(),
link: SpanStyle = textStyle.copy(color = JBUI.CurrentTheme.Link.Foreground.ENABLED.toComposeColor()).toSpanStyle(),
linkDisabled: SpanStyle = link.copy(color = JBUI.CurrentTheme.Link.Foreground.DISABLED.toComposeColor()),
linkHovered: SpanStyle = link.copy(color = JBUI.CurrentTheme.Link.Foreground.HOVERED.toComposeColor()),
linkHovered: SpanStyle =
link.copy(
color = JBUI.CurrentTheme.Link.Foreground.HOVERED.toComposeColor(),
textDecoration = TextDecoration.Underline,
),
linkFocused: SpanStyle =
link.copy(
drawStyle = Stroke(width = 2f),
color = JBUI.CurrentTheme.Link.Foreground.ENABLED.toComposeColor(),
background = JBUI.CurrentTheme.ActionButton.hoverBackground().toComposeColor(),
textDecoration = TextDecoration.Underline,
),
linkPressed: SpanStyle =
link.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,10 @@ public fun InlinesStyling.Companion.light(
defaultEditorTextStyle
.copy(fontSize = textStyle.fontSize * .85, background = inlineCodeBackgroundColorLight)
.toSpanStyle(),
link: SpanStyle =
textStyle.copy(color = IntUiLightTheme.colors.blue(2), textDecoration = TextDecoration.Underline).toSpanStyle(),
link: SpanStyle = textStyle.copy(color = IntUiLightTheme.colors.blue(2)).toSpanStyle(),
linkDisabled: SpanStyle = link.copy(color = IntUiLightTheme.colors.gray(8)),
linkHovered: SpanStyle = link,
linkFocused: SpanStyle = link.copy(background = Color(0x12000000)),
linkHovered: SpanStyle = link.copy(textDecoration = TextDecoration.Underline),
linkFocused: SpanStyle = link.copy(background = Color(0x12000000), textDecoration = TextDecoration.Underline),
linkPressed: SpanStyle = link.copy(background = Color(0x1D000000)),
linkVisited: SpanStyle = link,
emphasis: SpanStyle = textStyle.copy(fontStyle = FontStyle.Italic).toSpanStyle(),
Expand Down Expand Up @@ -630,11 +629,10 @@ public fun InlinesStyling.Companion.dark(
defaultEditorTextStyle
.copy(fontSize = textStyle.fontSize * .85, background = inlineCodeBackgroundColorDark)
.toSpanStyle(),
link: SpanStyle =
textStyle.copy(color = IntUiDarkTheme.colors.blue(9), textDecoration = TextDecoration.Underline).toSpanStyle(),
link: SpanStyle = textStyle.copy(color = IntUiDarkTheme.colors.blue(9)).toSpanStyle(),
linkDisabled: SpanStyle = link.copy(color = IntUiDarkTheme.colors.gray(8)),
linkHovered: SpanStyle = link,
linkFocused: SpanStyle = link.copy(background = Color(0x16FFFFFF)),
linkHovered: SpanStyle = link.copy(textDecoration = TextDecoration.Underline),
linkFocused: SpanStyle = link.copy(background = Color(0x16FFFFFF), textDecoration = TextDecoration.Underline),
linkPressed: SpanStyle = link.copy(background = Color(0x26FFFFFF)),
linkVisited: SpanStyle = link,
emphasis: SpanStyle = textStyle.copy(fontStyle = FontStyle.Italic).toSpanStyle(),
Expand Down

0 comments on commit ba2fde9

Please sign in to comment.