Skip to content

Commit 1510a62

Browse files
committed
fixed bind button id conflicts
1 parent 39d6b05 commit 1510a62

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/kotlin/com/lambda/config/settings/complex/KeybindSetting.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,18 @@ class KeybindSettingCore(defaultValue: Bind) : SettingCore<Bind>(
6666
if (listening) "Press any key…"
6767
else bind.name
6868

69-
if (listening) {
70-
withStyleColor(ImGuiCol.Button, 0.20f, 0.50f, 1.00f, 1.00f) {
71-
withStyleColor(ImGuiCol.ButtonHovered, 0.25f, 0.60f, 1.00f, 1.00f) {
72-
withStyleColor(ImGuiCol.ButtonActive, 0.20f, 0.50f, 0.95f, 1.00f) {
73-
button(preview)
69+
withId("##Bind-${this@KeybindSettingCore.hashCode()}") {
70+
if (listening) {
71+
withStyleColor(ImGuiCol.Button, 0.20f, 0.50f, 1.00f, 1.00f) {
72+
withStyleColor(ImGuiCol.ButtonHovered, 0.25f, 0.60f, 1.00f, 1.00f) {
73+
withStyleColor(ImGuiCol.ButtonActive, 0.20f, 0.50f, 0.95f, 1.00f) {
74+
button(preview)
75+
}
7476
}
7577
}
78+
} else {
79+
button(preview) { listening = true }
7680
}
77-
} else {
78-
button(preview) { listening = true }
7981
}
8082

8183
lambdaTooltip {
@@ -88,7 +90,7 @@ class KeybindSettingCore(defaultValue: Bind) : SettingCore<Bind>(
8890
}
8991

9092
sameLine()
91-
smallButton("Unbind") {
93+
withId("##Unbind-${this@KeybindSettingCore.hashCode()}") {
9294
value = Bind.EMPTY
9395
listening = false
9496
}

0 commit comments

Comments
 (0)