Backends: GLFW, SDL: Platform monitors declared properly even if multi-viewport is not enabled.

This commit is contained in:
omar
2020-02-09 17:31:18 +01:00
parent 3bde375078
commit 7e2d172ae5
5 changed files with 112 additions and 103 deletions

View File

@ -15329,9 +15329,11 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImGui::Indent(ImGui::GetTreeNodeToLabelSpacing());
ImGui::ShowViewportThumbnails();
ImGui::Unindent(ImGui::GetTreeNodeToLabelSpacing());
if (g.PlatformIO.Monitors.Size > 0 && ImGui::TreeNode("Monitors", "Monitors (%d)", g.PlatformIO.Monitors.Size))
bool open = ImGui::TreeNode("Monitors", "Monitors (%d)", g.PlatformIO.Monitors.Size);
ImGui::SameLine();
MetricsHelpMarker("Dear ImGui uses monitor data:\n- to query DPI settings on a per monitor basis\n- to position popup/tooltips so they don't straddle monitors.");
if (open)
{
ImGui::TextWrapped("(When viewports are enabled, imgui needs uses monitor data to position popup/tooltips so they don't straddle monitors.)");
for (int i = 0; i < g.PlatformIO.Monitors.Size; i++)
{
const ImGuiPlatformMonitor& mon = g.PlatformIO.Monitors[i];