From 5a1be66c8a2851d95f94b0b800437ebfa4093255 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 11 Sep 2023 12:41:14 +0200 Subject: [PATCH] REVIEWED: `GuiToggleSlider()` focus on mouse-hover --- src/raygui.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/raygui.h b/src/raygui.h index f4bf0d8..a629580 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -2142,7 +2142,8 @@ int GuiToggleSlider(Rectangle bounds, const char *text, int *active) } else state = STATE_FOCUSED; } - else if (*active) state = STATE_PRESSED; + + if ((*active) && (state != STATE_FOCUSED)) state = STATE_PRESSED; } if (*active >= itemCount) *active = 0;