Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarponi committed Oct 4, 2023
1 parent 8c8acf7 commit 39d76a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion core/src/main/kotlin/org/jetbrains/jewel/Tooltip.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.DpOffset
Expand All @@ -18,7 +19,11 @@ import org.jetbrains.jewel.styling.TooltipStyle
@Composable
fun Tooltip(
modifier: Modifier = Modifier,
tooltipPlacement: TooltipPlacement = TooltipPlacement.CursorPoint(offset = DpOffset(16.dp, 16.dp)),
tooltipPlacement: TooltipPlacement = TooltipPlacement.ComponentRect(
alignment = Alignment.CenterEnd,
anchor = Alignment.BottomEnd,
offset = DpOffset(4.dp, 4.dp)
),
style: TooltipStyle = IntelliJTheme.tooltipStyle,
tooltip: @Composable () -> Unit,
content: @Composable () -> Unit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ data class IntUiTooltipColors(

@Composable
fun light(
contentColor: Color = IntUiLightTheme.colors.grey(1),
backgroundColor: Color = IntUiLightTheme.colors.grey(12),
contentColor: Color = IntUiLightTheme.colors.grey(12),
backgroundColor: Color = IntUiLightTheme.colors.grey(2),
borderColor: Color = IntelliJTheme.globalColors.borders.normal
) = IntUiTooltipColors(contentColor, backgroundColor, borderColor)

@Composable
fun dark(
contentColor: Color = IntUiDarkTheme.colors.grey(1),
backgroundColor: Color = IntUiDarkTheme.colors.grey(12),
contentColor: Color = IntUiDarkTheme.colors.grey(12),
backgroundColor: Color = IntUiDarkTheme.colors.grey(2),
borderColor: Color = IntelliJTheme.globalColors.borders.normal
) = IntUiTooltipColors(contentColor, backgroundColor, borderColor)
}
Expand All @@ -70,5 +70,5 @@ data class IntUiTooltipColors(
@Stable
data class IntUiTooltipMetrics(
override val paddingValues: PaddingValues = PaddingValues(vertical = 8.dp, horizontal = 8.dp),
override val showDelay: Duration = 500.milliseconds,
override val showDelay: Duration = 0.milliseconds,
) : TooltipMetrics

0 comments on commit 39d76a6

Please sign in to comment.