Skip to content

Commit

Permalink
Fix adding button to tree
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Sep 24, 2024
1 parent aa657a6 commit 93b3faa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1072,16 +1072,15 @@ void Begin(float height, bool isLeaf, bool isSelected, int isOpen) {
}

// Selected and hover logic
bool isArrowHovered = ImGui::ItemHoverable(bbArrow, arrowButtonId, ImGuiItemFlags_None);
bool arrowClicked = ImGui::IsItemClicked();

{

//ImGui::KeepAliveID(layoutId);
//ImGui::ItemAdd(fullLayout, layoutId);
bool isLayoutHovered = ImGui::ItemHoverable(fullLayout, layoutId, ImGuiItemFlags_None);
bool isLayoutHovered = ImGui::ItemHoverable(fullLayout, layoutId, ImGuiItemFlags_AllowOverlap);

if (isLayoutHovered || isArrowHovered) {
if (isLayoutHovered) {
ImVec4 color = style.Colors[ImGuiCol_HeaderHovered];
float r = color.x;
float g = color.y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,10 @@ namespace ImGuiExt
ImGui::SameLine();
ImLayout::BeginAlign("222", ImLayout::MATCH_PARENT, ImLayout::MATCH_PARENT, 1.0, 0.5);
{
if (ImGui::Button("CLICK ME")) {
std::cout << "CLICK ME" << std::endl;
}
ImGui::SameLine();
ImGui::Text("- 22");
//ImLayout::ShowLayoutDebug();
}
Expand Down

0 comments on commit 93b3faa

Please sign in to comment.