From 8ba2787160b75137fb85e919d7197571168c6158 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 25 Apr 2022 16:46:38 -0500 Subject: [PATCH] GUI: add two ImGui settings --- src/gui/gui.h | 4 ++++ src/gui/settings.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/gui/gui.h b/src/gui/gui.h index 8c850fd06..98a861127 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -842,6 +842,8 @@ class FurnaceGUI { int notePreviewBehavior; int powerSave; int absorbInsInput; + int eventDelay; + int moveWindowTitle; unsigned int maxUndoSteps; String mainFontPath; String patFontPath; @@ -917,6 +919,8 @@ class FurnaceGUI { notePreviewBehavior(1), powerSave(1), absorbInsInput(0), + eventDelay(0), + moveWindowTitle(0), maxUndoSteps(100), mainFontPath(""), patFontPath(""), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index c7a235113..61493722c 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -313,6 +313,21 @@ void FurnaceGUI::drawSettings() { settings.sysFileDialog=sysFileDialogB; } + bool moveWindowTitleB=settings.moveWindowTitle; + if (ImGui::Checkbox("Only allow window movement when clicking on title bar",&moveWindowTitleB)) { + settings.moveWindowTitle=moveWindowTitleB; + applyUISettings(false); + } + + bool eventDelayB=settings.eventDelay; + if (ImGui::Checkbox("Enable event delay",&eventDelayB)) { + settings.eventDelay=eventDelayB; + applyUISettings(false); + } + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("may cause issues with high-polling-rate mice when previewing notes."); + } + bool powerSaveB=settings.powerSave; if (ImGui::Checkbox("Power-saving mode",&powerSaveB)) { settings.powerSave=powerSaveB; @@ -1651,6 +1666,8 @@ void FurnaceGUI::syncSettings() { settings.notePreviewBehavior=e->getConfInt("notePreviewBehavior",1); settings.powerSave=e->getConfInt("powerSave",POWER_SAVE_DEFAULT); settings.absorbInsInput=e->getConfInt("absorbInsInput",0); + settings.eventDelay=e->getConfInt("eventDelay",0); + settings.moveWindowTitle=e->getConfInt("moveWindowTitle",0); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.patFontSize,2,96); @@ -1715,6 +1732,8 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.notePreviewBehavior,0,3); clampSetting(settings.powerSave,0,1); clampSetting(settings.absorbInsInput,0,1); + clampSetting(settings.eventDelay,0,1); + clampSetting(settings.moveWindowTitle,0,1); // keybinds for (int i=0; isetConf("notePreviewBehavior",settings.notePreviewBehavior); e->setConf("powerSave",settings.powerSave); e->setConf("absorbInsInput",settings.absorbInsInput); + e->setConf("eventDelay",settings.eventDelay); + e->setConf("moveWindowTitle",settings.moveWindowTitle); // colors for (int i=0; i