From c5d1dd6c6cafad3e1f13a22942a9bc8e7f95ff1b Mon Sep 17 00:00:00 2001 From: Sebastiano Poggi Date: Wed, 24 Jul 2024 10:51:51 +0200 Subject: [PATCH] Remove TextStyles from stylings (#490) * Remove textStyle from DropdownStyle * Remove textStyle from InputFieldStyle and implementers * Remove LinkTextStyles * Update API definitions * Address static analysis --- .../jewel/bridge/SwingBridgeService.kt | 16 ++-- .../jewel/bridge/theme/IntUiBridge.kt | 60 +++----------- .../api/int-ui-standalone.api | 22 +++-- .../styling/IntUiDropdownStyling.kt | 15 +--- .../standalone/styling/IntUiLinkStyling.kt | 31 +------ .../styling/IntUiTextAreaStyling.kt | 9 +-- .../styling/IntUiTextFieldStyling.kt | 9 +-- ui/api/ui.api | 38 ++------- .../jewel/ui/component/InputField.kt | 2 +- .../org/jetbrains/jewel/ui/component/Link.kt | 81 +++---------------- .../ui/component/styling/DropdownStyling.kt | 2 - .../ui/component/styling/InputFieldStyling.kt | 2 - .../jewel/ui/component/styling/LinkStyling.kt | 29 ------- .../ui/component/styling/TextAreaStyling.kt | 2 - .../ui/component/styling/TextFieldStyling.kt | 2 - 15 files changed, 55 insertions(+), 265 deletions(-) diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/SwingBridgeService.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/SwingBridgeService.kt index b664ca365..23843474d 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/SwingBridgeService.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/SwingBridgeService.kt @@ -54,18 +54,16 @@ internal class SwingBridgeService(scope: CoroutineScope) { run { val textStyle = TextStyle.Default.copy(fontSize = 13.sp) val monospaceTextStyle = textStyle.copy(fontFamily = FontFamily.Monospace) - val themeDefinition = createBridgeThemeDefinition(textStyle, monospaceTextStyle, monospaceTextStyle) + val themeDefinition = + createBridgeThemeDefinition( + textStyle = textStyle, + editorTextStyle = monospaceTextStyle, + consoleTextStyle = monospaceTextStyle, + ) BridgeThemeData( themeDefinition = themeDefinition, - componentStyling = - createBridgeComponentStyling( - theme = themeDefinition, - textFieldTextStyle = textStyle, - textAreaTextStyle = textStyle, - dropdownTextStyle = textStyle, - linkTextStyle = textStyle, - ), + componentStyling = createBridgeComponentStyling(themeDefinition), ) } } diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt index bd1ca49fb..79930b991 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/theme/IntUiBridge.kt @@ -85,7 +85,6 @@ import org.jetbrains.jewel.ui.component.styling.LinkColors import org.jetbrains.jewel.ui.component.styling.LinkIcons import org.jetbrains.jewel.ui.component.styling.LinkMetrics import org.jetbrains.jewel.ui.component.styling.LinkStyle -import org.jetbrains.jewel.ui.component.styling.LinkTextStyles import org.jetbrains.jewel.ui.component.styling.MenuColors import org.jetbrains.jewel.ui.component.styling.MenuIcons import org.jetbrains.jewel.ui.component.styling.MenuItemColors @@ -201,25 +200,10 @@ internal fun createBridgeThemeDefinition( ) } -internal fun createBridgeComponentStyling(theme: ThemeDefinition) = - createBridgeComponentStyling( - theme = theme, - textFieldTextStyle = retrieveTextStyle("TextField.font", "TextField.foreground"), - textAreaTextStyle = retrieveTextStyle("TextArea.font", "TextArea.foreground"), - dropdownTextStyle = retrieveTextStyle("ComboBox.font"), - linkTextStyle = retrieveTextStyle("Label.font"), - ) - -internal fun createBridgeComponentStyling( - theme: ThemeDefinition, - textFieldTextStyle: TextStyle, - textAreaTextStyle: TextStyle, - dropdownTextStyle: TextStyle, - linkTextStyle: TextStyle, -): ComponentStyling { +internal fun createBridgeComponentStyling(theme: ThemeDefinition): ComponentStyling { logger.debug("Obtaining Int UI component styling from Swing...") - val textFieldStyle = readTextFieldStyle(textFieldTextStyle) + val textFieldStyle = readTextFieldStyle() val menuStyle = readMenuStyle() return DefaultComponentStyling( @@ -227,7 +211,7 @@ internal fun createBridgeComponentStyling( chipStyle = readChipStyle(), circularProgressStyle = readCircularProgressStyle(theme.isDark), defaultButtonStyle = readDefaultButtonStyle(), - defaultDropdownStyle = readDefaultDropdownStyle(menuStyle, dropdownTextStyle), + defaultDropdownStyle = readDefaultDropdownStyle(menuStyle), defaultTabStyle = readDefaultTabStyle(), dividerStyle = readDividerStyle(), editorTabStyle = readEditorTabStyle(), @@ -235,7 +219,7 @@ internal fun createBridgeComponentStyling( horizontalProgressBarStyle = readHorizontalProgressBarStyle(), iconButtonStyle = readIconButtonStyle(), lazyTreeStyle = readLazyTreeStyle(), - linkStyle = readLinkStyle(linkTextStyle), + linkStyle = readLinkStyle(), menuStyle = menuStyle, outlinedButtonStyle = readOutlinedButtonStyle(), radioButtonStyle = readRadioButtonStyle(), @@ -243,10 +227,10 @@ internal fun createBridgeComponentStyling( segmentedControlButtonStyle = readSegmentedControlButtonStyle(), segmentedControlStyle = readSegmentedControlStyle(), sliderStyle = readSliderStyle(theme.isDark), - textAreaStyle = readTextAreaStyle(textAreaTextStyle, textFieldStyle.metrics), + textAreaStyle = readTextAreaStyle(textFieldStyle.metrics), textFieldStyle = textFieldStyle, tooltipStyle = readTooltipStyle(), - undecoratedDropdownStyle = readUndecoratedDropdownStyle(menuStyle, dropdownTextStyle), + undecoratedDropdownStyle = readUndecoratedDropdownStyle(menuStyle), ) } @@ -503,10 +487,7 @@ private fun readDividerStyle() = metrics = DividerMetrics.defaults(), ) -private fun readDefaultDropdownStyle( - menuStyle: MenuStyle, - dropdownTextStyle: TextStyle, -): DropdownStyle { +private fun readDefaultDropdownStyle(menuStyle: MenuStyle): DropdownStyle { val normalBackground = retrieveColorOrUnspecified("ComboBox.nonEditableBackground") val normalContent = retrieveColorOrUnspecified("ComboBox.foreground") val normalBorder = retrieveColorOrUnspecified("Component.borderColor") @@ -549,15 +530,11 @@ private fun readDefaultDropdownStyle( borderWidth = DarculaUIUtil.LW.dp, ), icons = DropdownIcons(chevronDown = AllIconsKeys.General.ChevronDown), - textStyle = dropdownTextStyle, menuStyle = menuStyle, ) } -private fun readUndecoratedDropdownStyle( - menuStyle: MenuStyle, - dropdownTextStyle: TextStyle, -): DropdownStyle { +private fun readUndecoratedDropdownStyle(menuStyle: MenuStyle): DropdownStyle { val normalBackground = retrieveColorOrUnspecified("ComboBox.nonEditableBackground") val hoverBackground = retrieveColorOrUnspecified("MainToolbar.Dropdown.transparentHoverBackground") val normalContent = retrieveColorOrUnspecified("ComboBox.foreground") @@ -600,7 +577,6 @@ private fun readUndecoratedDropdownStyle( borderWidth = 0.dp, ), icons = DropdownIcons(chevronDown = AllIconsKeys.General.ChevronDown), - textStyle = dropdownTextStyle, menuStyle = menuStyle, ) } @@ -636,7 +612,7 @@ private fun readHorizontalProgressBarStyle() = indeterminateCycleDuration = 800.milliseconds, // See DarculaProgressBarUI.CYCLE_TIME_DEFAULT ) -private fun readLinkStyle(linkTextStyle: TextStyle): LinkStyle { +private fun readLinkStyle(): LinkStyle { val normalContent = retrieveColorOrUnspecified("Link.activeForeground") .takeOrElse { retrieveColorOrUnspecified("Link.activeForeground") } @@ -676,15 +652,6 @@ private fun readLinkStyle(linkTextStyle: TextStyle): LinkStyle { dropdownChevron = AllIconsKeys.General.ChevronDown, externalLink = AllIconsKeys.Ide.External_link_arrow, ), - textStyles = - LinkTextStyles( - normal = linkTextStyle, - disabled = linkTextStyle, - focused = linkTextStyle, - pressed = linkTextStyle, - hovered = linkTextStyle, - visited = linkTextStyle, - ), ) } @@ -943,10 +910,7 @@ private fun readSliderStyle(dark: Boolean): SliderStyle { return SliderStyle(colors, SliderMetrics.defaults(), CircleShape) } -private fun readTextAreaStyle( - textStyle: TextStyle, - metrics: TextFieldMetrics, -): TextAreaStyle { +private fun readTextAreaStyle(metrics: TextFieldMetrics): TextAreaStyle { val normalBackground = retrieveColorOrUnspecified("TextArea.background") val normalContent = retrieveColorOrUnspecified("TextArea.foreground") val normalBorder = DarculaUIUtil.getOutlineColor(true, false).toComposeColor() @@ -987,11 +951,10 @@ private fun readTextAreaStyle( minSize = metrics.minSize, borderWidth = metrics.borderWidth, ), - textStyle = textStyle, ) } -private fun readTextFieldStyle(textFieldStyle: TextStyle): TextFieldStyle { +private fun readTextFieldStyle(): TextFieldStyle { val normalBackground = retrieveColorOrUnspecified("TextField.background") val normalContent = retrieveColorOrUnspecified("TextField.foreground") val normalBorder = DarculaUIUtil.getOutlineColor(true, false).toComposeColor() @@ -1033,7 +996,6 @@ private fun readTextFieldStyle(textFieldStyle: TextStyle): TextFieldStyle { minSize = DpSize(minimumSize.width, minimumSize.height), borderWidth = DarculaUIUtil.LW.dp, ), - textStyle = textFieldStyle, ) } diff --git a/int-ui/int-ui-standalone/api/int-ui-standalone.api b/int-ui/int-ui-standalone/api/int-ui-standalone.api index f33f8d0e0..cb2c39155 100644 --- a/int-ui/int-ui-standalone/api/int-ui-standalone.api +++ b/int-ui/int-ui-standalone/api/int-ui-standalone.api @@ -100,8 +100,8 @@ public final class org/jetbrains/jewel/intui/standalone/styling/IntUiDefaultDrop public final class org/jetbrains/jewel/intui/standalone/styling/IntUiDefaultDropdownStyleFactory { public static final field $stable I public static final field INSTANCE Lorg/jetbrains/jewel/intui/standalone/styling/IntUiDefaultDropdownStyleFactory; - public final fun dark (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; - public final fun light (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; + public final fun dark (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; + public final fun light (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; } public final class org/jetbrains/jewel/intui/standalone/styling/IntUiDefaultTabColorsFactory { @@ -193,15 +193,13 @@ public final class org/jetbrains/jewel/intui/standalone/styling/IntUiLazyTreeSty } public final class org/jetbrains/jewel/intui/standalone/styling/IntUiLinkStylingKt { - public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/LinkStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/LinkColors;Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics;Lorg/jetbrains/jewel/ui/component/styling/LinkIcons;Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkStyle; - public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles$Companion;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles; + public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/LinkStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/LinkColors;Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics;Lorg/jetbrains/jewel/ui/component/styling/LinkIcons;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkStyle; public static final fun dark-dPtIKUs (Lorg/jetbrains/jewel/ui/component/styling/LinkColors$Companion;JJJJJJLandroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkColors; public static final fun defaults (Lorg/jetbrains/jewel/ui/component/styling/LinkIcons$Companion;Lorg/jetbrains/jewel/ui/icon/IconKey;Lorg/jetbrains/jewel/ui/icon/IconKey;)Lorg/jetbrains/jewel/ui/component/styling/LinkIcons; public static synthetic fun defaults$default (Lorg/jetbrains/jewel/ui/component/styling/LinkIcons$Companion;Lorg/jetbrains/jewel/ui/icon/IconKey;Lorg/jetbrains/jewel/ui/icon/IconKey;ILjava/lang/Object;)Lorg/jetbrains/jewel/ui/component/styling/LinkIcons; public static final fun defaults-7dA9OmY (Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics$Companion;Landroidx/compose/foundation/shape/CornerSize;FJ)Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics; public static synthetic fun defaults-7dA9OmY$default (Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics$Companion;Landroidx/compose/foundation/shape/CornerSize;FJILjava/lang/Object;)Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics; - public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/LinkStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/LinkColors;Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics;Lorg/jetbrains/jewel/ui/component/styling/LinkIcons;Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkStyle; - public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles$Companion;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles; + public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/LinkStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/LinkColors;Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics;Lorg/jetbrains/jewel/ui/component/styling/LinkIcons;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkStyle; public static final fun light-dPtIKUs (Lorg/jetbrains/jewel/ui/component/styling/LinkColors$Companion;JJJJJJLandroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/LinkColors; } @@ -300,20 +298,20 @@ public final class org/jetbrains/jewel/intui/standalone/styling/IntUiTabStylingK } public final class org/jetbrains/jewel/intui/standalone/styling/IntUiTextAreaStylingKt { - public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors;Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle; + public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors;Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle; public static final fun dark-a3tHFA8 (Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors$Companion;JJJJJJJJJJJJJJJJJJJJJLandroidx/compose/runtime/Composer;IIII)Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors; public static final fun defaults-H1KY9o8 (Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics$Companion;Landroidx/compose/foundation/shape/CornerSize;Landroidx/compose/foundation/layout/PaddingValues;JF)Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics; public static synthetic fun defaults-H1KY9o8$default (Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics$Companion;Landroidx/compose/foundation/shape/CornerSize;Landroidx/compose/foundation/layout/PaddingValues;JFILjava/lang/Object;)Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics; - public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors;Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle; + public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors;Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle; public static final fun light-a3tHFA8 (Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors$Companion;JJJJJJJJJJJJJJJJJJJJJLandroidx/compose/runtime/Composer;IIII)Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors; } public final class org/jetbrains/jewel/intui/standalone/styling/IntUiTextFieldStylingKt { - public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors;Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle; + public static final fun dark (Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors;Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle; public static final fun dark-a3tHFA8 (Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors$Companion;JJJJJJJJJJJJJJJJJJJJJLandroidx/compose/runtime/Composer;IIII)Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors; public static final fun defaults-H1KY9o8 (Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics$Companion;Landroidx/compose/foundation/shape/CornerSize;Landroidx/compose/foundation/layout/PaddingValues;JF)Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics; public static synthetic fun defaults-H1KY9o8$default (Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics$Companion;Landroidx/compose/foundation/shape/CornerSize;Landroidx/compose/foundation/layout/PaddingValues;JFILjava/lang/Object;)Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics; - public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors;Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle; + public static final fun light (Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle$Companion;Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors;Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle; public static final fun light-a3tHFA8 (Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors$Companion;JJJJJJJJJJJJJJJJJJJJJLandroidx/compose/runtime/Composer;IIII)Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors; } @@ -334,8 +332,8 @@ public final class org/jetbrains/jewel/intui/standalone/styling/IntUiUndecorated public final class org/jetbrains/jewel/intui/standalone/styling/IntUiUndecoratedDropdownStyleFactory { public static final field $stable I public static final field INSTANCE Lorg/jetbrains/jewel/intui/standalone/styling/IntUiUndecoratedDropdownStyleFactory; - public final fun dark (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; - public final fun light (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; + public final fun dark (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; + public final fun light (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Landroidx/compose/runtime/Composer;II)Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle; } public final class org/jetbrains/jewel/intui/standalone/theme/IntUiGlobalColorsKt { diff --git a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiDropdownStyling.kt b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiDropdownStyling.kt index bdbca2614..0c710aa45 100644 --- a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiDropdownStyling.kt +++ b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiDropdownStyling.kt @@ -4,14 +4,11 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.shape.CornerSize import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp -import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme -import org.jetbrains.jewel.intui.standalone.theme.createDefaultTextStyle import org.jetbrains.jewel.ui.component.styling.DropdownColors import org.jetbrains.jewel.ui.component.styling.DropdownIcons import org.jetbrains.jewel.ui.component.styling.DropdownMetrics @@ -29,18 +26,16 @@ public object IntUiDefaultDropdownStyleFactory { colors: DropdownColors = DropdownColors.Default.light(), metrics: DropdownMetrics = DropdownMetrics.default(), icons: DropdownIcons = DropdownIcons.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), menuStyle: MenuStyle = MenuStyle.light(), - ): DropdownStyle = DropdownStyle(colors, metrics, icons, textStyle, menuStyle) + ): DropdownStyle = DropdownStyle(colors, metrics, icons, menuStyle) @Composable public fun dark( colors: DropdownColors = DropdownColors.Default.dark(), metrics: DropdownMetrics = DropdownMetrics.default(), icons: DropdownIcons = DropdownIcons.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), menuStyle: MenuStyle = MenuStyle.dark(), - ): DropdownStyle = DropdownStyle(colors, metrics, icons, textStyle, menuStyle) + ): DropdownStyle = DropdownStyle(colors, metrics, icons, menuStyle) } public val DropdownStyle.Companion.Undecorated: IntUiUndecoratedDropdownStyleFactory @@ -52,18 +47,16 @@ public object IntUiUndecoratedDropdownStyleFactory { colors: DropdownColors = DropdownColors.Undecorated.light(), metrics: DropdownMetrics = DropdownMetrics.undecorated(), icons: DropdownIcons = DropdownIcons.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), menuStyle: MenuStyle = MenuStyle.light(), - ): DropdownStyle = DropdownStyle(colors, metrics, icons, textStyle, menuStyle) + ): DropdownStyle = DropdownStyle(colors, metrics, icons, menuStyle) @Composable public fun dark( colors: DropdownColors = DropdownColors.Undecorated.dark(), metrics: DropdownMetrics = DropdownMetrics.undecorated(), icons: DropdownIcons = DropdownIcons.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), menuStyle: MenuStyle = MenuStyle.dark(), - ): DropdownStyle = DropdownStyle(colors, metrics, icons, textStyle, menuStyle) + ): DropdownStyle = DropdownStyle(colors, metrics, icons, menuStyle) } public val DropdownColors.Companion.Default: IntUiDefaultDropdownColorsFactory diff --git a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLinkStyling.kt b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLinkStyling.kt index 250cc8bd8..bf312fcce 100644 --- a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLinkStyling.kt +++ b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiLinkStyling.kt @@ -3,20 +3,15 @@ package org.jetbrains.jewel.intui.standalone.styling import androidx.compose.foundation.shape.CornerSize import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp -import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme -import org.jetbrains.jewel.intui.standalone.theme.createDefaultTextStyle import org.jetbrains.jewel.ui.component.styling.LinkColors import org.jetbrains.jewel.ui.component.styling.LinkIcons import org.jetbrains.jewel.ui.component.styling.LinkMetrics import org.jetbrains.jewel.ui.component.styling.LinkStyle -import org.jetbrains.jewel.ui.component.styling.LinkTextStyles import org.jetbrains.jewel.ui.icon.IconKey import org.jetbrains.jewel.ui.icons.AllIconsKeys @@ -25,16 +20,14 @@ public fun LinkStyle.Companion.light( colors: LinkColors = LinkColors.light(), metrics: LinkMetrics = LinkMetrics.defaults(), icons: LinkIcons = LinkIcons.defaults(), - textStyles: LinkTextStyles = LinkTextStyles.light(), -): LinkStyle = LinkStyle(colors, metrics, icons, textStyles) +): LinkStyle = LinkStyle(colors, metrics, icons) @Composable public fun LinkStyle.Companion.dark( colors: LinkColors = LinkColors.dark(), metrics: LinkMetrics = LinkMetrics.defaults(), icons: LinkIcons = LinkIcons.defaults(), - textStyles: LinkTextStyles = LinkTextStyles.dark(), -): LinkStyle = LinkStyle(colors, metrics, icons, textStyles) +): LinkStyle = LinkStyle(colors, metrics, icons) @Composable public fun LinkColors.Companion.light( @@ -82,23 +75,3 @@ public fun LinkIcons.Companion.defaults( dropdownChevron: IconKey = AllIconsKeys.General.ChevronDown, externalLink: IconKey = AllIconsKeys.Ide.External_link_arrow, ): LinkIcons = LinkIcons(dropdownChevron, externalLink) - -@Composable -public fun LinkTextStyles.Companion.light( - normal: TextStyle = JewelTheme.createDefaultTextStyle().copy(textDecoration = TextDecoration.Underline), - disabled: TextStyle = JewelTheme.createDefaultTextStyle(), - focused: TextStyle = normal, - pressed: TextStyle = normal, - hovered: TextStyle = normal, - visited: TextStyle = normal, -): LinkTextStyles = LinkTextStyles(normal, disabled, focused, pressed, hovered, visited) - -@Composable -public fun LinkTextStyles.Companion.dark( - normal: TextStyle = JewelTheme.createDefaultTextStyle().copy(textDecoration = TextDecoration.Underline), - disabled: TextStyle = JewelTheme.createDefaultTextStyle(), - focused: TextStyle = normal, - pressed: TextStyle = normal, - hovered: TextStyle = normal, - visited: TextStyle = normal, -): LinkTextStyles = LinkTextStyles(normal, disabled, focused, pressed, hovered, visited) diff --git a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextAreaStyling.kt b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextAreaStyling.kt index a0006600a..0e7049fd0 100644 --- a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextAreaStyling.kt +++ b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextAreaStyling.kt @@ -4,14 +4,11 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.shape.CornerSize import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp -import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme -import org.jetbrains.jewel.intui.standalone.theme.createDefaultTextStyle import org.jetbrains.jewel.ui.component.styling.TextAreaColors import org.jetbrains.jewel.ui.component.styling.TextAreaMetrics import org.jetbrains.jewel.ui.component.styling.TextAreaStyle @@ -20,15 +17,13 @@ import org.jetbrains.jewel.ui.component.styling.TextAreaStyle public fun TextAreaStyle.Companion.light( colors: TextAreaColors = TextAreaColors.light(), metrics: TextAreaMetrics = TextAreaMetrics.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), -): TextAreaStyle = TextAreaStyle(colors, metrics, textStyle) +): TextAreaStyle = TextAreaStyle(colors, metrics) @Composable public fun TextAreaStyle.Companion.dark( colors: TextAreaColors = TextAreaColors.dark(), metrics: TextAreaMetrics = TextAreaMetrics.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), -): TextAreaStyle = TextAreaStyle(colors, metrics, textStyle) +): TextAreaStyle = TextAreaStyle(colors, metrics) @Composable public fun TextAreaColors.Companion.light( diff --git a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextFieldStyling.kt b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextFieldStyling.kt index 1596491b2..77d3d8949 100644 --- a/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextFieldStyling.kt +++ b/int-ui/int-ui-standalone/src/main/kotlin/org/jetbrains/jewel/intui/standalone/styling/IntUiTextFieldStyling.kt @@ -4,14 +4,11 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.shape.CornerSize import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.dp -import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.intui.core.theme.IntUiDarkTheme import org.jetbrains.jewel.intui.core.theme.IntUiLightTheme -import org.jetbrains.jewel.intui.standalone.theme.createDefaultTextStyle import org.jetbrains.jewel.ui.component.styling.TextFieldColors import org.jetbrains.jewel.ui.component.styling.TextFieldMetrics import org.jetbrains.jewel.ui.component.styling.TextFieldStyle @@ -20,15 +17,13 @@ import org.jetbrains.jewel.ui.component.styling.TextFieldStyle public fun TextFieldStyle.Companion.light( colors: TextFieldColors = TextFieldColors.light(), metrics: TextFieldMetrics = TextFieldMetrics.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), -): TextFieldStyle = TextFieldStyle(colors, metrics, textStyle) +): TextFieldStyle = TextFieldStyle(colors, metrics) @Composable public fun TextFieldStyle.Companion.dark( colors: TextFieldColors = TextFieldColors.dark(), metrics: TextFieldMetrics = TextFieldMetrics.defaults(), - textStyle: TextStyle = JewelTheme.createDefaultTextStyle(), -): TextFieldStyle = TextFieldStyle(colors, metrics, textStyle) +): TextFieldStyle = TextFieldStyle(colors, metrics) @Composable public fun TextFieldColors.Companion.light( diff --git a/ui/api/ui.api b/ui/api/ui.api index 5d8a4cb21..a9fea4f96 100644 --- a/ui/api/ui.api +++ b/ui/api/ui.api @@ -414,9 +414,9 @@ public final class org/jetbrains/jewel/ui/component/LinearProgressBarKt { } public final class org/jetbrains/jewel/ui/component/LinkKt { - public static final fun DropdownLink-o1X-F34 (Ljava/lang/String;Landroidx/compose/ui/Modifier;ZJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JIIJLandroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/LinkStyle;Landroidx/compose/ui/Modifier;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;III)V - public static final fun ExternalLink-bWaSZw8 (Ljava/lang/String;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ZJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JIIJLandroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/LinkStyle;Landroidx/compose/runtime/Composer;III)V - public static final fun Link-bWaSZw8 (Ljava/lang/String;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ZJLandroidx/compose/ui/text/font/FontStyle;Landroidx/compose/ui/text/font/FontWeight;Landroidx/compose/ui/text/font/FontFamily;JIIJLandroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/LinkStyle;Landroidx/compose/runtime/Composer;III)V + public static final fun DropdownLink-RWo7tUw (Ljava/lang/String;Landroidx/compose/ui/Modifier;ZLandroidx/compose/ui/text/TextStyle;ILandroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/LinkStyle;Landroidx/compose/ui/Modifier;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V + public static final fun ExternalLink-kye4rC8 (Ljava/lang/String;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ZLandroidx/compose/ui/text/TextStyle;ILandroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/LinkStyle;Landroidx/compose/runtime/Composer;II)V + public static final fun Link-kye4rC8 (Ljava/lang/String;Lkotlin/jvm/functions/Function0;Landroidx/compose/ui/Modifier;ZLandroidx/compose/ui/text/TextStyle;ILandroidx/compose/foundation/interaction/MutableInteractionSource;Lorg/jetbrains/jewel/ui/component/styling/LinkStyle;Landroidx/compose/runtime/Composer;II)V } public final class org/jetbrains/jewel/ui/component/LinkState : org/jetbrains/jewel/foundation/state/FocusableComponentState { @@ -1203,13 +1203,12 @@ public final class org/jetbrains/jewel/ui/component/styling/DropdownMetrics$Comp public final class org/jetbrains/jewel/ui/component/styling/DropdownStyle { public static final field $stable I public static final field Companion Lorg/jetbrains/jewel/ui/component/styling/DropdownStyle$Companion; - public fun (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Landroidx/compose/ui/text/TextStyle;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;)V + public fun (Lorg/jetbrains/jewel/ui/component/styling/DropdownColors;Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics;Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons;Lorg/jetbrains/jewel/ui/component/styling/MenuStyle;)V public fun equals (Ljava/lang/Object;)Z public final fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/DropdownColors; public final fun getIcons ()Lorg/jetbrains/jewel/ui/component/styling/DropdownIcons; public final fun getMenuStyle ()Lorg/jetbrains/jewel/ui/component/styling/MenuStyle; public final fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/DropdownMetrics; - public final fun getTextStyle ()Landroidx/compose/ui/text/TextStyle; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -1425,7 +1424,6 @@ public abstract interface class org/jetbrains/jewel/ui/component/styling/InputFi public abstract interface class org/jetbrains/jewel/ui/component/styling/InputFieldStyle { public abstract fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/InputFieldColors; public abstract fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/InputFieldMetrics; - public abstract fun getTextStyle ()Landroidx/compose/ui/text/TextStyle; } public final class org/jetbrains/jewel/ui/component/styling/LazyTreeColors { @@ -1553,12 +1551,11 @@ public final class org/jetbrains/jewel/ui/component/styling/LinkMetrics$Companio public final class org/jetbrains/jewel/ui/component/styling/LinkStyle { public static final field $stable I public static final field Companion Lorg/jetbrains/jewel/ui/component/styling/LinkStyle$Companion; - public fun (Lorg/jetbrains/jewel/ui/component/styling/LinkColors;Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics;Lorg/jetbrains/jewel/ui/component/styling/LinkIcons;Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles;)V + public fun (Lorg/jetbrains/jewel/ui/component/styling/LinkColors;Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics;Lorg/jetbrains/jewel/ui/component/styling/LinkIcons;)V public fun equals (Ljava/lang/Object;)Z public final fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/LinkColors; public final fun getIcons ()Lorg/jetbrains/jewel/ui/component/styling/LinkIcons; public final fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/LinkMetrics; - public final fun getTextStyles ()Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -1570,25 +1567,6 @@ public final class org/jetbrains/jewel/ui/component/styling/LinkStylingKt { public static final fun getLocalLinkStyle ()Landroidx/compose/runtime/ProvidableCompositionLocal; } -public final class org/jetbrains/jewel/ui/component/styling/LinkTextStyles { - public static final field $stable I - public static final field Companion Lorg/jetbrains/jewel/ui/component/styling/LinkTextStyles$Companion; - public fun (Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;Landroidx/compose/ui/text/TextStyle;)V - public fun equals (Ljava/lang/Object;)Z - public final fun getDisabled ()Landroidx/compose/ui/text/TextStyle; - public final fun getFocused ()Landroidx/compose/ui/text/TextStyle; - public final fun getHovered ()Landroidx/compose/ui/text/TextStyle; - public final fun getNormal ()Landroidx/compose/ui/text/TextStyle; - public final fun getPressed ()Landroidx/compose/ui/text/TextStyle; - public final fun getVisited ()Landroidx/compose/ui/text/TextStyle; - public fun hashCode ()I - public final fun styleFor-Qusrf_U (JLandroidx/compose/runtime/Composer;I)Landroidx/compose/runtime/State; - public fun toString ()Ljava/lang/String; -} - -public final class org/jetbrains/jewel/ui/component/styling/LinkTextStyles$Companion { -} - public final class org/jetbrains/jewel/ui/component/styling/MenuColors { public static final field $stable I public static final field Companion Lorg/jetbrains/jewel/ui/component/styling/MenuColors$Companion; @@ -2182,13 +2160,12 @@ public final class org/jetbrains/jewel/ui/component/styling/TextAreaMetrics$Comp public final class org/jetbrains/jewel/ui/component/styling/TextAreaStyle : org/jetbrains/jewel/ui/component/styling/InputFieldStyle { public static final field $stable I public static final field Companion Lorg/jetbrains/jewel/ui/component/styling/TextAreaStyle$Companion; - public fun (Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors;Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics;Landroidx/compose/ui/text/TextStyle;)V + public fun (Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors;Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics;)V public fun equals (Ljava/lang/Object;)Z public synthetic fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/InputFieldColors; public fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/TextAreaColors; public synthetic fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/InputFieldMetrics; public fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/TextAreaMetrics; - public fun getTextStyle ()Landroidx/compose/ui/text/TextStyle; public fun hashCode ()I public fun toString ()Ljava/lang/String; } @@ -2256,13 +2233,12 @@ public final class org/jetbrains/jewel/ui/component/styling/TextFieldMetrics$Com public final class org/jetbrains/jewel/ui/component/styling/TextFieldStyle : org/jetbrains/jewel/ui/component/styling/InputFieldStyle { public static final field $stable I public static final field Companion Lorg/jetbrains/jewel/ui/component/styling/TextFieldStyle$Companion; - public fun (Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors;Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics;Landroidx/compose/ui/text/TextStyle;)V + public fun (Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors;Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics;)V public fun equals (Ljava/lang/Object;)Z public synthetic fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/InputFieldColors; public fun getColors ()Lorg/jetbrains/jewel/ui/component/styling/TextFieldColors; public synthetic fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/InputFieldMetrics; public fun getMetrics ()Lorg/jetbrains/jewel/ui/component/styling/TextFieldMetrics; - public fun getTextStyle ()Landroidx/compose/ui/text/TextStyle; public fun hashCode ()I public fun toString ()Ljava/lang/String; } diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/InputField.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/InputField.kt index 37cbf239f..a61cb7db8 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/InputField.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/InputField.kt @@ -89,7 +89,7 @@ internal fun InputField( } val contentColor by colors.contentFor(inputState) - val mergedTextStyle = style.textStyle.merge(textStyle).copy(color = contentColor) + val mergedTextStyle = textStyle.copy(color = contentColor) val caretColor by colors.caretFor(inputState) BasicTextField( diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Link.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Link.kt index 3cc973ae2..96c8a1395 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Link.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/Link.kt @@ -27,12 +27,7 @@ import androidx.compose.ui.input.pointer.pointerHoverIcon import androidx.compose.ui.platform.LocalInputModeManager import androidx.compose.ui.semantics.Role import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontStyle -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.unit.TextUnit import org.jetbrains.jewel.foundation.modifier.onHover import org.jetbrains.jewel.foundation.state.CommonStateBitMask import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Active @@ -41,6 +36,7 @@ import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Focused import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Hovered import org.jetbrains.jewel.foundation.state.CommonStateBitMask.Pressed import org.jetbrains.jewel.foundation.state.FocusableComponentState +import org.jetbrains.jewel.foundation.theme.JewelTheme import org.jetbrains.jewel.foundation.theme.JewelTheme.Companion.isSwingCompatMode import org.jetbrains.jewel.ui.component.styling.LinkStyle import org.jetbrains.jewel.ui.component.styling.LocalLinkStyle @@ -59,14 +55,8 @@ public fun Link( onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, - fontSize: TextUnit = TextUnit.Unspecified, - fontStyle: FontStyle? = null, - fontWeight: FontWeight? = null, - fontFamily: FontFamily? = null, - letterSpacing: TextUnit = TextUnit.Unspecified, - textAlign: TextAlign = TextAlign.Unspecified, + textStyle: TextStyle = JewelTheme.defaultTextStyle, overflow: TextOverflow = TextOverflow.Clip, - lineHeight: TextUnit = TextUnit.Unspecified, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, style: LinkStyle = LocalLinkStyle.current, ) { @@ -75,16 +65,10 @@ public fun Link( onClick = onClick, modifier = modifier, enabled = enabled, - fontSize = fontSize, - fontStyle = fontStyle, - fontWeight = fontWeight, - fontFamily = fontFamily, - letterSpacing = letterSpacing, - textAlign = textAlign, overflow = overflow, - lineHeight = lineHeight, interactionSource = interactionSource, style = style, + textStyle = textStyle, icon = null, ) } @@ -95,14 +79,8 @@ public fun ExternalLink( onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, - fontSize: TextUnit = TextUnit.Unspecified, - fontStyle: FontStyle? = null, - fontWeight: FontWeight? = null, - fontFamily: FontFamily? = null, - letterSpacing: TextUnit = TextUnit.Unspecified, - textAlign: TextAlign = TextAlign.Unspecified, + textStyle: TextStyle = JewelTheme.defaultTextStyle, overflow: TextOverflow = TextOverflow.Clip, - lineHeight: TextUnit = TextUnit.Unspecified, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, style: LinkStyle = LocalLinkStyle.current, ) { @@ -111,16 +89,10 @@ public fun ExternalLink( onClick = onClick, modifier = modifier, enabled = enabled, - fontSize = fontSize, - fontStyle = fontStyle, - fontWeight = fontWeight, - fontFamily = fontFamily, - letterSpacing = letterSpacing, - textAlign = textAlign, overflow = overflow, - lineHeight = lineHeight, interactionSource = interactionSource, style = style, + textStyle = textStyle, icon = style.icons.externalLink, ) } @@ -130,14 +102,8 @@ public fun DropdownLink( text: String, modifier: Modifier = Modifier, enabled: Boolean = true, - fontSize: TextUnit = TextUnit.Unspecified, - fontStyle: FontStyle? = null, - fontWeight: FontWeight? = null, - fontFamily: FontFamily? = null, - letterSpacing: TextUnit = TextUnit.Unspecified, - textAlign: TextAlign = TextAlign.Unspecified, + textStyle: TextStyle = JewelTheme.defaultTextStyle, overflow: TextOverflow = TextOverflow.Clip, - lineHeight: TextUnit = TextUnit.Unspecified, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, style: LinkStyle = LocalLinkStyle.current, menuModifier: Modifier = Modifier, @@ -159,16 +125,10 @@ public fun DropdownLink( }, modifier = modifier, enabled = enabled, - fontSize = fontSize, - fontStyle = fontStyle, - fontWeight = fontWeight, - fontFamily = fontFamily, - letterSpacing = letterSpacing, - textAlign = textAlign, overflow = overflow, - lineHeight = lineHeight, interactionSource = interactionSource, style = style, + textStyle = textStyle, icon = style.icons.dropdownChevron, ) @@ -197,14 +157,8 @@ private fun LinkImpl( onClick: () -> Unit, modifier: Modifier, enabled: Boolean, - fontSize: TextUnit, - fontStyle: FontStyle?, - fontWeight: FontWeight?, - fontFamily: FontFamily?, - letterSpacing: TextUnit, - textAlign: TextAlign, + textStyle: TextStyle, overflow: TextOverflow, - lineHeight: TextUnit, interactionSource: MutableInteractionSource, icon: IconKey?, ) { @@ -235,23 +189,6 @@ private fun LinkImpl( val textColor by style.colors.contentFor(linkState) - val mergedStyle = - style.textStyles - .styleFor(linkState) - .value - .merge( - TextStyle( - color = textColor, - fontSize = fontSize, - fontWeight = fontWeight, - textAlign = textAlign, - lineHeight = lineHeight, - fontFamily = fontFamily, - fontStyle = fontStyle, - letterSpacing = letterSpacing, - ), - ) - val pointerChangeModifier = Modifier.pointerHoverIcon(PointerIcon(Cursor(Cursor.HAND_CURSOR))) Row( @@ -273,7 +210,7 @@ private fun LinkImpl( ) { BasicText( text = text, - style = mergedStyle, + style = textStyle.merge(textColor), overflow = overflow, softWrap = true, maxLines = 1, diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/DropdownStyling.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/DropdownStyling.kt index c2999395f..8b09d5252 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/DropdownStyling.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/DropdownStyling.kt @@ -10,7 +10,6 @@ import androidx.compose.runtime.State import androidx.compose.runtime.rememberUpdatedState import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import org.jetbrains.jewel.foundation.GenerateDataFunctions @@ -23,7 +22,6 @@ public class DropdownStyle( public val colors: DropdownColors, public val metrics: DropdownMetrics, public val icons: DropdownIcons, - public val textStyle: TextStyle, public val menuStyle: MenuStyle, ) { public companion object diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/InputFieldStyling.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/InputFieldStyling.kt index 28f4bdca2..2f3593e5d 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/InputFieldStyling.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/InputFieldStyling.kt @@ -8,7 +8,6 @@ import androidx.compose.runtime.Stable import androidx.compose.runtime.State import androidx.compose.runtime.rememberUpdatedState import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import org.jetbrains.jewel.ui.component.InputFieldState @@ -17,7 +16,6 @@ import org.jetbrains.jewel.ui.component.InputFieldState public interface InputFieldStyle { public val colors: InputFieldColors public val metrics: InputFieldMetrics - public val textStyle: TextStyle } @Immutable diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/LinkStyling.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/LinkStyling.kt index 65b9094e4..c77c80e12 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/LinkStyling.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/LinkStyling.kt @@ -8,7 +8,6 @@ import androidx.compose.runtime.State import androidx.compose.runtime.rememberUpdatedState import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import org.jetbrains.jewel.foundation.GenerateDataFunctions @@ -21,7 +20,6 @@ public class LinkStyle( public val colors: LinkColors, public val metrics: LinkMetrics, public val icons: LinkIcons, - public val textStyles: LinkTextStyles, ) { public companion object } @@ -72,33 +70,6 @@ public class LinkIcons( public companion object } -@Immutable -@GenerateDataFunctions -public class LinkTextStyles( - public val normal: TextStyle, - public val disabled: TextStyle, - public val focused: TextStyle, - public val pressed: TextStyle, - public val hovered: TextStyle, - public val visited: TextStyle, -) { - @Composable - public fun styleFor(state: LinkState): State = - rememberUpdatedState( - state.chooseValueWithVisited( - normal = normal, - disabled = disabled, - focused = focused, - pressed = pressed, - hovered = hovered, - visited = visited, - active = normal, - ), - ) - - public companion object -} - public val LocalLinkStyle: ProvidableCompositionLocal = staticCompositionLocalOf { error("No LinkStyle provided. Have you forgotten the theme?") diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextAreaStyling.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextAreaStyling.kt index 26a7238fa..eb89bda16 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextAreaStyling.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextAreaStyling.kt @@ -7,7 +7,6 @@ import androidx.compose.runtime.ProvidableCompositionLocal import androidx.compose.runtime.Stable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import org.jetbrains.jewel.foundation.GenerateDataFunctions @@ -17,7 +16,6 @@ import org.jetbrains.jewel.foundation.GenerateDataFunctions public class TextAreaStyle( override val colors: TextAreaColors, override val metrics: TextAreaMetrics, - override val textStyle: TextStyle, ) : InputFieldStyle { public companion object } diff --git a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextFieldStyling.kt b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextFieldStyling.kt index 55a605173..1aaa804e7 100644 --- a/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextFieldStyling.kt +++ b/ui/src/main/kotlin/org/jetbrains/jewel/ui/component/styling/TextFieldStyling.kt @@ -7,7 +7,6 @@ import androidx.compose.runtime.ProvidableCompositionLocal import androidx.compose.runtime.Stable import androidx.compose.runtime.staticCompositionLocalOf import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.DpSize import org.jetbrains.jewel.foundation.GenerateDataFunctions @@ -17,7 +16,6 @@ import org.jetbrains.jewel.foundation.GenerateDataFunctions public class TextFieldStyle( override val colors: TextFieldColors, override val metrics: TextFieldMetrics, - override val textStyle: TextStyle, ) : InputFieldStyle { public companion object }