mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 10:02:04 +08:00
docs(jetbrains): replace Color enum with Theme in UI DSL binding example
Avoid confusion with java.awt.Color which the AGENTS.md itself says to never use. Use a Theme enum instead to keep the example unambiguous.
This commit is contained in:
@@ -416,11 +416,13 @@ Bind component values to model properties. Values are applied on `DialogPanel.ap
|
||||
| `buttonsGroup {}.bind(model::prop)` | radio group |
|
||||
|
||||
```kotlin
|
||||
enum class Theme { LIGHT, DARK }
|
||||
|
||||
data class Settings(
|
||||
var name: String = "",
|
||||
var count: Int = 0,
|
||||
var enabled: Boolean = false,
|
||||
var color: Color = Color.GREY,
|
||||
var theme: Theme = Theme.LIGHT,
|
||||
)
|
||||
|
||||
val model = Settings()
|
||||
@@ -435,10 +437,10 @@ val panel = panel {
|
||||
row {
|
||||
checkBox("Enabled").bindSelected(model::enabled)
|
||||
}
|
||||
buttonsGroup("Color:") {
|
||||
row { radioButton("White", Color.WHITE) }
|
||||
row { radioButton("Grey", Color.GREY) }
|
||||
}.bind(model::color)
|
||||
buttonsGroup("Theme:") {
|
||||
row { radioButton("Light", Theme.LIGHT) }
|
||||
row { radioButton("Dark", Theme.DARK) }
|
||||
}.bind(model::theme)
|
||||
}
|
||||
|
||||
// Later:
|
||||
|
||||
Reference in New Issue
Block a user