This commit is contained in:
parent
516db43b20
commit
9dbc0c6ba2
@ -104,6 +104,9 @@ void AppConfig::set_defaults()
|
||||
|
||||
if (get("use_free_camera").empty())
|
||||
set("use_free_camera", "0");
|
||||
|
||||
if (get("reverse_mouse_wheel_zoom").empty())
|
||||
set("reverse_mouse_wheel_zoom", "0");
|
||||
#endif // !ENABLE_GCODE_VIEWER
|
||||
|
||||
#if ENABLE_ENVIRONMENT_MAP
|
||||
@ -124,6 +127,9 @@ void AppConfig::set_defaults()
|
||||
|
||||
if (get("use_free_camera").empty())
|
||||
set("use_free_camera", "0");
|
||||
|
||||
if (get("reverse_mouse_wheel_zoom").empty())
|
||||
set("reverse_mouse_wheel_zoom", "0");
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
|
||||
if (get("show_splash_screen").empty())
|
||||
|
@ -3399,7 +3399,8 @@ void GLCanvas3D::on_mouse_wheel(wxMouseEvent& evt)
|
||||
return;
|
||||
|
||||
// Calculate the zoom delta and apply it to the current zoom factor
|
||||
_update_camera_zoom((double)evt.GetWheelRotation() / (double)evt.GetWheelDelta());
|
||||
double direction_factor = (wxGetApp().app_config->get("reverse_mouse_wheel_zoom") == "1") ? -1.0 : 1.0;
|
||||
_update_camera_zoom(direction_factor * (double)evt.GetWheelRotation() / (double)evt.GetWheelDelta());
|
||||
}
|
||||
|
||||
void GLCanvas3D::on_timer(wxTimerEvent& evt)
|
||||
|
@ -195,6 +195,13 @@ void PreferencesDialog::build()
|
||||
option = Option(def, "use_free_camera");
|
||||
m_optgroup_camera->append_single_option_line(option);
|
||||
|
||||
def.label = L("Reverse direction of zoom with mouse wheel");
|
||||
def.type = coBool;
|
||||
def.tooltip = L("If enabled, reverses the direction of zoom with mouse wheel");
|
||||
def.set_default_value(new ConfigOptionBool(app_config->get("reverse_mouse_wheel_zoom") == "1"));
|
||||
option = Option(def, "reverse_mouse_wheel_zoom");
|
||||
m_optgroup_camera->append_single_option_line(option);
|
||||
|
||||
m_optgroup_camera->activate();
|
||||
|
||||
m_optgroup_gui = std::make_shared<ConfigOptionsGroup>(this, _L("GUI"));
|
||||
@ -225,7 +232,6 @@ void PreferencesDialog::build()
|
||||
m_optgroup_gui->append_single_option_line(option);
|
||||
#if ENABLE_GCODE_VIEWER
|
||||
}
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
|
||||
def.label = L("Sequential slider applied only to top layer");
|
||||
def.type = coBool;
|
||||
@ -234,6 +240,7 @@ void PreferencesDialog::build()
|
||||
def.set_default_value(new ConfigOptionBool{ app_config->get("seq_top_layer_only") == "1" });
|
||||
option = Option(def, "seq_top_layer_only");
|
||||
m_optgroup_gui->append_single_option_line(option);
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
|
||||
m_optgroup_gui->activate();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user