Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ HOW TO UPDATE?
and API updates have been a little more frequent lately. They are documented below and in imgui.cpp and should not affect all users.
- Please report any issue!

-----------------------------------------------------------------------
VERSION 1.89.8 WIP (In Progress)
-----------------------------------------------------------------------

Breaking changes:

Other changes:

- Demo: Better showcase use of SetNextItemAllowOverlap(). (#6574, #6512, #3909, #517)


-----------------------------------------------------------------------
VERSION 1.89.7 (Released 2023-07-04)
-----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion imgui.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (main code and documentation)

// Help:
Expand Down
4 changes: 2 additions & 2 deletions imgui.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (headers)

// Help:
Expand All @@ -24,7 +24,7 @@

// Library Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345')
#define IMGUI_VERSION "1.89.7"
#define IMGUI_VERSION "1.89.8 WIP"
#define IMGUI_VERSION_NUM 18971
#define IMGUI_HAS_TABLE

Expand Down
62 changes: 47 additions & 15 deletions imgui_demo.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (demo code)

// Help:
Expand Down Expand Up @@ -1262,16 +1262,16 @@ static void ShowDemoWindowWidgets()
IMGUI_DEMO_MARKER("Widgets/Selectables/Basic");
if (ImGui::TreeNode("Basic"))
{
static bool selection[5] = { false, true, false, false, false };
static bool selection[5] = { false, true, false, false };
ImGui::Selectable("1. I am selectable", &selection[0]);
ImGui::Selectable("2. I am selectable", &selection[1]);
ImGui::Text("(I am not selectable)");
ImGui::Selectable("4. I am selectable", &selection[3]);
if (ImGui::Selectable("5. I am double clickable", selection[4], ImGuiSelectableFlags_AllowDoubleClick))
ImGui::Selectable("3. I am selectable", &selection[2]);
if (ImGui::Selectable("4. I am double clickable", selection[3], ImGuiSelectableFlags_AllowDoubleClick))
if (ImGui::IsMouseDoubleClicked(0))
selection[4] = !selection[4];
selection[3] = !selection[3];
ImGui::TreePop();
}

IMGUI_DEMO_MARKER("Widgets/Selectables/Single Selection");
if (ImGui::TreeNode("Selection State: Single Selection"))
{
Expand Down Expand Up @@ -1303,17 +1303,18 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
IMGUI_DEMO_MARKER("Widgets/Selectables/Rendering more text into the same line");
if (ImGui::TreeNode("Rendering more text into the same line"))
IMGUI_DEMO_MARKER("Widgets/Selectables/Rendering more items on the same line");
if (ImGui::TreeNode("Rendering more items on the same line"))
{
// Using the Selectable() override that takes "bool* p_selected" parameter,
// this function toggle your bool value automatically.
// (1) Using SetNextItemAllowOverlap()
// (2) Using the Selectable() override that takes "bool* p_selected" parameter, the bool value is toggled automatically.
static bool selected[3] = { false, false, false };
ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(300); ImGui::Text("12,345 bytes");
ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("main.c", &selected[0]); ImGui::SameLine(); ImGui::SmallButton("Link 1");
ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("Hello.cpp", &selected[1]); ImGui::SameLine(); ImGui::SmallButton("Link 2");
ImGui::SetNextItemAllowOverlap(); ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(); ImGui::SmallButton("Link 3");
ImGui::TreePop();
}

IMGUI_DEMO_MARKER("Widgets/Selectables/In columns");
if (ImGui::TreeNode("In columns"))
{
Expand Down Expand Up @@ -1349,6 +1350,7 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}

IMGUI_DEMO_MARKER("Widgets/Selectables/Grid");
if (ImGui::TreeNode("Grid"))
{
Expand Down Expand Up @@ -2795,11 +2797,11 @@ static void ShowDemoWindowLayout()
// Text
IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/SameLine");
ImGui::Text("Two items: Hello"); ImGui::SameLine();
ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Sailor");

// Adjust spacing
ImGui::Text("More spacing: Hello"); ImGui::SameLine(0, 20);
ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
ImGui::TextColored(ImVec4(1, 1, 0, 1), "Sailor");

// Button
ImGui::AlignTextToFramePadding();
Expand Down Expand Up @@ -3397,6 +3399,36 @@ static void ShowDemoWindowLayout()

ImGui::TreePop();
}

IMGUI_DEMO_MARKER("Layout/Overlap Mode");
if (ImGui::TreeNode("Overlap Mode"))
{
static bool enable_allow_overlap = true;

HelpMarker(
"Hit-testing is by default performed in item submission order, which generally is perceived as 'back-to-front'.\n\n"
"By using SetNextItemAllowOverlap() you can notify that an item may be overlapped by another. Doing so alters the hovering logic: items using AllowOverlap mode requires an extra frame to accept hovered state.");
ImGui::Checkbox("Enable AllowOverlap", &enable_allow_overlap);

ImVec2 button1_pos = ImGui::GetCursorScreenPos();
ImVec2 button2_pos = ImVec2(button1_pos.x + 50.0f, button1_pos.y + 50.0f);
if (enable_allow_overlap)
ImGui::SetNextItemAllowOverlap();
ImGui::Button("Button 1", ImVec2(80, 80));
ImGui::SetCursorScreenPos(button2_pos);
ImGui::Button("Button 2", ImVec2(80, 80));

// This is typically used with width-spanning items.
// (note that Selectable() has a dedicated flag ImGuiSelectableFlags_AllowOverlap, which is a shortcut
// for using SetNextItemAllowOverlap(). For demo purpose we use SetNextItemAllowOverlap() here.)
if (enable_allow_overlap)
ImGui::SetNextItemAllowOverlap();
ImGui::Selectable("Some Selectable", false);
ImGui::SameLine();
ImGui::SmallButton("++");

ImGui::TreePop();
}
}

static void ShowDemoWindowPopups()
Expand Down
2 changes: 1 addition & 1 deletion imgui_draw.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (drawing and font code)

/*
Expand Down
2 changes: 1 addition & 1 deletion imgui_internal.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (internal structures/api)

// You may use this file to debug, understand or extend Dear ImGui features but we don't provide any guarantee of forward compatibility.
Expand Down
2 changes: 1 addition & 1 deletion imgui_tables.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (tables and columns code)

/*
Expand Down
2 changes: 1 addition & 1 deletion imgui_widgets.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// dear imgui, v1.89.7
// dear imgui, v1.89.8 WIP
// (widgets code)

/*
Expand Down