Skip to content

Commit 9cd9c2e

Browse files
committed
Merge branch 'master' into docking
# Conflicts: # docs/CHANGELOG.txt # imgui.cpp # imgui_widgets.cpp
2 parents 9764adc + 9aae45e commit 9cd9c2e

11 files changed

+207
-186
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ jobs:
313313
EOF
314314
g++ -I. -std=c++11 -Wall -Wformat -o example_single_file example_single_file.cpp
315315
316-
- name: Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_METRICS_WINDOW)
316+
- name: Build example_null (with IMGUI_DISABLE_DEMO_WINDOWS and IMGUI_DISABLE_DEBUG_TOOLS)
317317
run: |
318318
cat > example_single_file.cpp <<'EOF'
319319
320320
#define IMGUI_DISABLE_DEMO_WINDOWS
321-
#define IMGUI_DISABLE_METRICS_WINDOW
321+
#define IMGUI_DISABLE_DEBUG_TOOLS
322322
#define IMGUI_IMPLEMENTATION
323323
#include "misc/single_file/imgui_single_file.h"
324324
#include "examples/example_null/main.cpp"

docs/CHANGELOG.txt

+64-54
Large diffs are not rendered by default.

docs/README.md

+9-26
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Individuals: support continued development and maintenance [here](https://www.pa
1616

1717
| [The Pitch](#the-pitch) - [Usage](#usage) - [How it works](#how-it-works) - [Releases & Changelogs](#releases--changelogs) - [Demo](#demo) - [Integration](#integration) |
1818
:----------------------------------------------------------: |
19-
| [Upcoming changes](#upcoming-changes) - [Gallery](#gallery) - [Support, FAQ](#support-frequently-asked-questions-faq) - [How to help](#how-to-help) - [Sponsors](#sponsors) - [Credits](#credits) - [License](#license) |
19+
| [Upcoming changes](#upcoming-changes) - [Gallery](#gallery) - [Support, FAQ](#support-frequently-asked-questions-faq) - [How to help](#how-to-help) - [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors) - [Credits](#credits) - [License](#license) |
2020
| [Wiki](https://github.com/ocornut/imgui/wiki) - [Languages & frameworks backends/bindings](https://github.com/ocornut/imgui/wiki/Bindings) - [Software using Dear ImGui](https://github.com/ocornut/imgui/wiki/Software-using-dear-imgui) - [User quotes](https://github.com/ocornut/imgui/wiki/Quotes) |
2121

2222
### The Pitch
@@ -27,12 +27,12 @@ Dear ImGui is designed to **enable fast iterations** and to **empower programmer
2727

2828
Dear ImGui is particularly suited to integration in games engine (for tooling), real-time 3D applications, fullscreen applications, embedded applications, or any applications on consoles platforms where operating system features are non-standard.
2929

30+
- Minimize state synchronization.
31+
- Minimize state storage on user side.
32+
- Minimize setup and maintenance.
3033
- Easy to use to create code-driven and data-driven tools.
3134
- Easy to use to create ad hoc short-lived tools and long-lived, more elaborate tools.
3235
- Easy to hack and improve.
33-
- Minimize setup and maintenance.
34-
- Minimize state storage on user side.
35-
- Minimize state synchronization.
3636
- Portable, minimize dependencies, run on target (consoles, phones, etc.).
3737
- Efficient runtime and memory consumption.
3838
- Battle-tested, used by many major actors in the game industry.
@@ -182,7 +182,7 @@ Private support is available for paying business customers (E-mail: _contact @ d
182182

183183
**Which version should I get?**
184184

185-
We occasionally tag [Releases](https://github.com/ocornut/imgui/releases) but it is generally safe and recommended to sync to master/latest. The library is fairly stable and regressions tend to be fixed fast when reported.
185+
We occasionally tag [Releases](https://github.com/ocornut/imgui/releases) (with nice releases notes) but it is generally safe and recommended to sync to master/latest. The library is fairly stable and regressions tend to be fixed fast when reported.
186186

187187
Advanced users may want to use the `docking` branch with [Multi-Viewport](https://github.com/ocornut/imgui/issues/1542) and [Docking](https://github.com/ocornut/imgui/issues/2109) features. This branch is kept in sync with master regularly.
188188

@@ -198,31 +198,14 @@ How to help
198198
- See [GitHub Forum/issues](https://github.com/ocornut/imgui/issues) and [Github Discussions](https://github.com/ocornut/imgui/discussions).
199199
- You may help with development and submit pull requests! Please understand that by submitting a PR you are also submitting a request for the maintainer to review your code and then take over its maintenance forever. PR should be crafted both in the interest in the end-users and also to ease the maintainer into understanding and accepting it.
200200
- See [Help wanted](https://github.com/ocornut/imgui/wiki/Help-Wanted) on the [Wiki](https://github.com/ocornut/imgui/wiki/) for some more ideas.
201-
- Have your company financially support this project (please reach by e-mail)
202-
203-
**How can I help financing further development of Dear ImGui?**
204-
205-
See [Sponsors](https://github.com/ocornut/imgui/wiki/Sponsors) page.
201+
- Have your company financially support this project (please reach by e-mail to say hi!).
206202

207203
Sponsors
208204
--------
209205

210-
Ongoing Dear ImGui development is currently financially supported in 2021-2022 by users and private sponsors:
211-
212-
*Platinum-chocolate sponsors*
213-
- [Blizzard](https://careers.blizzard.com/en-us/openings/engineering/all/all/all/1)
214-
215-
*Double-chocolate sponsors*
216-
- [Ubisoft](https://montreal.ubisoft.com/en/ubisoft-sponsors-user-interface-library-for-c-dear-imgui), [Supercell](https://supercell.com)
217-
218-
*Chocolate sponsors*
219-
- [Adobe](https://www.adobe.com/products/medium.html), [Aras Pranckevičius](https://aras-p.info), [Epic](https://www.unrealengine.com/en-US/megagrants), [G3Dvu]().
220-
221-
*Salty-caramel sponsors*
222-
- [Kylotonn](https://www.kylotonn.com), [O-Net Communications (USA)](http://en.o-netcom.com), [Wonderland Engine](https://wonderlandengine.com/).
223-
224-
Please see [detailed list of current and past Dear ImGui supporters](https://github.com/ocornut/imgui/wiki/Sponsors) for more.
225-
From November 2014 to December 2019, ongoing development has also been financially supported by its users on Patreon and through individual donations.
206+
Ongoing Dear ImGui development is and has been financially supported by users and private sponsors.
207+
<BR>Please see **[detailed list of current and past Dear ImGui supporters](https://github.com/ocornut/imgui/wiki/Sponsors)** for details.
208+
<BR>From November 2014 to December 2019, ongoing development has also been financially supported by its users on Patreon and through individual donations.
226209

227210
**THANK YOU to all past and present supporters for helping to keep this project alive and thriving!**
228211

imconfig.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
3131
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
3232

33-
//---- Disable all of Dear ImGui or don't implement standard windows.
34-
// It is very strongly recommended to NOT disable the demo windows during development. Please read comments in imgui_demo.cpp.
33+
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
34+
// 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.
3535
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
36-
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. Not recommended.
37-
//#define IMGUI_DISABLE_METRICS_WINDOW // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty.
36+
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
37+
//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty (this was called IMGUI_DISABLE_METRICS_WINDOW before 1.88).
3838

3939
//---- Don't implement some functions to reduce linkage requirements.
4040
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)

imgui.cpp

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, 1.88 WIP
1+
// dear imgui, v1.88
22
// (main code and documentation)
33

44
// Help:
@@ -395,6 +395,7 @@ CODE
395395
- likewise io.MousePos and GetMousePos() will use OS coordinates.
396396
If you query mouse positions to interact with non-imgui coordinates you will need to offset them, e.g. subtract GetWindowViewport()->Pos.
397397

398+
- 2022/06/15 (1.88) - renamed IMGUI_DISABLE_METRICS_WINDOW to IMGUI_DISABLE_DEBUG_TOOLS for correctness. kept support for old define (will obsolete).
398399
- 2022/05/03 (1.88) - backends: osx: removed ImGui_ImplOSX_HandleEvent() from backend API in favor of backend automatically handling event capture. All ImGui_ImplOSX_HandleEvent() calls should be removed as they are now unnecessary.
399400
- 2022/04/05 (1.88) - inputs: renamed ImGuiKeyModFlags to ImGuiModFlags. Kept inline redirection enums (will obsolete). This was never used in public API functions but technically present in imgui.h and ImGuiIO.
400401
- 2022/01/20 (1.87) - inputs: reworded gamepad IO.
@@ -406,6 +407,7 @@ CODE
406407
- Backend writing to io.MouseWheel -> backend should call io.AddMouseWheelEvent()
407408
- Backend writing to io.MouseHoveredViewport -> backend should call io.AddMouseViewportEvent() [Docking branch w/ multi-viewports only]
408409
note: for all calls to IO new functions, the Dear ImGui context should be bound/current.
410+
read https://github.com/ocornut/imgui/issues/4921 for details.
409411
- 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(). Removed GetKeyIndex(), now unecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details.
410412
- IsKeyPressed(MY_NATIVE_KEY_XXX) -> use IsKeyPressed(ImGuiKey_XXX)
411413
- IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX)
@@ -1085,7 +1087,7 @@ ImGuiStyle::ImGuiStyle()
10851087
ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
10861088
ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar
10871089
ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar
1088-
GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar
1090+
GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar
10891091
GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
10901092
LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
10911093
TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
@@ -8441,7 +8443,7 @@ void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse)
84418443
g.WantCaptureMouseNextFrame = want_capture_mouse ? 1 : 0;
84428444
}
84438445

8444-
#ifndef IMGUI_DISABLE_METRICS_WINDOW
8446+
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
84458447
static const char* GetInputSourceName(ImGuiInputSource source)
84468448
{
84478449
const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" };
@@ -11289,11 +11291,10 @@ static void ImGui::NavUpdateCancelRequest()
1128911291
SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect));
1129011292
NavRestoreHighlightAfterMove();
1129111293
}
11292-
else if (g.OpenPopupStack.Size > 0)
11294+
else if (g.OpenPopupStack.Size > 0 && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
1129311295
{
1129411296
// Close open popup/menu
11295-
if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
11296-
ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
11297+
ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
1129711298
}
1129811299
else
1129911300
{
@@ -17647,7 +17648,7 @@ static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport*, ImGuiPlatformImeDat
1764717648
// - DebugNodeWindowsListByBeginStackParent() [Internal]
1764817649
//-----------------------------------------------------------------------------
1764917650

17650-
#ifndef IMGUI_DISABLE_METRICS_WINDOW
17651+
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
1765117652

1765217653
void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb)
1765317654
{
@@ -17783,6 +17784,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
1778317784
ImGuiContext& g = *GImGui;
1778417785
ImGuiIO& io = g.IO;
1778517786
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
17787+
if (cfg->ShowDebugLog)
17788+
ShowDebugLogWindow(&cfg->ShowDebugLog);
1778617789
if (cfg->ShowStackTool)
1778717790
ShowStackToolWindow(&cfg->ShowStackTool);
1778817791

@@ -19093,7 +19096,7 @@ void ImGui::DebugHookIdInfo(ImGuiID, ImGuiDataType, const void*, const void*) {}
1909319096
void ImGui::UpdateDebugToolItemPicker() {}
1909419097
void ImGui::UpdateDebugToolStackQueries() {}
1909519098

19096-
#endif // #ifndef IMGUI_DISABLE_METRICS_WINDOW
19099+
#endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
1909719100

1909819101
//-----------------------------------------------------------------------------
1909919102

imgui.h

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.88 WIP
1+
// dear imgui, v1.88
22
// (headers)
33

44
// Help:
@@ -64,8 +64,8 @@ Index of this file:
6464

6565
// Version
6666
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
67-
#define IMGUI_VERSION "1.88 WIP"
68-
#define IMGUI_VERSION_NUM 18729
67+
#define IMGUI_VERSION "1.88"
68+
#define IMGUI_VERSION_NUM 18800
6969
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
7070
#define IMGUI_HAS_TABLE
7171
#define IMGUI_HAS_VIEWPORT // Viewport WIP branch
@@ -3294,6 +3294,14 @@ enum ImGuiKeyModFlags_ { ImGuiKeyModFlags_None = ImGuiModFlags_None, ImGuiKeyMod
32943294

32953295
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
32963296

3297+
// RENAMED IMGUI_DISABLE_METRICS_WINDOW > IMGUI_DISABLE_DEBUG_TOOLS in 1.88 (from June 2022)
3298+
#if defined(IMGUI_DISABLE_METRICS_WINDOW) && !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(IMGUI_DISABLE_DEBUG_TOOLS)
3299+
#define IMGUI_DISABLE_DEBUG_TOOLS
3300+
#endif
3301+
#if defined(IMGUI_DISABLE_METRICS_WINDOW) && defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
3302+
#error IMGUI_DISABLE_METRICS_WINDOW was renamed to IMGUI_DISABLE_DEBUG_TOOLS, please use new name.
3303+
#endif
3304+
32973305
//-----------------------------------------------------------------------------
32983306

32993307
#if defined(__clang__)

imgui_demo.cpp

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.88 WIP
1+
// dear imgui, v1.88
22
// (demo code)
33

44
// Help:
@@ -418,11 +418,14 @@ void ImGui::ShowDemoWindow(bool* p_open)
418418
if (ImGui::BeginMenu("Tools"))
419419
{
420420
IMGUI_DEMO_MARKER("Menu/Tools");
421-
#ifndef IMGUI_DISABLE_METRICS_WINDOW
422-
ImGui::MenuItem("Metrics/Debugger", NULL, &show_app_metrics);
423-
ImGui::MenuItem("Debug Log", NULL, &show_app_debug_log);
424-
ImGui::MenuItem("Stack Tool", NULL, &show_app_stack_tool);
421+
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
422+
const bool has_debug_tools = true;
423+
#else
424+
const bool has_debug_tools = false;
425425
#endif
426+
ImGui::MenuItem("Metrics/Debugger", NULL, &show_app_metrics, has_debug_tools);
427+
ImGui::MenuItem("Debug Log", NULL, &show_app_debug_log, has_debug_tools);
428+
ImGui::MenuItem("Stack Tool", NULL, &show_app_stack_tool, has_debug_tools);
426429
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
427430
ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
428431
ImGui::EndMenu();

imgui_draw.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.88 WIP
1+
// dear imgui, v1.88
22
// (drawing and font code)
33

44
/*

imgui_internal.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.88 WIP
1+
// dear imgui, v1.88
22
// (internal structures/api)
33

44
// You may use this file to debug, understand or extend ImGui features but we don't provide any guarantee of forward compatibility!
@@ -1168,6 +1168,7 @@ struct ImGuiShrinkWidthItem
11681168
{
11691169
int Index;
11701170
float Width;
1171+
float InitialWidth;
11711172
};
11721173

11731174
struct ImGuiPtrOrIndex
@@ -1961,6 +1962,7 @@ struct ImGuiContext
19611962
ImU32 ColorEditLastColor; // RGB value with alpha set to 0.
19621963
ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker.
19631964
ImGuiComboPreviewData ComboPreviewData;
1965+
float SliderGrabClickOffset;
19641966
float SliderCurrentAccum; // Accumulated slider delta when using navigation controls.
19651967
bool SliderCurrentAccumDirty; // Has the accumulated slider delta changed since last time we tried to apply it?
19661968
bool DragCurrentAccumDirty;
@@ -2145,6 +2147,7 @@ struct ImGuiContext
21452147
ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
21462148
ColorEditLastHue = ColorEditLastSat = 0.0f;
21472149
ColorEditLastColor = 0;
2150+
SliderGrabClickOffset = 0.0f;
21482151
SliderCurrentAccum = 0.0f;
21492152
SliderCurrentAccumDirty = false;
21502153
DragCurrentAccumDirty = false;
@@ -2410,6 +2413,7 @@ struct ImGuiTabItem
24102413
float Offset; // Position relative to beginning of tab
24112414
float Width; // Width currently displayed
24122415
float ContentWidth; // Width of label, stored during BeginTabItem() call
2416+
float RequestedWidth; // Width optionally requested by caller, -1.0f is unused
24132417
ImS32 NameOffset; // When Window==NULL, offset to name within parent ImGuiTabBar::TabsNames
24142418
ImS16 BeginOrder; // BeginTabItem() order, used to re-order tabs after toggling ImGuiTabBarFlags_Reorderable
24152419
ImS16 IndexDuringLayout; // Index only used during TabBarLayout()

imgui_tables.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// dear imgui, v1.88 WIP
1+
// dear imgui, v1.88
22
// (tables and columns code)
33

44
/*
@@ -3520,7 +3520,7 @@ void ImGui::TableGcCompactSettings()
35203520
// - DebugNodeTable() [Internal]
35213521
//-------------------------------------------------------------------------
35223522

3523-
#ifndef IMGUI_DISABLE_METRICS_WINDOW
3523+
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
35243524

35253525
static const char* DebugNodeTableGetSizingPolicyDesc(ImGuiTableFlags sizing_policy)
35263526
{
@@ -3614,7 +3614,7 @@ void ImGui::DebugNodeTableSettings(ImGuiTableSettings* settings)
36143614
TreePop();
36153615
}
36163616

3617-
#else // #ifndef IMGUI_DISABLE_METRICS_WINDOW
3617+
#else // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
36183618

36193619
void ImGui::DebugNodeTable(ImGuiTable*) {}
36203620
void ImGui::DebugNodeTableSettings(ImGuiTableSettings*) {}

0 commit comments

Comments
 (0)