Skip to content

Commit 2335739

Browse files
authored
Fix widget labels (JetBrains#3220)
MainView should use title so that if a custom title is available it will be used. Hide readableName to prevent this from happening again by mistake.
1 parent d655e85 commit 2335739

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/MainView.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private fun WidgetsListItemViewImpl(
145145
}
146146

147147
Text(
148-
text = widgetsType.readableName,
148+
text = widgetsType.title,
149149
color = textColor,
150150
modifier = Modifier
151151
.align(Alignment.CenterVertically)

examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/WidgetsType.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ enum class WidgetsType(private val customTitle: String? = null) {
1111
TOGGLES,
1212
UI_CARDS("UI Cards");
1313

14-
val readableName: String by lazy {
14+
private val readableName: String by lazy {
1515
name.split("_")
1616
.map { it.lowercase() }
1717
.mapIndexed { i, it ->

0 commit comments

Comments
 (0)