Somewhere along the line the 'rect' passed in to DrawTrackName()changed
from being for the track area to being for the name area. Accordingly
the track rect now has to be explicitly accessed from the track to get
its height, from which the transparency is then derived.
This removes all of the OnDemand code embedded throughout
the main codebase. Individual files related specifically
to OD have been left in place, but removed from the build.
Problem: Newly added track which is set as the focus can be only partially visible or invisible.
If TrackPanel::OnEnsureVisible is called after a new track has been added, then in that function the line:
mListener->TP_ScrollUpDown(height);
can lead to incorrect results, as the vertical scrollbars have not yet been updated to take into account the additional track.
Fix:
Update the scrollbars in TrackPanel::OnTrackListResizing().
... in four cases; not in some other .cpp file.
This is another move that causes the generated graph to reflect dependencies
correctly.
This fixes other large, hidden cycles that involved PrefsDialog.cpp: there was
link dependency on that when PrefsPanel.h was used for the base class. No
longer.
Also cycles involving TrackPanel.cpp, which contained the default
implementations for TrackPanelCell and related abstract base classes.
Problem:
Currently calling Track::EnsureVisible() also sets the track as focus.
In Audacity 2.3.3 the timing of the code to set the focus was changed. Rather than a direct call, an event is queued, and then the focus is set. This has changed the timing of the focus event which is sent with respect to other focus and name change events. In particular in the case of toggling the selectness of the focused track, this moved the focus event to be after the name change event.
These changes only had an effect on NVDA - Jaws and Narrator were unaffected.
The introduction of this bug has highlighted an existing problem.
1. There are a small number of existing cases where a track needs to be visible, but where it is already the focus, and so setting the focus is unnecessary. For example, pressing Enter to toggle whether a track is selected.
2. Some of the Audacity code which calls EnsureVisible() is written with the assumption that EnsureVisible() doesn't set the focus, and so there are unnecessary focus events. Whilst other code which calls EnsureVisible() assumes that it also sets the focus. Confusion.
The Fix:
Remove the setting of focus from within Track::EnsureVisible(), and so remove the unnecessary focus events.
Calls to set the focus were added before calls to EnsureVisible where the code was relying on EnsureVisible to set the focus. In TrackPanel::ProcessUIHandleResult, and TrackPanel::OnMouseEvent, I wasn't sure if the focus needed to be set, so called it anyway to ensure that the behaviour did not change.
So I would like to remove the setting of focus from within Track::EnsureVisible(), and add explicit calls to set the focus where necessary.
I think this would make the code clearer, remove unnecessary calls to set the focus, and make it easier to keep NVDA happy.
Problem:
When the TrackPanel regains focus, screen readers do not read the track name.
Introduced by the commit: acfd2b70
Fix:
Change TrackPanel::SetFocusedCell() so that it actually sets the focus, rather than just getting it :)
Note: this also fixes bug 2238
... by a redefined area subdivision policy in TrackPanel
So the SpectrumView, WaveformView, and associated ruler and handle classes
find real use, while WaveTrackView is really used only for its height and to
supply the delegate, and WaveTrackVRulerControls and WaveTrackVZoomHandle
are not used
There is also some anticipation of multiple track views
Problem:
Currently KeyboardCapture::Capture(this) is called in TrackPanel::OnTrackFocusChange().
So the keyboard handler is not automatically set when the track panel becomes the focus.
Example of a symptom:
A project contains a label track, and is the focus, and type to create a label is enabled.
Move to focus to another window, and then back to the Audacity window.
Type a character. A label is not created.
Fix:
Move the call KeyboardCapture::Capture(this) to TrackPanel::SetFocusedCell(), so that it gets called when the TrackPanel becomes the focus.
... in places that need the TrackPanel but only to invoke common wxWindow
methods on it.
This eliminates direct use of TrackPanel by Scrubbing and ProjectWindow