GUI: add ability to drag to move when holding Ctrl

This commit is contained in:
tildearrow 2022-06-20 16:24:14 -05:00
parent 60334fb03c
commit 57fab16269
2 changed files with 14 additions and 8 deletions

View file

@ -43,7 +43,7 @@ void FurnaceGUI::startSelection(int xCoarse, int xFine, int y, bool fullRow) {
} }
} }
if (settings.dragMovesSelection && !fullRow) { if ((settings.dragMovesSelection==1 || (settings.dragMovesSelection==2 && (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)))) && !fullRow) {
if (xCoarse>=selStart.xCoarse && (xFine>=selStart.xFine || xCoarse>selStart.xCoarse) && y>=selStart.y && if (xCoarse>=selStart.xCoarse && (xFine>=selStart.xFine || xCoarse>selStart.xCoarse) && y>=selStart.y &&
xCoarse<=selEnd.xCoarse && (xFine<=selEnd.xFine || xCoarse<selEnd.xCoarse) && y<=selEnd.y) { xCoarse<=selEnd.xCoarse && (xFine<=selEnd.xFine || xCoarse<selEnd.xCoarse) && y<=selEnd.y) {
dragging=true; dragging=true;

View file

@ -412,11 +412,6 @@ void FurnaceGUI::drawSettings() {
settings.doubleClickColumn=doubleClickColumnB; settings.doubleClickColumn=doubleClickColumnB;
} }
bool dragMovesSelectionB=settings.dragMovesSelection;
if (ImGui::Checkbox("Allow dragging selection",&dragMovesSelectionB)) {
settings.dragMovesSelection=dragMovesSelectionB;
}
bool allowEditDockingB=settings.allowEditDocking; bool allowEditDockingB=settings.allowEditDocking;
if (ImGui::Checkbox("Allow docking editors",&allowEditDockingB)) { if (ImGui::Checkbox("Allow docking editors",&allowEditDockingB)) {
settings.allowEditDocking=allowEditDockingB; settings.allowEditDocking=allowEditDockingB;
@ -524,6 +519,17 @@ void FurnaceGUI::drawSettings() {
if (ImGui::RadioButton("Move to effect value/next effect and wrap around##eicb2",settings.effectCursorDir==2)) { if (ImGui::RadioButton("Move to effect value/next effect and wrap around##eicb2",settings.effectCursorDir==2)) {
settings.effectCursorDir=2; settings.effectCursorDir=2;
} }
ImGui::Text("Allow dragging selection:");
if (ImGui::RadioButton("No##dms0",settings.dragMovesSelection==0)) {
settings.dragMovesSelection=0;
}
if (ImGui::RadioButton("Yes##dms1",settings.dragMovesSelection==1)) {
settings.dragMovesSelection=1;
}
if (ImGui::RadioButton("Yes (while holding Ctrl only)##dms2",settings.dragMovesSelection==2)) {
settings.dragMovesSelection=2;
}
} }
ImGui::EndChild(); ImGui::EndChild();
ImGui::EndTabItem(); ImGui::EndTabItem();
@ -2042,7 +2048,7 @@ void FurnaceGUI::syncSettings() {
settings.effectValCellSpacing=e->getConfInt("effectValCellSpacing",0); settings.effectValCellSpacing=e->getConfInt("effectValCellSpacing",0);
settings.doubleClickColumn=e->getConfInt("doubleClickColumn",1); settings.doubleClickColumn=e->getConfInt("doubleClickColumn",1);
settings.blankIns=e->getConfInt("blankIns",0); settings.blankIns=e->getConfInt("blankIns",0);
settings.dragMovesSelection=e->getConfInt("dragMovesSelection",1); settings.dragMovesSelection=e->getConfInt("dragMovesSelection",2);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96); clampSetting(settings.patFontSize,2,96);
@ -2127,7 +2133,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.effectValCellSpacing,0,32); clampSetting(settings.effectValCellSpacing,0,32);
clampSetting(settings.doubleClickColumn,0,1); clampSetting(settings.doubleClickColumn,0,1);
clampSetting(settings.blankIns,0,1); clampSetting(settings.blankIns,0,1);
clampSetting(settings.dragMovesSelection,0,1); clampSetting(settings.dragMovesSelection,0,2);
settings.initialSys=e->decodeSysDesc(e->getConfString("initialSys","")); settings.initialSys=e->decodeSysDesc(e->getConfString("initialSys",""));
if (settings.initialSys.size()<4) { if (settings.initialSys.size()<4) {