Skip to content

Commit 452d2c2

Browse files
authored
fix: invoke button not registering clicks on custom types (#19)
* fix: invoke button not registering clicks on custom types Root cause: ImGui::Button() intermittently failed to register clicks when rendered inside nested CollapsingHeader > BeginChild > BeginTable > PushID scopes, specifically affecting custom type method lists. Replaced with raw InvisibleButton + IsItemClicked() which bypasses the Button state machine. Additional changes: - Update ImGui from v1.90.1 WIP to v1.92.8 stable - Fix AddRect() parameter order (thickness before flags in v1.92.8) - Rename ImGuiChildFlags_Border to ImGuiChildFlags_Borders (v1.91.1+) - Fix RefreshTabData clearing navigation stack for non-GameObject tabs - Add incremental window IDs to FieldEditor to prevent stale state - Center invoke popup on screen with ImGuiCond_Appearing - Clear resultPointer and resultEditableType when reopening invoke popup * fix: update DarkPlus theme for ImGui v1.92.8 color enum changes SetDarkPlusTheme() was missing 17 new ImGuiCol_ slots added in v1.92.8 (CheckboxSelectedBg, InputTextCursor, TabSelectedOverline, TabDimmed*, Table*Bg, TextLink, TreeLines, DragDropTargetBg, UnsavedMarker, NavCursor, NavWindowing*, ModalWindowDimBg). Also renamed ImGuiCol_TabActive to ImGuiCol_TabSelected (obsoleted in v1.90.9).
1 parent 25933b5 commit 452d2c2

22 files changed

Lines changed: 22836 additions & 10349 deletions

UnityInspector/library/imgui/imconfig.h

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,21 @@
1515
#pragma once
1616

1717
//---- Define assertion handler. Defaults to calling assert().
18-
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
18+
// - If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
19+
// - Compiling with NDEBUG will usually strip out assert() to nothing, which is NOT recommended because we use asserts to notify of programmer mistakes.
1920
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
2021
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
2122

2223
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
2324
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
24-
// DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
25-
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
26-
//#define IMGUI_API __declspec( dllexport )
27-
//#define IMGUI_API __declspec( dllimport )
25+
// - Windows DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
26+
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
27+
//#define IMGUI_API __declspec(dllexport) // MSVC Windows: DLL export
28+
//#define IMGUI_API __declspec(dllimport) // MSVC Windows: DLL import
29+
//#define IMGUI_API __attribute__((visibility("default"))) // GCC/Clang: override visibility when set is hidden
2830

2931
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to clean your code of obsolete function/names.
3032
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
31-
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87+ disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This is automatically done by IMGUI_DISABLE_OBSOLETE_FUNCTIONS.
3233

3334
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
3435
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
@@ -42,20 +43,30 @@
4243
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
4344
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, IME).
4445
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
46+
//#define IMGUI_DISABLE_DEFAULT_SHELL_FUNCTIONS // Don't implement default platform_io.Platform_OpenInShellFn() handler (Win32: ShellExecute(), require shell32.lib/.a, Mac/Linux: use system("")).
4547
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
4648
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
4749
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
4850
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
4951
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
52+
//#define IMGUI_DISABLE_DEFAULT_FONT // Disable default embedded fonts (ProggyClean/ProggyForever), remove ~9 KB + ~14 KB from output binary. AddFontDefaultXXX() functions will assert.
5053
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
5154

55+
//---- Enable Test Engine / Automation features.
56+
//#define IMGUI_ENABLE_TEST_ENGINE // Enable imgui_test_engine hooks. Generally set automatically by include "imgui_te_config.h", see Test Engine for details.
57+
5258
//---- Include imgui_user.h at the end of imgui.h as a convenience
59+
// May be convenient for some users to only explicitly include vanilla imgui.h and have extra stuff included.
5360
//#define IMGUI_INCLUDE_IMGUI_USER_H
61+
//#define IMGUI_USER_H_FILENAME "my_folder/my_imgui_user.h"
5462

55-
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
63+
//---- Pack vertex colors as BGRA8 instead of RGBA8 (to avoid converting from one to another). Need dedicated backend support.
5664
//#define IMGUI_USE_BGRA_PACKED_COLOR
5765

58-
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
66+
//---- Use legacy CRC32-adler tables (used before 1.91.6), in order to preserve old .ini data that you cannot afford to invalidate.
67+
//#define IMGUI_USE_LEGACY_CRC32_ADLER
68+
69+
//---- Use 32-bit for ImWchar (default is 16-bit) to support Unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
5970
//#define IMGUI_USE_WCHAR32
6071

6172
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
@@ -73,13 +84,16 @@
7384

7485
//---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
7586
// Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
87+
// Note that imgui_freetype.cpp may be used _without_ this define, if you manually call ImFontAtlas::SetFontLoader(). The define is simply a convenience.
7688
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
7789
//#define IMGUI_ENABLE_FREETYPE
7890

79-
//---- Use FreeType+lunasvg library to render OpenType SVG fonts (SVGinOT)
80-
// Requires lunasvg headers to be available in the include path + program to be linked with the lunasvg library (not provided).
91+
//---- Use FreeType + plutosvg or lunasvg to render OpenType SVG fonts (SVGinOT)
8192
// Only works in combination with IMGUI_ENABLE_FREETYPE.
82-
// (implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
93+
// - plutosvg is currently easier to install, as e.g. it is part of vcpkg. It will support more fonts and may load them faster. See misc/freetype/README for instructions.
94+
// - Both require headers to be available in the include path + program to be linked with the library code (not provided).
95+
// - (note: lunasvg implementation is based on Freetype's rsvg-port.c which is licensed under CeCILL-C Free Software License Agreement)
96+
//#define IMGUI_ENABLE_FREETYPE_PLUTOSVG
8397
//#define IMGUI_ENABLE_FREETYPE_LUNASVG
8498

8599
//---- Use stb_truetype to build and rasterize the font atlas (default)
@@ -117,6 +131,10 @@
117131
//#define IM_DEBUG_BREAK IM_ASSERT(0)
118132
//#define IM_DEBUG_BREAK __debugbreak()
119133

134+
//---- Debug Tools: Enable highlight ID conflicts _before_ hovering items. When io.ConfigDebugHighlightIdConflicts is set.
135+
// (THIS WILL SLOW DOWN DEAR IMGUI. Only use occasionally and disable after use)
136+
//#define IMGUI_DEBUG_HIGHLIGHT_ALL_ID_CONFLICTS
137+
120138
//---- Debug Tools: Enable slower asserts
121139
//#define IMGUI_DEBUG_PARANOID
122140

0 commit comments

Comments
 (0)