Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Oct 20, 2023
1 parent 4028463 commit f906232
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import com.intellij.util.ui.NamedColorUtil
import com.intellij.util.ui.StatusText
import org.jetbrains.jewel.IntelliJComponentStyling
import org.jetbrains.jewel.intui.core.IntUiThemeDefinition
import org.jetbrains.jewel.intui.standalone.styling.defaults
import org.jetbrains.jewel.intui.core.styling.defaults
import org.jetbrains.jewel.styling.ButtonColors
import org.jetbrains.jewel.styling.ButtonMetrics
import org.jetbrains.jewel.styling.ButtonStyle
Expand Down Expand Up @@ -436,7 +436,7 @@ private fun readUndecoratedDropdownStyle(
DarculaUIUtil.MINIMUM_HEIGHT.dp,
),
cornerSize = CornerSize(JBUI.CurrentTheme.MainToolbar.Dropdown.hoverArc().dp),
contentPadding = JBUI.CurrentTheme.MainToolbar.Dropdown.margin().toPaddingValues(),
contentPadding = JBUI.CurrentTheme.MainToolbar.Dropdown.borderInsets().toPaddingValues(),
borderWidth = 0.dp,
),
icons = DropdownIcons(
Expand Down
7 changes: 7 additions & 0 deletions int-ui/int-ui-core/api/int-ui-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public final class org/jetbrains/jewel/intui/core/IntUiThemeDefinition : org/jet
public fun toString ()Ljava/lang/String;
}

public final class org/jetbrains/jewel/intui/core/styling/CommonMetricsKt {
public static final fun defaults-VpY3zN4 (Lorg/jetbrains/jewel/styling/DividerMetrics$Companion;FF)Lorg/jetbrains/jewel/styling/DividerMetrics;
public static synthetic fun defaults-VpY3zN4$default (Lorg/jetbrains/jewel/styling/DividerMetrics$Companion;FFILjava/lang/Object;)Lorg/jetbrains/jewel/styling/DividerMetrics;
public static final fun defaults-_3NXNO4 (Lorg/jetbrains/jewel/styling/TooltipMetrics$Companion;Landroidx/compose/foundation/layout/PaddingValues;JLandroidx/compose/foundation/shape/CornerSize;FFJLandroidx/compose/ui/Alignment$Horizontal;)Lorg/jetbrains/jewel/styling/TooltipMetrics;
public static synthetic fun defaults-_3NXNO4$default (Lorg/jetbrains/jewel/styling/TooltipMetrics$Companion;Landroidx/compose/foundation/layout/PaddingValues;JLandroidx/compose/foundation/shape/CornerSize;FFJLandroidx/compose/ui/Alignment$Horizontal;ILjava/lang/Object;)Lorg/jetbrains/jewel/styling/TooltipMetrics;
}

