Allow setting handlers not to be draggable

This commit is contained in:
Aang23 2025-01-02 17:20:09 +01:00
parent 5c6866a3af
commit 49d166cef1
4 changed files with 42 additions and 3 deletions

View file

@ -41,7 +41,8 @@ namespace satdump
h = handler;
// TODOREWORK CLEANUP
if (ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID))
if (handler_can_subhandlers_be_dragged && handler->handler_can_be_dragged &&
ImGui::BeginDragDropSource(ImGuiDragDropFlags_SourceAllowNullID))
{
auto del = [this](std::shared_ptr<Handler> handler)
{
@ -55,7 +56,7 @@ namespace satdump
ImGui::EndDragDropSource();
}
if (ImGui::BeginDragDropTarget())
if (handler->handler_can_be_dragged_to && ImGui::BeginDragDropTarget())
{
if (const ImGuiPayload *payload = ImGui::AcceptDragDropPayload("VIEWER_HANDLER"))
{