From 4f9810cd1f73c9a73006aeb5ddffcd2f5d4cee92 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 25 May 2016 12:31:30 -0400 Subject: [PATCH 1/2] Two-fingered horizontal swipe on mac touchpad scrolls the wave --- src/TrackPanel.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 721b74c21..86a384d44 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -5513,6 +5513,14 @@ void TrackPanel::HandleResize(wxMouseEvent & event) /// Handle mouse wheel rotation (for zoom in/out, vertical and horizontal scrolling) void TrackPanel::HandleWheelRotation(wxMouseEvent & event) { + if(event.GetWheelAxis() == wxMOUSE_WHEEL_HORIZONTAL) { + // Two-fingered horizontal swipe on mac is treated like shift-mousewheel + event.SetShiftDown(true); + // This makes the wave move in the same direction as the fingers, and the scrollbar + // thumb moves oppositely + event.m_wheelRotation *= -1; + } + if(!event.HasAnyModifiers()) { // We will later un-skip if we do anything, but if we don't, // propagate the event up for the sake of the scrubber From 0377a24f90445f43a0903e85ee55eb12b6c020ff Mon Sep 17 00:00:00 2001 From: Steve Daulton Date: Fri, 27 May 2016 10:45:01 +0100 Subject: [PATCH 2/2] Comment out unused TrackPanel::BuildVRulerMenuItems function The function builds pop up menus that are never displayed and creates runtime debug warnings. It is left over from PRL's experiment in 2.1.2 with a context menu for the vertical ruler. --- src/TrackPanel.cpp | 5 +++++ src/TrackPanel.h | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 86a384d44..1520c4087 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -659,6 +659,7 @@ void TrackPanel::BuildMenus(void) mTimeTrackMenu->Append(OnSetTimeTrackRangeID, _("&Range...")); mTimeTrackMenu->AppendCheckItem(OnTimeTrackLogIntID, _("Logarithmic &Interpolation")); +/* mRulerWaveformMenu = new wxMenu(); BuildVRulerMenuItems (mRulerWaveformMenu, OnFirstWaveformScaleID, @@ -668,6 +669,7 @@ void TrackPanel::BuildMenus(void) BuildVRulerMenuItems (mRulerSpectrumMenu, OnFirstSpectrumScaleID, SpectrogramSettings::GetScaleNames()); +*/ } void TrackPanel::BuildCommonDropMenuItems(wxMenu * menu) @@ -686,6 +688,8 @@ void TrackPanel::BuildCommonDropMenuItems(wxMenu * menu) } +/* +// left over from PRL's vertical ruler context menu experiment in 2.1.2 // static void TrackPanel::BuildVRulerMenuItems (wxMenu * menu, int firstId, const wxArrayString &names) @@ -698,6 +702,7 @@ void TrackPanel::BuildVRulerMenuItems menu->Append(OnZoomOutVerticalID, _("Zoom Out\tShift-Left-Click")); menu->Append(OnZoomFitVerticalID, _("Zoom to Fit\tShift-Right-Click")); } +*/ void TrackPanel::DeleteMenus(void) { diff --git a/src/TrackPanel.h b/src/TrackPanel.h index 125526903..23b0dd7d2 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -242,7 +242,10 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel { * @param menu the menu to add the commands to. */ virtual void BuildCommonDropMenuItems(wxMenu * menu); - static void BuildVRulerMenuItems(wxMenu * menu, int firstId, const wxArrayString &names); + + // left over from PRL's vertical ruler context menu experiment in 2.1.2 + // static void BuildVRulerMenuItems(wxMenu * menu, int firstId, const wxArrayString &names); + virtual bool IsAudioActive(); virtual bool IsUnsafe(); virtual bool HandleLabelTrackClick(LabelTrack * lTrack, wxRect &rect, wxMouseEvent & event);