Skip to content

Commit 32cea85

Browse files
committed
Debug Tools: Item Picker: Always available in menu. Tweak Demo Debug Options. (ocornut#2673, ocornut#1651)
1 parent 00f12b9 commit 32cea85

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

docs/CHANGELOG.txt

+3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ Other changes:
5656
a child window, and from nested child windows. (#1651)
5757
- Error Handling: Turned common EndTable() and other TableXXX functions
5858
fail cases into a recoverable error. (#1651, #8314)
59+
- Error Handling: Exposed some options in Demo->Tools->Debug Options. (#1651)
5960
- InputText: Fixed a bug where character replacements performed from a callback
6061
were not applied when pasting from clipbard. (#8229)
6162
- InputText: Fixed issue when activating a ReadOnly field when the underlying
@@ -76,6 +77,8 @@ Other changes:
7677
windows with the ImGuiWindowFlags_NoNavInputs flag. (#8231)
7778
- Debug Tools: Debug Log: hovering 0xXXXXXXXX values in log is allowed even
7879
if a popup is blocking mouse access to the debug log window. (#5855)
80+
- Debug Tools: Item Picker: Always available regardless of value of
81+
io.ConfigDebugIsDebuggerPresent. (#2673)
7982
- Fonts: Fixed miscalculation of Ellipsis ("...") character width when automatically
8083
created from a single comma character, affecting some fonts/settings (not all).
8184
- Demo: Added label edition to Property Editor demo + fix an ID issue. (#8266) [@moritz-h]

imgui_demo.cpp

+12-4
Original file line numberDiff line numberDiff line change
@@ -743,19 +743,27 @@ static void ShowDemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
743743
#else
744744
const bool has_debug_tools = false;
745745
#endif
746+
if (ImGui::BeginMenu("Debug Options"))
747+
{
748+
ImGui::BeginDisabled(!has_debug_tools);
749+
ImGui::Checkbox("Highlight ID Conflicts", &io.ConfigDebugHighlightIdConflicts);
750+
ImGui::EndDisabled();
751+
ImGui::Checkbox("Assert on error recovery", &io.ConfigErrorRecoveryEnableAssert);
752+
ImGui::TextDisabled("(see Demo->Configuration for details & more)");
753+
ImGui::EndMenu();
754+
}
755+
746756
ImGui::MenuItem("Metrics/Debugger", NULL, &demo_data->ShowMetrics, has_debug_tools);
747757
ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools);
748758
ImGui::MenuItem("ID Stack Tool", NULL, &demo_data->ShowIDStackTool, has_debug_tools);
749759
bool is_debugger_present = io.ConfigDebugIsDebuggerPresent;
750-
if (ImGui::MenuItem("Item Picker", NULL, false, has_debug_tools && is_debugger_present))
760+
if (ImGui::MenuItem("Item Picker", NULL, false, has_debug_tools))// && is_debugger_present))
751761
ImGui::DebugStartItemPicker();
752762
if (!is_debugger_present)
753-
ImGui::SetItemTooltip("Requires io.ConfigDebugIsDebuggerPresent=true to be set.\n\nWe otherwise disable the menu option to avoid casual users crashing the application.\n\nYou can however always access the Item Picker in Metrics->Tools.");
763+
ImGui::SetItemTooltip("Requires io.ConfigDebugIsDebuggerPresent=true to be set.\n\nWe otherwise disable some extra features to avoid casual users crashing the application.");
754764
ImGui::MenuItem("Style Editor", NULL, &demo_data->ShowStyleEditor);
755765
ImGui::MenuItem("About Dear ImGui", NULL, &demo_data->ShowAbout);
756766

757-
ImGui::SeparatorText("Debug Options");
758-
ImGui::MenuItem("Highlight ID Conflicts", NULL, &io.ConfigDebugHighlightIdConflicts, has_debug_tools);
759767
ImGui::EndMenu();
760768
}
761769
ImGui::EndMenuBar();

0 commit comments

Comments
 (0)