1
0
Fork 0

Add options to commit or reverse video zoom

This commit is contained in:
arch1t3cht 2022-08-01 21:21:24 +02:00
parent fa33b07c7f
commit c07a648270
4 changed files with 11 additions and 1 deletions

View File

@ -584,6 +584,8 @@
},
"Video" : {
"Disable Scroll Zoom" : false,
"Reverse Zoom" : false,
"Default Zoom" : 7,
"Detached" : {
"Enabled" : false,

View File

@ -584,6 +584,8 @@
},
"Video" : {
"Disable Scroll Zoom" : false,
"Reverse Zoom" : false,
"Default Zoom" : 7,
"Detached" : {
"Enabled" : false,

View File

@ -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);

View File

@ -409,7 +409,10 @@ 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 (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 {