diff --git a/src/libresrc/default_config.json b/src/libresrc/default_config.json index ce27a3fa6..0f913a66d 100644 --- a/src/libresrc/default_config.json +++ b/src/libresrc/default_config.json @@ -590,6 +590,8 @@ }, "Video" : { + "Disable Scroll Zoom" : false, + "Reverse Zoom" : false, "Default Zoom" : 7, "Detached" : { "Enabled" : false, @@ -619,6 +621,6 @@ }, "Subtitle Sync" : true, "Video Pan": false, - "Default to UI Zoom": false + "Default to Video Zoom": false } } diff --git a/src/libresrc/osx/default_config.json b/src/libresrc/osx/default_config.json index 2e24ccbec..22d9a570f 100644 --- a/src/libresrc/osx/default_config.json +++ b/src/libresrc/osx/default_config.json @@ -589,6 +589,8 @@ }, "Video" : { + "Disable Scroll Zoom" : false, + "Reverse Zoom" : false, "Default Zoom" : 7, "Detached" : { "Enabled" : false, @@ -618,6 +620,6 @@ }, "Subtitle Sync" : true, "Video Pan": false, - "Default to UI Zoom": false + "Default to Video Zoom": false } } diff --git a/src/preferences.cpp b/src/preferences.cpp index c9119f9c2..2a212cf69 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -174,6 +174,9 @@ void Video(wxTreebook *book, Preferences *parent) { p->CellSkip(general); p->OptionAdd(general, _("Automatically open audio when opening video"), "Video/Open Audio"); p->CellSkip(general); + p->OptionAdd(general, _("Disable zooming with scroll bar"), "Video/Disable Scroll Zoom") + ->SetToolTip("Makes the scroll bar not zoom the video. Useful when using a track pad that often scrolls accidentally."); + p->OptionAdd(general, _("Reverse zoom direction"), "Video/Reverse Zoom"); const wxString czoom_arr[24] = { "12.5%", "25%", "37.5%", "50%", "62.5%", "75%", "87.5%", "100%", "112.5%", "125%", "137.5%", "150%", "162.5%", "175%", "187.5%", "200%", "212.5%", "225%", "237.5%", "250%", "262.5%", "275%", "287.5%", "300%" }; wxArrayString choice_zoom(24, czoom_arr); @@ -446,7 +449,8 @@ void Advanced_Video(wxTreebook *book, Preferences *parent) { p->OptionChoice(expert, _("Subtitles provider"), sp_choice, "Subtitle/Provider"); p->OptionAdd(expert, _("Video Panning"), "Video/Video Pan"); - p->OptionAdd(expert, _("Default to UI Zoom"), "Video/Default to UI Zoom"); + p->OptionAdd(expert, _("Default to Video Zoom"), "Video/Default to Video Zoom") + ->SetToolTip("Reverses the behavior of Ctrl while scrolling the video display. If not set, scrolling will default to UI zoom and Ctrl+scrolling will zoom the video. If set, this will be reversed."); #ifdef WITH_AVISYNTH diff --git a/src/video_display.cpp b/src/video_display.cpp index aeeaec508..b58cbe64e 100644 --- a/src/video_display.cpp +++ b/src/video_display.cpp @@ -409,8 +409,11 @@ void VideoDisplay::OnMouseLeave(wxMouseEvent& event) { void VideoDisplay::OnMouseWheel(wxMouseEvent& event) { bool videoPan = OPT_GET("Video/Video Pan")->GetBool(); if (int wheel = event.GetWheelRotation()) { - if (ForwardMouseWheelEvent(this, event)) { - if (!videoPan || (event.ControlDown() != OPT_GET("Video/Default to UI Zoom")->GetBool())) { + if (ForwardMouseWheelEvent(this, event) && !OPT_GET("Video/Disable Scroll Zoom")->GetBool()) { + if (OPT_GET("Video/Reverse Zoom")->GetBool()) { + wheel = -wheel; + } + if (!videoPan || (event.ControlDown() == OPT_GET("Video/Default to Video Zoom")->GetBool())) { SetWindowZoom(windowZoomValue + .125 * (wheel / event.GetWheelDelta())); } else { SetVideoZoom(wheel / event.GetWheelDelta());