add setting for ctrlWheeling mod (default now allows super as well as ctrl)
This commit is contained in:
parent
d19cd493c4
commit
5d351eab0a
|
@ -425,6 +425,19 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FurnaceGUI::isCtrlWheelModifierHeld() const {
|
||||||
|
switch (settings.ctrlWheelModifier) {
|
||||||
|
case 0:
|
||||||
|
return ImGui::IsKeyDown(ImGuiMod_Ctrl) || ImGui::IsKeyDown(ImGuiMod_Super);
|
||||||
|
case 1:
|
||||||
|
return ImGui::IsKeyDown(ImGuiMod_Ctrl);
|
||||||
|
case 2:
|
||||||
|
return ImGui::IsKeyDown(ImGuiMod_Super);
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool FurnaceGUI::CWSliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags) {
|
bool FurnaceGUI::CWSliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, ImGuiSliderFlags flags) {
|
||||||
flags^=ImGuiSliderFlags_AlwaysClamp;
|
flags^=ImGuiSliderFlags_AlwaysClamp;
|
||||||
if (ImGui::SliderScalar(label,data_type,p_data,p_min,p_max,format,flags)) {
|
if (ImGui::SliderScalar(label,data_type,p_data,p_min,p_max,format,flags)) {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#define FURNACE_APP_ID "org.tildearrow.furnace"
|
#define FURNACE_APP_ID "org.tildearrow.furnace"
|
||||||
|
|
||||||
#define rightClickable if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) ImGui::SetKeyboardFocusHere(-1);
|
#define rightClickable if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) ImGui::SetKeyboardFocusHere(-1);
|
||||||
#define ctrlWheeling ((ImGui::IsKeyDown(ImGuiKey_LeftCtrl) || ImGui::IsKeyDown(ImGuiKey_RightCtrl)) && wheelY!=0)
|
#define ctrlWheeling (isCtrlWheelModifierHeld() && wheelY!=0)
|
||||||
|
|
||||||
#define handleUnimportant if (settings.insFocusesPattern && patternOpen) {nextWindow=GUI_WINDOW_PATTERN;}
|
#define handleUnimportant if (settings.insFocusesPattern && patternOpen) {nextWindow=GUI_WINDOW_PATTERN;}
|
||||||
#define unimportant(x) if (x) {handleUnimportant}
|
#define unimportant(x) if (x) {handleUnimportant}
|
||||||
|
@ -1826,6 +1826,7 @@ class FurnaceGUI {
|
||||||
int patRowsBase;
|
int patRowsBase;
|
||||||
int orderRowsBase;
|
int orderRowsBase;
|
||||||
int soloAction;
|
int soloAction;
|
||||||
|
int ctrlWheelModifier;
|
||||||
int pullDeleteBehavior;
|
int pullDeleteBehavior;
|
||||||
int wrapHorizontal;
|
int wrapHorizontal;
|
||||||
int wrapVertical;
|
int wrapVertical;
|
||||||
|
@ -2087,6 +2088,7 @@ class FurnaceGUI {
|
||||||
patRowsBase(0),
|
patRowsBase(0),
|
||||||
orderRowsBase(1),
|
orderRowsBase(1),
|
||||||
soloAction(0),
|
soloAction(0),
|
||||||
|
ctrlWheelModifier(0),
|
||||||
pullDeleteBehavior(1),
|
pullDeleteBehavior(1),
|
||||||
wrapHorizontal(0),
|
wrapHorizontal(0),
|
||||||
wrapVertical(0),
|
wrapVertical(0),
|
||||||
|
@ -2764,6 +2766,7 @@ class FurnaceGUI {
|
||||||
static bool LocalizedComboGetter(void* data, int idx, const char** out_text);
|
static bool LocalizedComboGetter(void* data, int idx, const char** out_text);
|
||||||
|
|
||||||
// these ones offer ctrl-wheel fine value changes.
|
// these ones offer ctrl-wheel fine value changes.
|
||||||
|
bool isCtrlWheelModifierHeld() const;
|
||||||
bool CWSliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format=NULL, ImGuiSliderFlags flags=0);
|
bool CWSliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format=NULL, ImGuiSliderFlags flags=0);
|
||||||
bool CWVSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format=NULL, ImGuiSliderFlags flags=0);
|
bool CWVSliderScalar(const char* label, const ImVec2& size, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format=NULL, ImGuiSliderFlags flags=0);
|
||||||
bool CWSliderInt(const char* label, int* v, int v_min, int v_max, const char* format="%d", ImGuiSliderFlags flags=0);
|
bool CWSliderInt(const char* label, int* v, int v_min, int v_max, const char* format="%d", ImGuiSliderFlags flags=0);
|
||||||
|
|
|
@ -2738,6 +2738,22 @@ void FurnaceGUI::drawSettings() {
|
||||||
}
|
}
|
||||||
ImGui::Unindent();
|
ImGui::Unindent();
|
||||||
|
|
||||||
|
ImGui::Text(_("Modifier for alternate wheel-scrolling (vertical/zoom/slider-input):"));
|
||||||
|
ImGui::Indent();
|
||||||
|
if (ImGui::RadioButton(_("Ctrl or Meta/Cmd##cwm1"),settings.ctrlWheelModifier==0)) {
|
||||||
|
settings.ctrlWheelModifier=0;
|
||||||
|
settingsChanged=true;
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton(_("Ctrl##cwm2"),settings.ctrlWheelModifier==1)) {
|
||||||
|
settings.ctrlWheelModifier=1;
|
||||||
|
settingsChanged=true;
|
||||||
|
}
|
||||||
|
if (ImGui::RadioButton(_("Meta/Cmd##cwm3"),settings.ctrlWheelModifier==2)) {
|
||||||
|
settings.ctrlWheelModifier=2;
|
||||||
|
settingsChanged=true;
|
||||||
|
}
|
||||||
|
ImGui::Unindent();
|
||||||
|
|
||||||
bool doubleClickColumnB=settings.doubleClickColumn;
|
bool doubleClickColumnB=settings.doubleClickColumn;
|
||||||
if (ImGui::Checkbox(_("Double click selects entire column"),&doubleClickColumnB)) {
|
if (ImGui::Checkbox(_("Double click selects entire column"),&doubleClickColumnB)) {
|
||||||
settings.doubleClickColumn=doubleClickColumnB;
|
settings.doubleClickColumn=doubleClickColumnB;
|
||||||
|
@ -4839,6 +4855,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
||||||
|
|
||||||
if (groups&GUI_SETTINGS_BEHAVIOR) {
|
if (groups&GUI_SETTINGS_BEHAVIOR) {
|
||||||
settings.soloAction=conf.getInt("soloAction",0);
|
settings.soloAction=conf.getInt("soloAction",0);
|
||||||
|
settings.ctrlWheelModifier=conf.getInt("ctrlWheelModifier",0);
|
||||||
settings.pullDeleteBehavior=conf.getInt("pullDeleteBehavior",1);
|
settings.pullDeleteBehavior=conf.getInt("pullDeleteBehavior",1);
|
||||||
settings.wrapHorizontal=conf.getInt("wrapHorizontal",0);
|
settings.wrapHorizontal=conf.getInt("wrapHorizontal",0);
|
||||||
settings.wrapVertical=conf.getInt("wrapVertical",0);
|
settings.wrapVertical=conf.getInt("wrapVertical",0);
|
||||||
|
@ -5141,6 +5158,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
||||||
clampSetting(settings.patRowsBase,0,1);
|
clampSetting(settings.patRowsBase,0,1);
|
||||||
clampSetting(settings.orderRowsBase,0,1);
|
clampSetting(settings.orderRowsBase,0,1);
|
||||||
clampSetting(settings.soloAction,0,2);
|
clampSetting(settings.soloAction,0,2);
|
||||||
|
clampSetting(settings.ctrlWheelModifier,0,2);
|
||||||
clampSetting(settings.pullDeleteBehavior,0,1);
|
clampSetting(settings.pullDeleteBehavior,0,1);
|
||||||
clampSetting(settings.wrapHorizontal,0,2);
|
clampSetting(settings.wrapHorizontal,0,2);
|
||||||
clampSetting(settings.wrapVertical,0,3);
|
clampSetting(settings.wrapVertical,0,3);
|
||||||
|
@ -5428,6 +5446,7 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
||||||
// behavior
|
// behavior
|
||||||
if (groups&GUI_SETTINGS_BEHAVIOR) {
|
if (groups&GUI_SETTINGS_BEHAVIOR) {
|
||||||
conf.set("soloAction",settings.soloAction);
|
conf.set("soloAction",settings.soloAction);
|
||||||
|
conf.set("ctrlWheelModifier",settings.ctrlWheelModifier);
|
||||||
conf.set("pullDeleteBehavior",settings.pullDeleteBehavior);
|
conf.set("pullDeleteBehavior",settings.pullDeleteBehavior);
|
||||||
conf.set("wrapHorizontal",settings.wrapHorizontal);
|
conf.set("wrapHorizontal",settings.wrapHorizontal);
|
||||||
conf.set("wrapVertical",settings.wrapVertical);
|
conf.set("wrapVertical",settings.wrapVertical);
|
||||||
|
|
Loading…
Reference in a new issue