GUI: add move cursor by edit step on insert option

This commit is contained in:
tildearrow 2022-03-12 02:32:02 -05:00
parent a6eec9f7c4
commit 1f058ac653
3 changed files with 14 additions and 0 deletions

View file

@ -3769,6 +3769,9 @@ void FurnaceGUI::doAction(int what) {
break;
case GUI_ACTION_PAT_INSERT:
doInsert();
if (settings.stepOnInsert) {
moveCursor(0,editStep,false);
}
break;
case GUI_ACTION_PAT_MUTE_CURSOR:
if (cursor.xCoarse<0 || cursor.xCoarse>=e->getTotalChannelCount()) break;

View file

@ -535,6 +535,7 @@ class FurnaceGUI {
int guiColorsBase;
int avoidRaisingPattern;
int insFocusesPattern;
int stepOnInsert;
unsigned int maxUndoSteps;
String mainFontPath;
String patFontPath;
@ -578,6 +579,7 @@ class FurnaceGUI {
guiColorsBase(0),
avoidRaisingPattern(0),
insFocusesPattern(1),
stepOnInsert(0),
maxUndoSteps(100),
mainFontPath(""),
patFontPath(""),

View file

@ -157,6 +157,11 @@ void FurnaceGUI::drawSettings() {
settings.stepOnDelete=stepOnDeleteB;
}
bool stepOnInsertB=settings.stepOnInsert;
if (ImGui::Checkbox("Move cursor by edit step on insert (push)",&stepOnInsertB)) {
settings.stepOnInsert=stepOnInsertB;
}
bool allowEditDockingB=settings.allowEditDocking;
if (ImGui::Checkbox("Allow docking editors",&allowEditDockingB)) {
settings.allowEditDocking=allowEditDockingB;
@ -206,6 +211,7 @@ void FurnaceGUI::drawSettings() {
if (ImGui::RadioButton("Move by Edit Step##cmk1",settings.scrollStep==1)) {
settings.scrollStep=1;
}
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Audio")) {
@ -885,6 +891,7 @@ void FurnaceGUI::syncSettings() {
settings.guiColorsBase=e->getConfInt("guiColorsBase",0);
settings.avoidRaisingPattern=e->getConfInt("avoidRaisingPattern",0);
settings.insFocusesPattern=e->getConfInt("insFocusesPattern",1);
settings.stepOnInsert=e->getConfInt("stepOnInsert",0);
clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96);
@ -922,6 +929,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.guiColorsBase,0,1);
clampSetting(settings.avoidRaisingPattern,0,1);
clampSetting(settings.insFocusesPattern,0,1);
clampSetting(settings.stepOnInsert,0,1);
// keybinds
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
@ -1120,6 +1128,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("guiColorsBase",settings.guiColorsBase);
e->setConf("avoidRaisingPattern",settings.avoidRaisingPattern);
e->setConf("insFocusesPattern",settings.insFocusesPattern);
e->setConf("stepOnInsert",settings.stepOnInsert);
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);