From 498511e4cfaff7f43d5d3275890370fbda0ac4b6 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 15 Apr 2024 21:22:01 +0200 Subject: [PATCH] REVIEWED: `GuiTabBar()` detect middle button press over tab --- src/raygui.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/raygui.h b/src/raygui.h index 14b2170..8c19cd1 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -1743,6 +1743,9 @@ int GuiTabBar(Rectangle bounds, const char **text, int count, int *active) if (toggle) *active = i; } + // Close tab with middle mouse button pressed + if (CheckCollisionPointRec(GetMousePosition(), tabBounds) && IsMouseButtonPressed(MOUSE_MIDDLE_BUTTON)) result = i; + GuiSetStyle(TOGGLE, TEXT_PADDING, textPadding); GuiSetStyle(TOGGLE, TEXT_ALIGNMENT, textAlignment);