add setting for choosing whether to save window position

This commit is contained in:
aurora 2022-08-22 22:17:19 +03:00
parent 8b3c4a84a8
commit 0e847dc1aa
3 changed files with 26 additions and 14 deletions

View file

@ -4685,8 +4685,8 @@ bool FurnaceGUI::finish() {
// commit last window size // commit last window size
e->setConf("lastWindowWidth",scrConfW); e->setConf("lastWindowWidth",scrConfW);
e->setConf("lastWindowHeight",scrConfH); e->setConf("lastWindowHeight",scrConfH);
e->setConf("lastWindowX",scrConfX); e->setConf("lastWindowX",settings.saveWindowPos?scrConfX:(int)SDL_WINDOWPOS_CENTERED);
e->setConf("lastWindowY",scrConfY); e->setConf("lastWindowY",settings.saveWindowPos?scrConfY:(int)SDL_WINDOWPOS_CENTERED);
e->setConf("lastWindowMax",scrMax); e->setConf("lastWindowMax",scrMax);
e->setConf("tempoView",tempoView); e->setConf("tempoView",tempoView);

View file

@ -1129,6 +1129,7 @@ class FurnaceGUI {
int dragMovesSelection; int dragMovesSelection;
int unsignedDetune; int unsignedDetune;
int noThreadedInput; int noThreadedInput;
int saveWindowPos;
int clampSamples; int clampSamples;
int saveUnusedPatterns; int saveUnusedPatterns;
int channelColors; int channelColors;

View file

@ -509,6 +509,14 @@ void FurnaceGUI::drawSettings() {
ImGui::SetTooltip("threaded input processes key presses for note preview on a separate thread (on supported platforms), which reduces latency.\nhowever, crashes have been reported when threaded input is on. enable this option if that is the case."); ImGui::SetTooltip("threaded input processes key presses for note preview on a separate thread (on supported platforms), which reduces latency.\nhowever, crashes have been reported when threaded input is on. enable this option if that is the case.");
} }
bool saveWindowPosB=settings.saveWindowPos;
if (ImGui::Checkbox("Remember window location",&saveWindowPosB)) {
settings.saveWindowPos=saveWindowPosB;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("remembers where window was last located on start-up. When disabled, window will start in a defaul location.");
}
bool blankInsB=settings.blankIns; bool blankInsB=settings.blankIns;
if (ImGui::Checkbox("New instruments are blank",&blankInsB)) { if (ImGui::Checkbox("New instruments are blank",&blankInsB)) {
settings.blankIns=blankInsB; settings.blankIns=blankInsB;
@ -2213,6 +2221,7 @@ void FurnaceGUI::syncSettings() {
settings.dragMovesSelection=e->getConfInt("dragMovesSelection",2); settings.dragMovesSelection=e->getConfInt("dragMovesSelection",2);
settings.unsignedDetune=e->getConfInt("unsignedDetune",0); settings.unsignedDetune=e->getConfInt("unsignedDetune",0);
settings.noThreadedInput=e->getConfInt("noThreadedInput",0); settings.noThreadedInput=e->getConfInt("noThreadedInput",0);
settings.saveWindowPos=e->getConfInt("saveWindowPos",1);
settings.initialSysName=e->getConfString("initialSysName",""); settings.initialSysName=e->getConfString("initialSysName","");
settings.clampSamples=e->getConfInt("clampSamples",0); settings.clampSamples=e->getConfInt("clampSamples",0);
settings.noteOffLabel=e->getConfString("noteOffLabel","OFF"); settings.noteOffLabel=e->getConfString("noteOffLabel","OFF");
@ -2313,6 +2322,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.dragMovesSelection,0,2); clampSetting(settings.dragMovesSelection,0,2);
clampSetting(settings.unsignedDetune,0,1); clampSetting(settings.unsignedDetune,0,1);
clampSetting(settings.noThreadedInput,0,1); clampSetting(settings.noThreadedInput,0,1);
clampSetting(settings.saveWindowPos,0,1);
clampSetting(settings.clampSamples,0,1); clampSetting(settings.clampSamples,0,1);
clampSetting(settings.saveUnusedPatterns,0,1); clampSetting(settings.saveUnusedPatterns,0,1);
clampSetting(settings.channelColors,0,2); clampSetting(settings.channelColors,0,2);
@ -2458,6 +2468,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("dragMovesSelection",settings.dragMovesSelection); e->setConf("dragMovesSelection",settings.dragMovesSelection);
e->setConf("unsignedDetune",settings.unsignedDetune); e->setConf("unsignedDetune",settings.unsignedDetune);
e->setConf("noThreadedInput",settings.noThreadedInput); e->setConf("noThreadedInput",settings.noThreadedInput);
e->setConf("saveWindowPos",settings.saveWindowPos);
e->setConf("clampSamples",settings.clampSamples); e->setConf("clampSamples",settings.clampSamples);
e->setConf("noteOffLabel",settings.noteOffLabel); e->setConf("noteOffLabel",settings.noteOffLabel);
e->setConf("noteRelLabel",settings.noteRelLabel); e->setConf("noteRelLabel",settings.noteRelLabel);