diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index b0abc8393..ce655ea2b 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -127,6 +127,23 @@ void FurnaceGUI::insListItem(int i, int dir, int asset) { if (insListDir) { DRAG_SOURCE(dir,asset,"FUR_INSDIR"); DRAG_TARGET(dir,asset,e->song.insDir,"FUR_INSDIR"); + } else { + if (ImGui::BeginDragDropSource()) { + insToMove=i; + ImGui::SetDragDropPayload("FUR_INS",NULL,0,ImGuiCond_Once); + ImGui::Button(ICON_FA_ARROWS "##AssetDrag"); + ImGui::EndDragDropSource(); + } + if (ImGui::BeginDragDropTarget()) { + const ImGuiPayload* payload=ImGui::AcceptDragDropPayload("FUR_INS"); + if (payload!=NULL) { + int targetIns=i; + printf("From %d to %d\n",insToMove,targetIns); + // TODO: actually swap the instruments + insToMove=-1; + ImGui::EndDragDropTarget(); + } + } } if (ImGui::BeginPopupContextItem("InsRightMenu")) { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 879c28939..5c818f8bc 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -8653,6 +8653,7 @@ FurnaceGUI::FurnaceGUI(): opToMove(-1), assetToMove(-1), dirToMove(-1), + insToMove(-1), transposeAmount(0), randomizeMin(0), randomizeMax(255), diff --git a/src/gui/gui.h b/src/gui/gui.h index 0757db41a..bcb9a22f6 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2523,7 +2523,7 @@ class FurnaceGUI { std::map images; int chanToMove, sysToMove, sysToDelete, opToMove; - int assetToMove, dirToMove; + int assetToMove, dirToMove, insToMove; ImVec2 patWindowPos, patWindowSize;