From: Carl Hetherington Date: Tue, 27 Feb 2024 00:11:52 +0000 (+0100) Subject: Add Shift+scrollwheel to move left/right in the timeline. X-Git-Tag: v2.17.13~12^2~6 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=5f62647ae8896b62439fa6c29b66fd640072838a Add Shift+scrollwheel to move left/right in the timeline. --- diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index f67bf52dc..38e9de4ee 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -136,8 +136,9 @@ Timeline::Timeline(wxWindow* parent, ContentPanel* cp, shared_ptr film, Fi void Timeline::mouse_wheel_turned(wxMouseEvent& event) { + auto const rotation = event.GetWheelRotation(); + if (event.ControlDown()) { - auto const rotation = event.GetWheelRotation(); /* On my mouse one click of the scroll wheel is 120, and it's -ve when * scrolling the wheel towards me. */ @@ -166,6 +167,12 @@ Timeline::mouse_wheel_turned(wxMouseEvent& event) _last_mouse_wheel_x = event.GetX(); _last_mouse_wheel_time = before_pos; } + } else if (event.ShiftDown()) { + int before_start_x; + int before_start_y; + _main_canvas->GetViewStart(&before_start_x, &before_start_y); + auto const width = _main_canvas->GetSize().GetWidth(); + _main_canvas->Scroll(std::max(0.0, before_start_x - rotation * 100.0 / width), before_start_y); } }