Skip to content

Commit

Permalink
Avoid init bridge theme with unspecified fontSize
Browse files Browse the repository at this point in the history
  • Loading branch information
rock3r committed Mar 19, 2024
1 parent a6b5a76 commit f9f35ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jetbrains.jewel.bridge

import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.sp
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.Service.Level
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -49,20 +50,21 @@ internal class SwingBridgeService(scope: CoroutineScope) {
val componentStyling: ComponentStyling,
) {

public companion object {
companion object {

val DEFAULT = run {
val themeDefinition = createBridgeThemeDefinition(TextStyle.Default)
val textStyle = TextStyle.Default.copy(fontSize = 13.sp)
val themeDefinition = createBridgeThemeDefinition(textStyle)

BridgeThemeData(
themeDefinition = themeDefinition,
componentStyling =
createBridgeComponentStyling(
theme = themeDefinition,
textFieldTextStyle = TextStyle.Default,
textAreaTextStyle = TextStyle.Default,
dropdownTextStyle = TextStyle.Default,
linkTextStyle = TextStyle.Default,
textFieldTextStyle = textStyle,
textAreaTextStyle = textStyle,
dropdownTextStyle = textStyle,
linkTextStyle = textStyle,
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import org.jetbrains.jewel.ui.component.Slider
import org.jetbrains.jewel.ui.component.Text
import org.jetbrains.jewel.ui.component.TextField
import org.jetbrains.jewel.ui.component.Tooltip
import org.jetbrains.jewel.ui.component.Typography

@Composable
internal fun ComponentShowcaseTab() {
Expand Down Expand Up @@ -78,6 +79,7 @@ private fun RowScope.ColumnOne() {
Modifier.onActivated {
activated = it
},
style = Typography.h3TextStyle()
)

Row(
Expand Down

0 comments on commit f9f35ca

Please sign in to comment.