Browse Source

Fix widget labels (#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.
pull/3315/head
Trey Ethridge 1 year ago committed by GitHub
parent
commit
2335739734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/MainView.kt
  2. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/WidgetsType.kt

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

@ -145,7 +145,7 @@ private fun WidgetsListItemViewImpl(
}
Text(
text = widgetsType.readableName,
text = widgetsType.title,
color = textColor,
modifier = Modifier
.align(Alignment.CenterVertically)

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

@ -11,7 +11,7 @@ enum class WidgetsType(private val customTitle: String? = null) {
TOGGLES,
UI_CARDS("UI Cards");
val readableName: String by lazy {
private val readableName: String by lazy {
name.split("_")
.map { it.lowercase() }
.mapIndexed { i, it ->

Loading…
Cancel
Save