From 63c89e1fe34667ae367e58ce8eb567627e2c2687 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 5 Jun 2017 22:18:24 -0400 Subject: [PATCH] Simplify logic of track control panel click to rearrange... ... Rearrange drag is now simply the default of all other hit tests. The comment, as to the purpose of the removed call to TrackSelFunc, is obsolete, because clicks on hidden buttons and sliders have recently been disabled. The mention of "the area left of the minimize button" is obsolete because there is no such area any more after 2.2.0 layout changes. Just before this commit, click in the minimize button but near the left edge did not minimize, but started a track rearrange drag! That should not be so. --- src/TrackPanel.cpp | 23 ----------------------- src/TrackPanel.h | 5 ----- 2 files changed, 28 deletions(-) diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index de61feec2..e9064fbd4 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -5333,12 +5333,6 @@ void TrackPanel::HandleLabelClick(wxMouseEvent & event) if (isleft && PopupFunc(t, rect, event.m_x, event.m_y)) return; - // VJ: Check sync-lock icon and the blank area to the left of the minimize button. - // Have to do it here, because if track is shrunk such that these areas occlude controls, - // e.g., mute/solo, don't want the "Funcs" below to set up handling. - // Only result of doing so is to select the track. Don't care whether isleft. - bool bTrackSelClick = this->TrackSelFunc(t, rect, event.m_x, event.m_y); - if (!bTrackSelClick) { // MM: Check minimize buttons on WaveTracks. Must be before // solo/mute buttons, sliders etc. @@ -5583,23 +5577,6 @@ bool TrackPanel::MuteSoloFunc(Track * t, wxRect rect, int x, int y, return true; } -bool TrackPanel::TrackSelFunc(Track * WXUNUSED(t), wxRect rect, int x, int y) -{ - // First check the blank space to left of minimize button. - wxRect selRect; - mTrackInfo.GetMinimizeRect(rect, selRect); // for y and height - selRect.x = rect.x; - selRect.width = 16; // (kTrackInfoBtnSize) - selRect.height++; - if (selRect.Contains(x, y)) - return true; - - // Try the sync-lock rect. - mTrackInfo.GetSyncLockIconRect(rect, selRect); - selRect.height++; - return selRect.Contains(x, y); -} - bool TrackPanel::MinimizeFunc(Track * t, wxRect rect, int x, int y) { wxRect buttonRect; diff --git a/src/TrackPanel.h b/src/TrackPanel.h index f88eb2d4e..1cbee631b 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -482,11 +482,6 @@ protected: virtual bool CloseFunc(Track * t, wxRect rect, int x, int y); virtual bool PopupFunc(Track * t, wxRect rect, int x, int y); - // TrackSelFunc, unlike the other *Func methods, returns true if the click is not - // set up to be handled, but click is on the sync-lock icon or the blank area to - // the left of the minimize button, and we want to pass it forward to be a track select. - virtual bool TrackSelFunc(Track * t, wxRect rect, int x, int y); - virtual bool MuteSoloFunc(Track *t, wxRect rect, int x, int f, bool solo); virtual bool MinimizeFunc(Track *t, wxRect rect, int x, int f); virtual bool GainFunc(Track * t, wxRect rect, wxMouseEvent &event,