Skip to content

Commit

Permalink
Fixed Text Component order for color (#596)
Browse files Browse the repository at this point in the history
Fixed Null Pointer in IDE sample on non INTUI themes

Co-authored-by: Francisco Noriega <[email protected]>
  • Loading branch information
francisconoriega and Francisco Noriega authored Sep 17, 2024
1 parent b367950 commit db7e053
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public fun Text(
onTextLayout: (TextLayoutResult) -> Unit = {},
style: TextStyle = JewelTheme.defaultTextStyle,
) {
val textColor = color.takeOrElse { LocalContentColor.current.takeOrElse { style.color } }
val textColor = color.takeOrElse { style.color.takeOrElse { LocalContentColor.current } }

val mergedStyle =
style.merge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import androidx.compose.ui.window.PopupPositionProviderAtPosition
import org.jetbrains.jewel.foundation.ExperimentalJewelApi
import org.jetbrains.jewel.foundation.theme.JewelTheme
import org.jetbrains.jewel.foundation.theme.LocalContentColor
import org.jetbrains.jewel.foundation.theme.LocalTextStyle
import org.jetbrains.jewel.foundation.theme.OverrideDarkMode
import org.jetbrains.jewel.ui.component.styling.TooltipStyle
import org.jetbrains.jewel.ui.theme.tooltipStyle
Expand All @@ -39,7 +40,10 @@ public fun Tooltip(
) {
TooltipArea(
tooltip = {
CompositionLocalProvider(LocalContentColor provides style.colors.content) {
CompositionLocalProvider(
LocalContentColor provides style.colors.content,
LocalTextStyle provides LocalTextStyle.current.copy(color = style.colors.content),
) {
Box(
modifier =
Modifier.shadow(
Expand Down

0 comments on commit db7e053

Please sign in to comment.