Fix mouse up event for imgui based widgets

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-05-18 19:31:32 +01:00
parent fc1fb75123
commit e0f12a9998
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
2 changed files with 2 additions and 6 deletions

View file

@ -270,16 +270,12 @@ void ImGuiWidget::onDragHover(const DragHoverEvent& e)
}
}
void ImGuiWidget::onDragLeave(const DragLeaveEvent& e)
void ImGuiWidget::onDragEnd(const DragEndEvent& e)
{
ImGui::SetCurrentContext(imData->context);
// FIXME this is not the correct event..
ImGuiIO& io(ImGui::GetIO());
io.MouseDown[0] = io.MouseDown[1] = io.MouseDown[2] = false;
if (io.WantCaptureMouse)
e.consume(this);
}
void ImGuiWidget::onHoverScroll(const HoverScrollEvent& e)

View file

@ -34,7 +34,7 @@ protected:
void onContextDestroy(const ContextDestroyEvent& e) override;
void onHover(const HoverEvent& e) override;
void onDragHover(const DragHoverEvent& e) override;
void onDragLeave(const DragLeaveEvent& e) override;
void onDragEnd(const DragEndEvent& e) override;
void onHoverScroll(const HoverScrollEvent& e) override;
void onButton(const ButtonEvent& e) override;
void onSelectKey(const SelectKeyEvent& e) override;