1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-29 22:58:39 +02:00

Revert "Highlighting of resizers"

This reverts commit 3e7f82cf5e4f4ce064a8bf5fcb136f12df933f9a.
This commit is contained in:
Paul Licameli 2017-07-11 14:16:58 -04:00
parent 3e7f82cf5e
commit cddeb94c4b
3 changed files with 21 additions and 44 deletions

View File

@ -1648,14 +1648,12 @@ void TrackPanel::RefreshTrack(Track *trk, bool refreshbacking)
link = trk->GetLink(); link = trk->GetLink();
} }
// So that the highlighting of the resizer refreshes, // subtract insets and shadows from the rectangle, but not border
// include left and right inset areas, // This matters because some separators do paint over the border
// exclude the inset above, wxRect rect(kLeftInset,
// but include the inset below.
wxRect rect(0,
-mViewInfo->vpos + trk->GetY() + kTopInset, -mViewInfo->vpos + trk->GetY() + kTopInset,
GetRect().GetWidth(), GetRect().GetWidth() - kLeftInset - kRightInset - kShadowThickness,
trk->GetHeight() ); trk->GetHeight() - kTopInset - kShadowThickness);
if (link) { if (link) {
rect.height += link->GetHeight(); rect.height += link->GetHeight();
@ -1751,8 +1749,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
trackRect.height = 0; // for drawing background in no tracks case. trackRect.height = 0; // for drawing background in no tracks case.
VisibleTrackIterator iter(GetProject()); VisibleTrackIterator iter(GetProject());
Track *prev{}; for (Track *t = iter.First(); t; t = iter.Next()) {
for (Track *t = iter.First(); t; prev = t, t = iter.Next()) {
trackRect.y = t->GetY() - mViewInfo->vpos; trackRect.y = t->GetY() - mViewInfo->vpos;
trackRect.height = t->GetHeight(); trackRect.height = t->GetHeight();
@ -1796,7 +1793,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
if (mAx->IsFocused(t)) { if (mAx->IsFocused(t)) {
focusRect = borderRect; focusRect = borderRect;
} }
DrawOutside(context, borderTrack, prev, borderRect); DrawOutside(context, borderTrack, borderRect);
} }
// Believe it or not, we can speed up redrawing if we don't // Believe it or not, we can speed up redrawing if we don't
@ -1838,7 +1835,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
mUIHandle->DrawExtras(UIHandle::Cells, dc, region, clip); mUIHandle->DrawExtras(UIHandle::Cells, dc, region, clip);
// Paint over the part below the tracks // Paint over the part below the tracks
trackRect.y += trackRect.height + kTopInset; trackRect.y += trackRect.height;
if (trackRect.y < clip.GetBottom()) { if (trackRect.y < clip.GetBottom()) {
AColor::TrackPanelBackground(dc, false); AColor::TrackPanelBackground(dc, false);
dc->DrawRectangle(trackRect.x, dc->DrawRectangle(trackRect.x,
@ -2294,7 +2291,7 @@ void TrackInfo::Status2DrawFunction
void TrackPanel::DrawOutside void TrackPanel::DrawOutside
(TrackPanelDrawingContext &context, (TrackPanelDrawingContext &context,
Track * t, Track *prev, const wxRect & rec) Track * t, const wxRect & rec)
{ {
auto dc = &context.dc; auto dc = &context.dc;
bool bIsWave = (t->GetKind() == Track::Wave); bool bIsWave = (t->GetKind() == Track::Wave);
@ -2303,7 +2300,7 @@ void TrackPanel::DrawOutside
{ {
// Start with whole track rect // Start with whole track rect
wxRect rect = rec; wxRect rect = rec;
DrawOutsideOfTrack(context, t, prev, rect); DrawOutsideOfTrack(context, t, rect);
// Now exclude left, right, and top insets // Now exclude left, right, and top insets
rect.x += kLeftInset; rect.x += kLeftInset;
@ -2345,7 +2342,7 @@ void TrackPanel::DrawOutside
// If linked to a following channel, also paint the separator area, which // If linked to a following channel, also paint the separator area, which
// overlaps the next track rectangle's top // overlaps the next track rectangle's top
void TrackPanel::DrawOutsideOfTrack void TrackPanel::DrawOutsideOfTrack
(TrackPanelDrawingContext &context, Track * t, Track *prev, const wxRect & rect) (TrackPanelDrawingContext &context, Track * t, const wxRect & rect)
{ {
auto dc = &context.dc; auto dc = &context.dc;
@ -2358,13 +2355,10 @@ void TrackPanel::DrawOutsideOfTrack
side.width = kLeftInset; side.width = kLeftInset;
dc->DrawRectangle(side); dc->DrawRectangle(side);
if (!prev) // Area between panel border and top track border
{ side = rect;
// Area above the first track side.height = kTopInset;
side = rect; dc->DrawRectangle(side);
side.height = kTopInset;
dc->DrawRectangle(side);
}
// Area between panel border and right track border // Area between panel border and right track border
side = rect; side = rect;
@ -2372,32 +2366,17 @@ void TrackPanel::DrawOutsideOfTrack
side.width = kTopInset; side.width = kTopInset;
dc->DrawRectangle(side); dc->DrawRectangle(side);
auto target = dynamic_cast<TrackPanelResizeHandle*>(context.target.get()); // Area between tracks of stereo group
auto highlight = target && target->GetTrack().get() == t; if (t->GetLinked()
side = rect;
side.y += t->GetHeight();
// Area below the track
if (highlight ||
t->GetLinked()
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
|| MONO_WAVE_PAN(t) || MONO_WAVE_PAN(t)
#endif #endif
) { ) {
// Paint the channel separator over (what would be) the shadow of the top // Paint the channel separator over (what would be) the shadow of the top
// channel, and the top inset of the bottom channel // channel, and the top inset of the bottom channel
side = rect;
// (Or, highlight the resizer area below the track) side.y += t->GetHeight() - kShadowThickness;
side.y -= kShadowThickness;
side.height = kTopInset + kShadowThickness; side.height = kTopInset + kShadowThickness;
if (highlight)
dc->SetBrush( AColor::uglyBrush );
dc->DrawRectangle(side);
}
else
{
side.height = kTopInset;
dc->DrawRectangle(side); dc->DrawRectangle(side);
} }
} }

View File

@ -417,14 +417,14 @@ protected:
const wxRect & clip); const wxRect & clip);
void DrawOutside void DrawOutside
(TrackPanelDrawingContext &context, (TrackPanelDrawingContext &context,
Track *t, Track *prev, const wxRect & rec); Track *t, const wxRect & rec);
void HighlightFocusedTrack (wxDC* dc, const wxRect &rect); void HighlightFocusedTrack (wxDC* dc, const wxRect &rect);
void DrawShadow (Track *t, wxDC* dc, const wxRect & rect); void DrawShadow (Track *t, wxDC* dc, const wxRect & rect);
void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul); void DrawBordersAroundTrack(Track *t, wxDC* dc, const wxRect & rect, const int labelw, const int vrul);
void DrawOutsideOfTrack void DrawOutsideOfTrack
(TrackPanelDrawingContext &context, (TrackPanelDrawingContext &context,
Track *t, Track *prev, const wxRect & rect); Track *t, const wxRect & rect);
public: public:
// Set the object that performs catch-all event handling when the pointer // Set the object that performs catch-all event handling when the pointer

View File

@ -67,8 +67,6 @@ TrackPanelResizeHandle::TrackPanelResizeHandle
: mpTrack{ track } : mpTrack{ track }
, mMouseClickY( y ) , mMouseClickY( y )
{ {
mChangeHighlight = RefreshCode::RefreshCell;
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY #ifdef EXPERIMENTAL_OUTPUT_DISPLAY
if (MONO_WAVE_PAN(track)){ if (MONO_WAVE_PAN(track)){
//STM: Determine whether we should rescale one or two tracks //STM: Determine whether we should rescale one or two tracks