Skip to content

Commit

Permalink
fix hidden "Add signal" button
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Busse committed Oct 26, 2023
1 parent 56fad50 commit c8d7d16
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ui/flowgraphitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,11 @@ void FlowGraphItem::draw(FlowGraph *fg, const ImVec2 &size) {
ImGui::OpenPopup("New block");
}

ImGui::SetCursorPosX(left);
ImGui::SetCursorPosY(top + size.y - 20);
// Create a new ImGui window for an overlay over the NodeEditor , where we can place our buttons
// if we don't put the buttons in this overlay, they will be overdrawn by the editor
ImGui::SetNextWindowPos(ImVec2(0, top + size.y - 30), ImGuiCond_Always);
ImGui::Begin("Button Overlay", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar |ImGuiWindowFlags_NoBackground);

if (ImGui::Button("Add signal")) {
ImGui::OpenPopup("addSignalPopup");
}
Expand All @@ -628,6 +631,8 @@ void FlowGraphItem::draw(FlowGraph *fg, const ImVec2 &size) {
drawAddSourceDialog(fg);
drawNewBlockDialog(fg);

ImGui::End(); // overlay

if (horizontalSplit) {
const float w = size.x * ratio;
ImGuiUtils::drawBlockControlsPanel(m_editPane, { left + size.x - w + halfSplitterWidth, top }, { w - halfSplitterWidth, size.y }, true);
Expand Down

0 comments on commit c8d7d16

Please sign in to comment.