1
0
Fork 0

Remove "Video Panning" option

It's probably stable enough at this point, and hiding it behind an
option just creates more confusion than it prevents.
This commit is contained in:
arch1t3cht 2022-11-17 17:29:18 +01:00
parent 28db5d31ce
commit cba8d3644f
4 changed files with 12 additions and 28 deletions

View File

@ -614,7 +614,6 @@
"Show Keyframes" : true
},
"Subtitle Sync" : true,
"Video Pan": false,
"Default to Video Zoom": false
}
}

View File

@ -614,7 +614,6 @@
"Show Keyframes" : true
},
"Subtitle Sync" : true,
"Video Pan": false,
"Default to Video Zoom": false
}
}

View File

@ -173,7 +173,8 @@ void Video(wxTreebook *book, Preferences *parent) {
p->OptionAdd(general, _("Seek video to line start on selection change"), "Video/Subtitle Sync");
p->CellSkip(general);
p->OptionAdd(general, _("Automatically open audio when opening video"), "Video/Open Audio");
p->CellSkip(general);
p->OptionAdd(general, _("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.");
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");
@ -437,10 +438,6 @@ void Advanced_Video(wxTreebook *book, Preferences *parent) {
wxArrayString sp_choice = to_wx(SubtitlesProviderFactory::GetClasses());
p->OptionChoice(expert, _("Subtitles provider"), sp_choice, "Subtitle/Provider");
p->OptionAdd(expert, _("Video Panning"), "Video/Video Pan");
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
auto avisynth = p->PageSizer("Avisynth");

View File

@ -376,27 +376,17 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) {
last_mouse_pos = mouse_pos = event.GetPosition();
///if video pan
bool videoPan = OPT_GET("Video/Video Pan")->GetBool();
if (videoPan){
if (event.GetButton() == wxMOUSE_BTN_MIDDLE) {
if ((panning = event.ButtonDown()))
pan_last_pos = event.GetPosition();
}
if (panning && event.Dragging()) {
pan_x += event.GetX() - pan_last_pos.X();
pan_y += event.GetY() - pan_last_pos.Y();
if (event.GetButton() == wxMOUSE_BTN_MIDDLE) {
if ((panning = event.ButtonDown()))
pan_last_pos = event.GetPosition();
}
if (panning && event.Dragging()) {
pan_x += event.GetX() - pan_last_pos.X();
pan_y += event.GetY() - pan_last_pos.Y();
pan_last_pos = event.GetPosition();
PositionVideo();
}
}
else if ((pan_x != 0 || pan_y != 0) && !videoPan)
{
pan_x = pan_y = 0;
PositionVideo();
}
PositionVideo();
}
///
@ -411,13 +401,12 @@ 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) && !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())) {
if (event.ControlDown() == OPT_GET("Video/Default to Video Zoom")->GetBool()) {
SetWindowZoom(windowZoomValue + .125 * (wheel / event.GetWheelDelta()));
} else {
SetVideoZoom(wheel / event.GetWheelDelta());