diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-02-27 01:11:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-02-27 01:11:57 +0100 |
| commit | 5f62647ae8896b62439fa6c29b66fd640072838a (patch) | |
| tree | 4e52112d4c8a03a2b505c32c497945a3a334de21 | |
| parent | efc6f0d2148441f3a30e2a66349d66461bb986f9 (diff) | |
Add Shift+scrollwheel to move left/right in the timeline.
| -rw-r--r-- | src/wx/timeline.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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> 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); } } |
