mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-15 15:50:54 +02:00
(Sync-Lock)
Commented out the one call to TrackInfo::DrawBordersWithin(). This eliminates all the dark lines within the TrackInfo, in an effort to make the sync-lock icon not look like a button. It leaves some lighter borders, and I think that's an aesthetic improvement, though it make be worse in terms of accessibility. I can also remove the light border above the sync-lock icon, but I think this looks best overall. In Track::IsSyncLockSelected(), for the "// Not in a sync-locked group." conditional, it returned true if the track was selected. I made it do so only if track kind is Wave or Label. Among other things, this means Time and Note tracks will never show the sync-lock icon. I think this is correct by definition, but Al, please let me know if this will have negative repercussions elsewhere. There are *lots* of calls to that method and I can move the track-type check to the code that draws the sync-lock icon.. Fixed the bug Gale pointed out where, if a WaveTrack is shrunk such that the sync-lock icon is over a TrackInfo control, such as pan slider, it didn't intercept the mouse event, and passed it on to the control. Now, clicking on the sync-lock icon does nothing. Fixed a bug where the sync-lock icon was redrawn dark when the minimize button is down. Now not redrawn at all in that case. Added some clarifying comments, especially about the term "Label" as used in TrackPanel.*.
This commit is contained in:
parent
f430aad99b
commit
702894c67d
@ -217,7 +217,7 @@ bool Track::IsSyncLockSelected()
|
||||
|
||||
if (!t) {
|
||||
// Not in a sync-locked group.
|
||||
return GetSelected();
|
||||
return ((this->GetKind() == Track::Wave) || (this->GetKind() == Track::Label)) && GetSelected();
|
||||
}
|
||||
|
||||
for (; t; t = git.Next()) {
|
||||
|
@ -45,9 +45,13 @@
|
||||
main part of the screen which contains multiple tracks.
|
||||
|
||||
It uses many other classes, but in particular it uses the
|
||||
TrackInfo class to draw the label on the left of a track,
|
||||
TrackInfo class to draw the controls area on the left of a track,
|
||||
and the TrackArtist class to draw the actual waveforms.
|
||||
|
||||
Note that in some of the older code here, e.g., GetLabelWidth(),
|
||||
"Label" means the TrackInfo plus the vertical ruler.
|
||||
Confusing relative to LabelTrack labels.
|
||||
|
||||
The TrackPanel manages multiple tracks and their TrackInfos.
|
||||
|
||||
Note that with stereo tracks there will be one TrackInfo
|
||||
@ -59,6 +63,7 @@
|
||||
\brief
|
||||
The TrackInfo is shown to the side of a track
|
||||
It has the menus, pan and gain controls displayed in it.
|
||||
So "Info" is somewhat a misnomer. Should possibly be "TrackControls".
|
||||
|
||||
TrackPanel and not TrackInfo takes care of the functionality for
|
||||
each of the buttons in that panel.
|
||||
@ -1104,7 +1109,7 @@ void TrackPanel::DoDrawIndicator(wxDC & dc)
|
||||
|
||||
mRuler->DrawIndicator( pos, rec );
|
||||
|
||||
// Ensure that we don't draw through the Track Info
|
||||
// Ensure that we don't draw through the TrackInfo or vertical ruler.
|
||||
wxRect clip = GetRect();
|
||||
int leftCutoff = clip.x + GetLabelWidth();
|
||||
int rightInset = kLeftInset + 2; // See the call to SetInset
|
||||
@ -1401,21 +1406,22 @@ bool TrackPanel::SetCursorByActivity( )
|
||||
return false;
|
||||
}
|
||||
|
||||
/// When in the label, we can either vertical zoom or re-order tracks.
|
||||
/// When in the "label" (TrackInfo or vertical ruler), we can either vertical zoom or re-order tracks.
|
||||
/// Dont't change cursor/tip to zoom if display is not waveform (either linear of dB) or Spectrum
|
||||
void TrackPanel::SetCursorAndTipWhenInLabel( Track * t,
|
||||
wxMouseEvent &event, const wxChar ** ppTip )
|
||||
{
|
||||
if (event.m_x >= GetVRulerOffset() &&
|
||||
t->GetKind() == Track::Wave &&
|
||||
(((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectrumDisplay
|
||||
||((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectrumLogDisplay)) {
|
||||
*ppTip = _("Click to vertically zoom in, Shift-click to zoom out, Drag to create a particular zoom region.");
|
||||
(t->GetKind() == Track::Wave) &&
|
||||
(((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectrumDisplay ||
|
||||
((WaveTrack *) t)->GetDisplay() <= WaveTrack::SpectrumLogDisplay))
|
||||
{
|
||||
*ppTip = _("Click to vertically zoom in. Shift-click to zoom out. Drag to specify a zoom region.");
|
||||
SetCursor(event.ShiftDown()? *mZoomOutCursor : *mZoomInCursor);
|
||||
}
|
||||
else {
|
||||
// Set a status message if over a label
|
||||
*ppTip = _("Drag the label vertically to change the order of the tracks.");
|
||||
// Set a status message if over TrackInfo.
|
||||
*ppTip = _("Drag the track vertically to change the order of the tracks.");
|
||||
SetCursor(*mArrowCursor);
|
||||
}
|
||||
}
|
||||
@ -3691,6 +3697,7 @@ void TrackPanel::OnContextMenu(wxContextMenuEvent & event)
|
||||
/// This handles when the user clicks on the "Label" area
|
||||
/// of a track, ie the part with all the buttons and the drop
|
||||
/// down menu, etc.
|
||||
// That is, TrackInfo and vertical ruler rect.
|
||||
void TrackPanel::HandleLabelClick(wxMouseEvent & event)
|
||||
{
|
||||
// AS: If not a click, ignore the mouse event.
|
||||
@ -3913,15 +3920,30 @@ bool TrackPanel::MuteSoloFunc(Track * t, wxRect r, int x, int y,
|
||||
bool TrackPanel::MinimizeFunc(Track * t, wxRect r, int x, int y)
|
||||
{
|
||||
wxRect buttonRect;
|
||||
mTrackInfo.GetMinimizeRect(r, buttonRect, t->IsSyncLockSelected());
|
||||
// Vaughan: Pass false for bIsSyncLockSelected instead of t->IsSyncLockSelected() because
|
||||
// we want to check the whole width, so we can return true, indicating we have handled
|
||||
// the mouse click, and so avoid this click being passed on to other controls in the TrackInfo,
|
||||
// if we're showing the sync-lock icon (which doesn't handle mouse clicks).
|
||||
mTrackInfo.GetMinimizeRect(r, buttonRect, false);
|
||||
if (!buttonRect.Contains(x, y))
|
||||
return false;
|
||||
|
||||
wxClientDC dc(this);
|
||||
SetCapturedTrack( t, IsMinimizing );
|
||||
mCapturedRect = r;
|
||||
// Now we know we're over the minimize button or the sync-lock icon. Get the correct rect.
|
||||
mTrackInfo.GetMinimizeRect(r, buttonRect, t->IsSyncLockSelected());
|
||||
|
||||
// Set up for handling only if event is in actual button rect, not the sync-lock icon.
|
||||
if (buttonRect.Contains(x, y))
|
||||
{
|
||||
SetCapturedTrack(t, IsMinimizing);
|
||||
mCapturedRect = r;
|
||||
|
||||
wxClientDC dc(this);
|
||||
mTrackInfo.DrawMinimize(&dc, r, t, true);
|
||||
}
|
||||
else
|
||||
// In the sync-lock icon rect. Tell HandleMinimizing to no-op.
|
||||
SetCapturedTrack(NULL);
|
||||
|
||||
mTrackInfo.DrawMinimize(&dc, r, t, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5151,7 +5173,7 @@ void TrackPanel::DrawOutside(Track * t, wxDC * dc, const wxRect rec,
|
||||
mTrackInfo.DrawTitleBar(dc, r, t, (captured && mMouseCapture==IsPopping));
|
||||
|
||||
mTrackInfo.DrawMinimize(dc, r, t, (captured && mMouseCapture==IsMinimizing));
|
||||
mTrackInfo.DrawBordersWithin( dc, r, bIsWave );
|
||||
//vvvvv mTrackInfo.DrawBordersWithin( dc, r, bIsWave );
|
||||
|
||||
if (bIsWave) {
|
||||
mTrackInfo.DrawMuteSolo(dc, r, t, (captured && mMouseCapture == IsMuting), false, HasSoloButton());
|
||||
@ -7241,7 +7263,7 @@ void TrackInfo::DrawBordersWithin(wxDC * dc, const wxRect r, bool bHasMuteSolo )
|
||||
AColor::Line(*dc, r.x, r.y + 66, GetTitleWidth(), r.y + 66); // bevel below mute/solo
|
||||
}
|
||||
|
||||
AColor::Line(*dc, r.x, r.y + r.height - 19, GetTitleWidth(), r.y + r.height - 19); // minimize bar
|
||||
//vvvvv AColor::Line(*dc, r.x, r.y + r.height - 19, GetTitleWidth(), r.y + r.height - 19); // minimize button
|
||||
}
|
||||
|
||||
void TrackInfo::DrawBackground(wxDC * dc, const wxRect r, bool bSelected,
|
||||
@ -7258,11 +7280,13 @@ void TrackInfo::DrawBackground(wxDC * dc, const wxRect r, bool bSelected,
|
||||
fill=wxRect( r.x+1, r.y+17, vrul-6, 32);
|
||||
AColor::BevelTrackInfo( *dc, true, fill );
|
||||
|
||||
//vvvvv
|
||||
fill=wxRect( r.x+1, r.y+67, fill.width, r.height-87);
|
||||
AColor::BevelTrackInfo( *dc, true, fill );
|
||||
}
|
||||
else
|
||||
{
|
||||
//vvvvv
|
||||
fill=wxRect( r.x+1, r.y+17, vrul-6, r.height-37);
|
||||
AColor::BevelTrackInfo( *dc, true, fill );
|
||||
}
|
||||
@ -7405,13 +7429,16 @@ void TrackInfo::DrawMuteSolo(wxDC * dc, const wxRect r, Track * t,
|
||||
}
|
||||
}
|
||||
|
||||
// Draw the minimize button *and* the sync-lock track icon, if necessary.
|
||||
void TrackInfo::DrawMinimize(wxDC * dc, const wxRect r, Track * t, bool down)
|
||||
{
|
||||
wxRect bev;
|
||||
bool bIsSyncLockSelected = t->IsSyncLockSelected();
|
||||
GetMinimizeRect(r, bev, bIsSyncLockSelected);
|
||||
|
||||
if (t->IsSyncLockSelected())
|
||||
// Draw the sync-lock icon if track is sync-lock selected, but don't redraw
|
||||
// it if the button is down. That would cause the icon to blink dark.
|
||||
if (bIsSyncLockSelected && !down)
|
||||
{
|
||||
wxBitmap syncLockBitmap(theTheme.Image(bmpSyncLockIcon));
|
||||
dc->DrawBitmap(syncLockBitmap,
|
||||
|
@ -111,6 +111,8 @@ private:
|
||||
void DrawMuteSolo(wxDC * dc, const wxRect r, Track * t, bool down, bool solo, bool bHasSoloButton);
|
||||
void DrawVRuler(wxDC * dc, const wxRect r, Track * t);
|
||||
void DrawSliders(wxDC * dc, WaveTrack *t, wxRect r);
|
||||
|
||||
// Draw the minimize button *and* the sync-lock track icon, if necessary.
|
||||
void DrawMinimize(wxDC * dc, const wxRect r, Track * t, bool down);
|
||||
|
||||
void GetTrackControlsRect(const wxRect r, wxRect &dest) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user