@@ -38,22 +38,22 @@ fun java.awt.Color.toComposeColor() = Color(
38
38
fun java.awt.Color?.toComposeColorOrUnspecified () = this ?.toComposeColor() ? : Color .Unspecified
39
39
40
40
@Suppress(" UnstableApiUsage" )
41
- internal fun retrieveColorOrNull (key : String ) =
41
+ fun retrieveColorOrNull (key : String ) =
42
42
JBColor .namedColor(key)
43
43
.takeUnless { it.name == " NAMED_COLOR_FALLBACK_MARKER" }
44
44
?.toComposeColor()
45
45
46
- internal fun retrieveColorOrUnspecified (key : String ): Color {
46
+ fun retrieveColorOrUnspecified (key : String ): Color {
47
47
val color = retrieveColorOrNull(key)
48
48
if (color == null ) {
49
49
logger.warn(" Color with key \" $key \" not found, fallback to 'Color.Unspecified'" )
50
50
}
51
51
return color ? : Color .Unspecified
52
52
}
53
53
54
- internal fun retrieveColorsOrUnspecified (vararg keys : String ) = keys.map { retrieveColorOrUnspecified(it) }
54
+ fun retrieveColorsOrUnspecified (vararg keys : String ) = keys.map { retrieveColorOrUnspecified(it) }
55
55
56
- internal fun List<Color>.createVerticalBrush (
56
+ fun List<Color>.createVerticalBrush (
57
57
startY : Float = 0.0f,
58
58
endY : Float = Float .POSITIVE_INFINITY ,
59
59
tileMode : TileMode = TileMode .Clamp ,
@@ -67,29 +67,29 @@ internal fun List<Color>.createVerticalBrush(
67
67
return Brush .verticalGradient(this , startY, endY, tileMode)
68
68
}
69
69
70
- internal fun retrieveIntAsDp (key : String ): Dp {
70
+ fun retrieveIntAsDp (key : String ): Dp {
71
71
val rawValue = UIManager .get(key)
72
72
if (rawValue is Int ) rawValue.dp
73
73
74
74
keyNotFound(key, " Int" )
75
75
}
76
76
77
- internal fun retrieveIntAsDpOrUnspecified (key : String ) =
77
+ fun retrieveIntAsDpOrUnspecified (key : String ) =
78
78
try {
79
79
retrieveIntAsDp(key)
80
80
} catch (ignored: JewelBridgeException ) {
81
81
Dp .Unspecified
82
82
}
83
83
84
- internal fun retrieveInsetsAsPaddingValues (key : String ) =
84
+ fun retrieveInsetsAsPaddingValues (key : String ) =
85
85
UIManager .getInsets(key)
86
86
?.let { PaddingValues (it.left.dp, it.top.dp, it.right.dp, it.bottom.dp) }
87
87
? : keyNotFound(key, " Insets" )
88
88
89
- internal fun retrieveArcAsCornerSize (key : String ) =
89
+ fun retrieveArcAsCornerSize (key : String ) =
90
90
CornerSize (retrieveIntAsDp(key) / 2 )
91
91
92
- internal fun retrieveArcAsCornerSizeWithFallbacks (vararg keys : String ): CornerSize {
92
+ fun retrieveArcAsCornerSizeWithFallbacks (vararg keys : String ): CornerSize {
93
93
for (key in keys) {
94
94
val rawValue = UIManager .get(key)
95
95
if (rawValue is Int ) {
@@ -106,13 +106,14 @@ internal fun retrieveArcAsCornerSizeWithFallbacks(vararg keys: String): CornerSi
106
106
@OptIn(DependsOnJBR ::class )
107
107
private val awtFontManager = AwtFontManager ()
108
108
109
- internal suspend fun retrieveTextStyle (fontKey : String , colorKey : String? = null): TextStyle {
109
+ @DependsOnJBR
110
+ suspend fun retrieveTextStyle (fontKey : String , colorKey : String? = null): TextStyle {
110
111
val baseColor = colorKey?.let { retrieveColorOrUnspecified(colorKey) } ? : Color .Unspecified
111
112
return retrieveTextStyle(fontKey, color = baseColor)
112
113
}
113
114
114
- @OptIn( DependsOnJBR :: class )
115
- internal suspend fun retrieveTextStyle (
115
+ @DependsOnJBR
116
+ suspend fun retrieveTextStyle (
116
117
key : String ,
117
118
color : Color = Color .Unspecified ,
118
119
lineHeight : TextUnit = TextUnit .Unspecified ,
@@ -140,22 +141,10 @@ internal suspend fun retrieveTextStyle(
140
141
}
141
142
}
142
143
143
- internal val JBValue .dp
144
+ val JBValue .dp
144
145
get() = unscaled.dp
145
146
146
- internal fun TextStyle.derive (sizeDelta : Float , weight : FontWeight ? = fontWeight, color : Color = toSpanStyle().color) =
147
- copy(fontSize = fontSize - sizeDelta, fontWeight = weight, color = color)
148
-
149
- internal operator fun TextUnit.minus (delta : Float ) = plus(- delta)
150
-
151
- internal operator fun TextUnit.plus (delta : Float ) =
152
- when {
153
- isSp -> TextUnit (value + delta, type)
154
- isEm -> TextUnit (value + delta, type)
155
- else -> this
156
- }
157
-
158
- internal fun <T : InteractiveComponentState > retrieveStatefulIcon (
147
+ fun <T : InteractiveComponentState > retrieveStatefulIcon (
159
148
iconPath : String ,
160
149
svgLoader : SvgLoader ,
161
150
iconData : IntelliJThemeIconData ,
@@ -170,7 +159,7 @@ internal fun <T : InteractiveComponentState> retrieveStatefulIcon(
170
159
suffixTokensProvider,
171
160
)
172
161
173
- internal fun retrieveStatelessIcon (
162
+ fun retrieveStatelessIcon (
174
163
iconPath : String ,
175
164
svgLoader : SvgLoader ,
176
165
iconData : IntelliJThemeIconData ,
0 commit comments