instrument drag&drop: adding option to disable

This commit is contained in:
yohannd1 2024-12-20 21:36:04 -03:00
parent 8aeb50bc32
commit 0b4cf34e4d
3 changed files with 32 additions and 22 deletions

View file

@ -71,7 +71,7 @@ const char* sampleNote[12]={
}
#define SIMPLE_DRAG_SOURCE(_c,_toMoveVar) \
if (ImGui::BeginDragDropSource()) { \
if (settings.draggableDataView && ImGui::BeginDragDropSource()) { \
_toMoveVar=i; \
ImGui::SetDragDropPayload(_c,NULL,0,ImGuiCond_Once); \
ImGui::Button(ICON_FA_ARROWS "##AssetDrag"); \
@ -79,7 +79,7 @@ const char* sampleNote[12]={
}
#define SIMPLE_DRAG_TARGET(_c,_toMoveVar,_curVar,_swapFn,_moveUpFn,_moveDownFn) \
if (ImGui::BeginDragDropTarget()) { \
if (settings.draggableDataView && ImGui::BeginDragDropTarget()) { \
const ImGuiPayload* payload=ImGui::AcceptDragDropPayload(_c); \
if (payload!=NULL) { \
int target=i; \
@ -129,7 +129,7 @@ void FurnaceGUI::insListItem(int i, int dir, int asset) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_STD+ins->type]);
insIcon=insTypes[ins->type];
}
switch (settings.insIconsStyle) {
case 1:
name=fmt::sprintf("%s##_INS%d",insIcon[1],i);

View file

@ -1791,7 +1791,7 @@ class FurnaceGUI {
int pnQuality;
int saaQuality;
int sccQuality;
int smQuality;
int smQuality;
int swanQuality;
int vbQuality;
int arcadeCoreRender;
@ -1818,7 +1818,7 @@ class FurnaceGUI {
int pnQualityRender;
int saaQualityRender;
int sccQualityRender;
int smQualityRender;
int smQualityRender;
int swanQualityRender;
int vbQualityRender;
int pcSpeakerOutMethod;
@ -1914,6 +1914,7 @@ class FurnaceGUI {
int doubleClickColumn;
int blankIns;
int dragMovesSelection;
int draggableDataView;
int cursorFollowsOrder;
int unsignedDetune;
int noThreadedInput;
@ -2176,6 +2177,7 @@ class FurnaceGUI {
doubleClickColumn(1),
blankIns(0),
dragMovesSelection(1),
draggableDataView(1),
cursorFollowsOrder(1),
unsignedDetune(0),
noThreadedInput(0),
@ -2690,7 +2692,7 @@ class FurnaceGUI {
bool pianoReadonly;
int pianoOffset, pianoOffsetEdit;
int pianoView, pianoInputPadMode;
// effect sorting / searching
bool effectsShow[10];
ImGuiTextFilter effectSearch;

View file

@ -1493,7 +1493,7 @@ void FurnaceGUI::drawSettings() {
ImGui::Text(_("Quality"));
ImGui::SameLine();
if (ImGui::Combo("##Quality",&settings.audioQuality,LocalizedComboGetter,audioQualities,2)) settingsChanged=true;
bool clampSamplesB=settings.clampSamples;
if (ImGui::Checkbox(_("Software clipping"),&clampSamplesB)) {
settings.clampSamples=clampSamplesB;
@ -2688,6 +2688,12 @@ void FurnaceGUI::drawSettings() {
settingsChanged=true;
}
bool draggableDataViewB=settings.draggableDataView;
if (ImGui::Checkbox(_("Draggable instruments/samples/waves"),&draggableDataViewB)) {
settings.draggableDataView=draggableDataViewB;
settingsChanged=true;
}
ImGui::Text(_("Note preview behavior:"));
ImGui::Indent();
if (ImGui::RadioButton(_("Never##npb0"),settings.notePreviewBehavior==0)) {
@ -4953,13 +4959,14 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.cursorMoveNoScroll=conf.getInt("cursorMoveNoScroll",0);
settings.notePreviewBehavior=conf.getInt("notePreviewBehavior",1);
settings.absorbInsInput=conf.getInt("absorbInsInput",0);
settings.moveWindowTitle=conf.getInt("moveWindowTitle",1);
settings.doubleClickColumn=conf.getInt("doubleClickColumn",1);
settings.dragMovesSelection=conf.getInt("dragMovesSelection",2);
settings.draggableDataView=conf.getInt("draggableDataView",1);
settings.cursorFollowsOrder=conf.getInt("cursorFollowsOrder",1);
@ -5397,7 +5404,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
clampSetting(settings.backgroundPlay,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
}
void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
@ -5446,10 +5453,10 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("blankIns",settings.blankIns);
conf.set("saveWindowPos",settings.saveWindowPos);
conf.set("saveUnusedPatterns",settings.saveUnusedPatterns);
conf.set("maxRecentFile",settings.maxRecentFile);
conf.set("persistFadeOut",settings.persistFadeOut);
conf.set("exportLoops",settings.exportLoops);
conf.set("exportFadeOut",settings.exportFadeOut);
@ -5532,7 +5539,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("pullDeleteBehavior",settings.pullDeleteBehavior);
conf.set("wrapHorizontal",settings.wrapHorizontal);
conf.set("wrapVertical",settings.wrapVertical);
conf.set("stepOnDelete",settings.stepOnDelete);
conf.set("scrollStep",settings.scrollStep);
conf.set("avoidRaisingPattern",settings.avoidRaisingPattern);
@ -5540,7 +5547,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("stepOnInsert",settings.stepOnInsert);
conf.set("effectCursorDir",settings.effectCursorDir);
conf.set("cursorPastePos",settings.cursorPastePos);
conf.set("effectDeletionAltersValue",settings.effectDeletionAltersValue);
conf.set("pushNibble",settings.pushNibble);
@ -5548,16 +5555,17 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("cursorMoveNoScroll",settings.cursorMoveNoScroll);
conf.set("notePreviewBehavior",settings.notePreviewBehavior);
conf.set("absorbInsInput",settings.absorbInsInput);
conf.set("moveWindowTitle",settings.moveWindowTitle);
conf.set("doubleClickColumn",settings.doubleClickColumn);
conf.set("dragMovesSelection",settings.dragMovesSelection);
conf.set("draggableDataView",settings.draggableDataView);
conf.set("cursorFollowsOrder",settings.cursorFollowsOrder);
conf.set("insertBehavior",settings.insertBehavior);
conf.set("pullDeleteRow",settings.pullDeleteRow);
conf.set("cursorFollowsWheel",settings.cursorFollowsWheel);
@ -5565,7 +5573,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("removeInsOff",settings.removeInsOff);
conf.set("removeVolOff",settings.removeVolOff);
conf.set("insTypeMenu",settings.insTypeMenu);
conf.set("selectAssetOnLoad",settings.selectAssetOnLoad);
conf.set("inputRepeat",settings.inputRepeat);
@ -6307,7 +6315,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
}
}
}
if (updateFonts) {
// chan osc work pool
if (chanOscWorkPool!=NULL) {
@ -6503,7 +6511,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
sty.ScaleAllSizes(dpiScale);
ImGui::GetStyle()=sty;
updateSampleTex=true;
ImGui::GetIO().ConfigInputTrickleEventQueue=settings.eventDelay;