GUI: more usability improvements

- move cursor to end of clipboard when pasting
- better effect input
This commit is contained in:
tildearrow 2022-04-03 19:20:30 -05:00
parent d112cd0c68
commit 90bbc42290
4 changed files with 35 additions and 1 deletions

View file

@ -556,6 +556,9 @@ void FurnaceGUI::doPaste(PasteMode mode) {
i=1;
}
}
if (settings.cursorPastePos) {
cursor.y=j;
}
makeUndo(GUI_UNDO_PATTERN_PASTE);
}

View file

@ -976,7 +976,18 @@ void FurnaceGUI::valueInput(int num, bool direct, int target) {
curNibble=false;
} else {
curNibble=!curNibble;
if (!curNibble) editAdvance();
if (!curNibble) {
if (!settings.effectCursorDir) {
editAdvance();
} else {
if (cursor.xFine&1) {
cursor.xFine++;
} else {
editAdvance();
cursor.xFine--;
}
}
}
}
}
}

View file

@ -731,6 +731,8 @@ class FurnaceGUI {
int loadJapanese;
int fmLayout;
int susPosition;
int effectCursorDir;
int cursorPastePos;
unsigned int maxUndoSteps;
String mainFontPath;
String patFontPath;
@ -785,6 +787,8 @@ class FurnaceGUI {
loadJapanese(0),
fmLayout(0),
susPosition(0),
effectCursorDir(1),
cursorPastePos(1),
maxUndoSteps(100),
mainFontPath(""),
patFontPath(""),

View file

@ -237,6 +237,16 @@ void FurnaceGUI::drawSettings() {
settings.stepOnInsert=stepOnInsertB;
}
bool effectCursorDirB=settings.effectCursorDir;
if (ImGui::Checkbox("Move cursor to effect value on effect input",&effectCursorDirB)) {
settings.effectCursorDir=effectCursorDirB;
}
bool cursorPastePosB=settings.cursorPastePos;
if (ImGui::Checkbox("Move cursor to end of clipboard content when pasting",&cursorPastePosB)) {
settings.cursorPastePos=cursorPastePosB;
}
bool allowEditDockingB=settings.allowEditDocking;
if (ImGui::Checkbox("Allow docking editors",&allowEditDockingB)) {
settings.allowEditDocking=allowEditDockingB;
@ -1357,6 +1367,8 @@ void FurnaceGUI::syncSettings() {
settings.loadJapanese=e->getConfInt("loadJapanese",0);
settings.fmLayout=e->getConfInt("fmLayout",0);
settings.susPosition=e->getConfInt("susPosition",0);
settings.effectCursorDir=e->getConfInt("effectCursorDir",1);
settings.cursorPastePos=e->getConfInt("cursorPastePos",1);
clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96);
@ -1403,6 +1415,8 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.loadJapanese,0,1);
clampSetting(settings.fmLayout,0,3);
clampSetting(settings.susPosition,0,1);
clampSetting(settings.effectCursorDir,0,1);
clampSetting(settings.cursorPastePos,0,1);
// keybinds
LOAD_KEYBIND(GUI_ACTION_OPEN,FURKMOD_CMD|SDLK_o);
@ -1646,6 +1660,8 @@ void FurnaceGUI::commitSettings() {
e->setConf("loadJapanese",settings.loadJapanese);
e->setConf("fmLayout",settings.fmLayout);
e->setConf("susPosition",settings.susPosition);
e->setConf("effectCursorDir",settings.effectCursorDir);
e->setConf("cursorPastePos",settings.cursorPastePos);
PUT_UI_COLOR(GUI_COLOR_BACKGROUND);
PUT_UI_COLOR(GUI_COLOR_FRAME_BACKGROUND);