public final class org/jetbrains/jewel/intui/core/theme/IntUiDarkTheme : org/jetbrains/jewel/IntelliJThemeDescriptor {
public static final field $stable I
public static final field INSTANCE Lorg/jetbrains/jewel/intui/core/theme/IntUiDarkTheme;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.jetbrains.jewel.intui.core.styling

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.ui.Alignment
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.styling.DividerMetrics
import org.jetbrains.jewel.styling.TooltipMetrics
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds

fun TooltipMetrics.Companion.defaults(
contentPadding: PaddingValues = PaddingValues(vertical = 9.dp, horizontal = 12.dp),
showDelay: Duration = 0.milliseconds,
cornerSize: CornerSize = CornerSize(5.dp),
borderWidth: Dp = 1.dp,
shadowSize: Dp = 12.dp,
tooltipOffset: DpOffset = DpOffset(0.dp, 20.dp),
tooltipAlignment: Alignment.Horizontal = Alignment.Start,
) = TooltipMetrics(contentPadding, showDelay, cornerSize, borderWidth, shadowSize, tooltipOffset, tooltipAlignment)

fun DividerMetrics.Companion.defaults(
thickness: Dp = 1.dp,
startIndent: Dp = 0.dp,
) = DividerMetrics(thickness, startIndent)
4 changes: 0 additions & 4 deletions int-ui/int-ui-standalone/api/int-ui-standalone.api
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ public final class org/jetbrains/jewel/intui/standalone/styling/IntUiDefaultTabS

public final class org/jetbrains/jewel/intui/standalone/styling/IntUiDividerStyleKt {
public static final fun dark-3IgeMak (Lorg/jetbrains/jewel/styling/DividerStyle$Companion;JLorg/jetbrains/jewel/styling/DividerMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/styling/DividerStyle;
public static final fun defaults-VpY3zN4 (Lorg/jetbrains/jewel/styling/DividerMetrics$Companion;FF)Lorg/jetbrains/jewel/styling/DividerMetrics;
public static synthetic fun defaults-VpY3zN4$default (Lorg/jetbrains/jewel/styling/DividerMetrics$Companion;FFILjava/lang/Object;)Lorg/jetbrains/jewel/styling/DividerMetrics;
public static final fun light-3IgeMak (Lorg/jetbrains/jewel/styling/DividerStyle$Companion;JLorg/jetbrains/jewel/styling/DividerMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/styling/DividerStyle;
}

Expand Down Expand Up @@ -394,8 +392,6 @@ public final class org/jetbrains/jewel/intui/standalone/styling/IntUiTextFieldSt
public final class org/jetbrains/jewel/intui/standalone/styling/IntUiTooltipStylingKt {
public static final fun dark (Lorg/jetbrains/jewel/styling/TooltipStyle$Companion;Lorg/jetbrains/jewel/styling/TooltipColors;Lorg/jetbrains/jewel/styling/TooltipMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/styling/TooltipStyle;
public static final fun dark-zf8z9n0 (Lorg/jetbrains/jewel/styling/TooltipColors$Companion;JJJJLandroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/styling/TooltipColors;
public static final fun defaults-_3NXNO4 (Lorg/jetbrains/jewel/styling/TooltipMetrics$Companion;Landroidx/compose/foundation/layout/PaddingValues;JLandroidx/compose/foundation/shape/CornerSize;FFJLandroidx/compose/ui/Alignment$Horizontal;)Lorg/jetbrains/jewel/styling/TooltipMetrics;
public static synthetic fun defaults-_3NXNO4$default (Lorg/jetbrains/jewel/styling/TooltipMetrics$Companion;Landroidx/compose/foundation/layout/PaddingValues;JLandroidx/compose/foundation/shape/CornerSize;FFJLandroidx/compose/ui/Alignment$Horizontal;ILjava/lang/Object;)Lorg/jetbrains/jewel/styling/TooltipMetrics;
public static final fun light (Lorg/jetbrains/jewel/styling/TooltipStyle$Companion;Lorg/jetbrains/jewel/styling/TooltipColors;Lorg/jetbrains/jewel/styling/TooltipMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/styling/TooltipStyle;
public static final fun light-zf8z9n0 (Lorg/jetbrains/jewel/styling/TooltipColors$Companion;JJJJLandroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/styling/TooltipColors;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package org.jetbrains.jewel.intui.standalone.styling

import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.intui.core.styling.defaults
import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme
import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme
import org.jetbrains.jewel.styling.DividerMetrics
Expand All @@ -20,8 +19,3 @@ fun DividerStyle.Companion.dark(
color: Color = IntUiDarkTheme.colors.grey(1),
metrics: DividerMetrics = DividerMetrics.defaults(),
) = DividerStyle(color, metrics)

fun DividerMetrics.Companion.defaults(
thickness: Dp = 1.dp,
startIndent: Dp = 0.dp,
) = DividerMetrics(thickness, startIndent)
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
package org.jetbrains.jewel.intui.standalone.styling

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.shape.CornerSize
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp
import org.jetbrains.jewel.intui.core.styling.defaults
import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme
import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme
import org.jetbrains.jewel.styling.TooltipColors
import org.jetbrains.jewel.styling.TooltipMetrics
import org.jetbrains.jewel.styling.TooltipStyle
import kotlin.time.Duration
import kotlin.time.Duration.Companion.milliseconds

@Composable
fun TooltipStyle.Companion.light(
Expand Down Expand Up @@ -49,13 +42,3 @@ fun TooltipColors.Companion.dark(
borderColor: Color = IntUiDarkTheme.colors.grey(3),
shadow: Color = Color(0x66000000), // Not a palette color
) = TooltipColors(backgroundColor, contentColor, borderColor, shadow)

fun TooltipMetrics.Companion.defaults(
contentPadding: PaddingValues = PaddingValues(vertical = 9.dp, horizontal = 12.dp),
showDelay: Duration = 0.milliseconds,
cornerSize: CornerSize = CornerSize(5.dp),
borderWidth: Dp = 1.dp,
shadowSize: Dp = 12.dp,
tooltipOffset: DpOffset = DpOffset(0.dp, 20.dp),
tooltipAlignment: Alignment.Horizontal = Alignment.Start,
) = TooltipMetrics(contentPadding, showDelay, cornerSize, borderWidth, shadowSize, tooltipOffset, tooltipAlignment)

0 comments on commit f906232

Please sign in to comment.