Skip to content

Commit

Permalink
Update to ImGui 1.91.6
Browse files Browse the repository at this point in the history
  • Loading branch information
tpecholt committed Jan 5, 2025
1 parent 9fa63a0 commit 960e83a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/imgui
Submodule imgui updated 102 files
2 changes: 1 addition & 1 deletion cmake/imgui.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ add_library(imgui STATIC
${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
)

add_definitions(-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS)
#add_definitions(-DIMGUI_DISABLE_OBSOLETE_FUNCTIONS)
add_definitions(-DIMGUI_ENABLE_FREETYPE)
#add_definitions(-DIMGUI_USE_WCHAR32)

Expand Down
6 changes: 3 additions & 3 deletions src/binding_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ inline bool InputDirectVal(const char* label, direct_val<shortcut_>* val, bool b
{
if (button) {
const auto& nextItemData = ImGui::GetCurrentContext()->NextItemData;
bool hasWidth = nextItemData.Flags & ImGuiNextItemDataFlags_HasWidth;
bool hasWidth = nextItemData.HasFlags & ImGuiNextItemDataFlags_HasWidth;
ImGui::SetNextItemWidth((hasWidth ? nextItemData.Width : 0) - ImGui::GetFrameHeight());
}

Expand Down Expand Up @@ -223,7 +223,7 @@ inline bool InputBindable(const char* label, bindable<color32>* val, int def, UI

ImGui::SameLine();
ImVec2 sz{ 0, 0 };
if (nextData.Flags & ImGuiNextItemDataFlags_HasWidth)
if (nextData.HasFlags & ImGuiNextItemDataFlags_HasWidth)
{
sz.x = nextData.Width;
if (sz.x < 0)
Expand Down Expand Up @@ -441,7 +441,7 @@ inline bool InputBindable(const char* label, bindable<dimension>* val, dimension
{
if (flags & InputBindable_StretchButton) {
const auto& nextItemData = ImGui::GetCurrentContext()->NextItemData;
bool hasWidth = nextItemData.Flags & ImGuiNextItemDataFlags_HasWidth;
bool hasWidth = nextItemData.HasFlags & ImGuiNextItemDataFlags_HasWidth;
ImGui::SetNextItemWidth((hasWidth ? nextItemData.Width : 0) - ImGui::GetFrameHeight());
}

Expand Down
8 changes: 4 additions & 4 deletions src/imrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ inline int ScrollWhenDragging(bool drawScrollbars)
int ret = !dragState ? 1 : 0;
dragState = 1;
ImGuiWindow *window = ImGui::GetCurrentWindow();
ImGui::GetCurrentContext()->NavDisableMouseHover = true;
ImGui::GetCurrentContext()->NavHighlightItemUnderNav = true;
ImVec2 delta = ImGui::GetMouseDragDelta(ImGuiMouseButton_Left);
if (delta.x)
ImGui::SetScrollX(window, window->Scroll.x - delta.x);
Expand Down Expand Up @@ -553,7 +553,7 @@ inline int ScrollWhenDragging(bool drawScrollbars)
else if (dragState == 1)
{
dragState = 0;
ImGui::GetCurrentContext()->NavDisableMouseHover = false;
ImGui::GetCurrentContext()->NavHighlightItemUnderNav = false;
ImGui::GetIO().MousePos = { -FLT_MAX, -FLT_MAX }; //ignore mouse release event, buttons won't get pushed
return 2;
}
Expand Down Expand Up @@ -589,7 +589,7 @@ inline int MoveWhenDragging(ImGuiDir dir, ImVec2& pos, float& dimBgRatio)
mousePos[1] = mousePos[2];
mousePos[2] = ImGui::GetMousePos();
ImGuiWindow *window = ImGui::GetCurrentWindow();
ImGui::GetCurrentContext()->NavDisableMouseHover = true;
ImGui::GetCurrentContext()->NavHighlightItemUnderNav = true;

ImVec2 delta = ImGui::GetMouseDragDelta(ImGuiMouseButton_Left);
//don't reset DragDelta - we need to apply full delta if pos
Expand Down Expand Up @@ -629,7 +629,7 @@ inline int MoveWhenDragging(ImGuiDir dir, ImVec2& pos, float& dimBgRatio)
pos = lastPos;
dimBgRatio = lastDim;
dragState = 0;
ImGui::GetCurrentContext()->NavDisableMouseHover = false;
ImGui::GetCurrentContext()->NavHighlightItemUnderNav = false;
ImGui::GetIO().MousePos = { -FLT_MAX, -FLT_MAX }; //ignore mouse release event, buttons won't get pushed

float spx = (mousePos[2].x - mousePos[0].x) / 2;
Expand Down
10 changes: 5 additions & 5 deletions src/node2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ void TopWindow::Draw(UIContext& ctx)
else if (placement == Bottom)
ImRad::RenderFilledWindowCorners(ImDrawFlags_RoundCornersBottom);

ImGui::GetCurrentContext()->NavDisableMouseHover = true;
ImGui::GetCurrentContext()->NavDisableHighlight = true;
ImGui::GetCurrentContext()->NavHighlightItemUnderNav = true;
ImGui::GetCurrentContext()->NavCursorVisible = false;
if (dimAll)
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.3f);

Expand All @@ -226,8 +226,8 @@ void TopWindow::Draw(UIContext& ctx)

if (dimAll)
ImGui::PopStyleVar();
ImGui::GetCurrentContext()->NavDisableHighlight = false;
ImGui::GetCurrentContext()->NavDisableMouseHover = false;
ImGui::GetCurrentContext()->NavCursorVisible = true;
ImGui::GetCurrentContext()->NavHighlightItemUnderNav = false;

for (size_t i = 0; i < children.size(); ++i)
children[i]->DrawExtra(ctx);
Expand Down Expand Up @@ -1873,7 +1873,7 @@ Child::Child(UIContext& ctx)
size_x = size_y = 20;

flags.prefix("ImGuiChildFlags_");
flags.add$(ImGuiChildFlags_Border);
flags.add$(ImGuiChildFlags_Borders);
flags.add$(ImGuiChildFlags_AlwaysUseWindowPadding);
flags.add$(ImGuiChildFlags_AlwaysAutoResize);
flags.add$(ImGuiChildFlags_AutoResizeX);
Expand Down

0 comments on commit 960e83a

Please sign in to comment.