The ruler and sash draw functions treat their own backgrounds
This commit is contained in:
parent
951e7d27da
commit
e70b240338
|
@ -369,7 +369,8 @@ void TrackArtist::DrawTrack(TrackPanelDrawingContext &context,
|
|||
}
|
||||
|
||||
void TrackArtist::DrawVRuler
|
||||
(TrackPanelDrawingContext &context, const Track *t, const wxRect & rect_)
|
||||
( TrackPanelDrawingContext &context, const Track *t, const wxRect & rect_,
|
||||
bool bSelected )
|
||||
{
|
||||
auto dc = &context.dc;
|
||||
bool highlight = false;
|
||||
|
@ -378,11 +379,16 @@ void TrackArtist::DrawVRuler
|
|||
#endif
|
||||
|
||||
|
||||
// Paint the background
|
||||
AColor::MediumTrackInfo(dc, bSelected);
|
||||
dc->DrawRectangle( rect_ );
|
||||
|
||||
// Stroke the left border
|
||||
dc->SetPen(*wxBLACK_PEN);
|
||||
{
|
||||
const auto left = rect_.GetLeft();
|
||||
AColor::Line( *dc, left, rect_.GetTop(), left, rect_.GetBottom() );
|
||||
|
||||
}
|
||||
|
||||
// Label and Time tracks do not have a vruler
|
||||
|
|
|
@ -69,7 +69,7 @@ class AUDACITY_DLL_API TrackArtist {
|
|||
bool hasSolo);
|
||||
|
||||
void DrawVRuler(TrackPanelDrawingContext &context,
|
||||
const Track *t, const wxRect & rect);
|
||||
const Track *t, const wxRect & rect, bool bSelected );
|
||||
|
||||
void UpdateVRuler(const Track *t, const wxRect & rect);
|
||||
|
||||
|
|
|
@ -1128,7 +1128,7 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
|
|||
rect.y += kTopMargin;
|
||||
rect.width = GetVRulerWidth();
|
||||
rect.height -= (kTopMargin + kBottomMargin);
|
||||
mTrackArtist->DrawVRuler(context, visibleT, rect);
|
||||
mTrackArtist->DrawVRuler(context, visibleT, rect, t->GetSelected());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1612,7 +1612,9 @@ void TrackPanel::DrawOutside
|
|||
rect.height -= kTopInset;
|
||||
|
||||
int labelw = GetLabelWidth();
|
||||
mTrackInfo.DrawBackground( dc, rect, t->GetSelected(), labelw );
|
||||
int vrul = GetVRulerOffset();
|
||||
|
||||
mTrackInfo.DrawBackground( dc, rect, t->GetSelected(), vrul );
|
||||
|
||||
// Vaughan, 2010-08-24: No longer doing this.
|
||||
// Draw sync-lock tiles in ruler area.
|
||||
|
@ -1623,7 +1625,6 @@ void TrackPanel::DrawOutside
|
|||
// TrackArtist::DrawSyncLockTiles(dc, tileFill);
|
||||
//}
|
||||
|
||||
int vrul = GetVRulerOffset();
|
||||
DrawBordersAroundTrack( dc, rect );
|
||||
{
|
||||
auto channels = TrackList::Channels(t);
|
||||
|
@ -1638,7 +1639,7 @@ void TrackPanel::DrawOutside
|
|||
wxRect sashRect{
|
||||
vrul, yy, rect.GetRight() - vrul, kSeparatorThickness
|
||||
};
|
||||
DrawSash( dc, sashRect, labelw );
|
||||
DrawSash( dc, sashRect, labelw, t->GetSelected() );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1687,7 +1688,8 @@ void TrackPanel::DrawOutsideOfTrack
|
|||
dc->DrawRectangle(side);
|
||||
}
|
||||
|
||||
void TrackPanel::DrawSash( wxDC * dc, const wxRect & rect, int labelw )
|
||||
void TrackPanel::DrawSash(
|
||||
wxDC * dc, const wxRect & rect, int labelw, bool bSelected )
|
||||
{
|
||||
// Area between channels of a group
|
||||
// Paint the channel separator over (what would be) the lower border of this
|
||||
|
@ -1695,6 +1697,10 @@ void TrackPanel::DrawSash( wxDC * dc, const wxRect & rect, int labelw )
|
|||
|
||||
ADCChanger cleanup{ dc };
|
||||
|
||||
// Paint the left part of the background
|
||||
AColor::MediumTrackInfo(dc, bSelected);
|
||||
dc->DrawRectangle( rect.GetX(), rect.GetY(), labelw, rect.GetHeight() );
|
||||
|
||||
// Stroke the left border
|
||||
dc->SetPen(*wxBLACK_PEN);
|
||||
{
|
||||
|
@ -2510,11 +2516,11 @@ void TrackInfo::DrawBordersWithin
|
|||
|
||||
// Paint the whole given rectangle some fill color
|
||||
void TrackInfo::DrawBackground(
|
||||
wxDC * dc, const wxRect & rect, bool bSelected, const int labelw) const
|
||||
wxDC * dc, const wxRect & rect, bool bSelected, const int vrul) const
|
||||
{
|
||||
// fill in label
|
||||
wxRect fill = rect;
|
||||
fill.width = labelw - kLeftInset;
|
||||
fill.width = vrul - kLeftInset;
|
||||
AColor::MediumTrackInfo(dc, bSelected);
|
||||
dc->DrawRectangle(fill);
|
||||
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
|
||||
|
||||
void DrawBackground(
|
||||
wxDC * dc, const wxRect & rect, bool bSelected, const int labelw ) const;
|
||||
wxDC * dc, const wxRect & rect, bool bSelected, const int vrul ) const;
|
||||
// void DrawBordersWithin(
|
||||
// wxDC * dc, const wxRect & rect, const Track &track ) const;
|
||||
|
||||
|
@ -379,7 +379,8 @@ protected:
|
|||
void DrawBordersAroundTrack(wxDC* dc, const wxRect & rect );
|
||||
void DrawOutsideOfTrack (
|
||||
TrackPanelDrawingContext &context, const wxRect & rect );
|
||||
void DrawSash ( wxDC* dc, const wxRect & rect, int labelw );
|
||||
void DrawSash (
|
||||
wxDC* dc, const wxRect & rect, int labelw, bool bSelected );
|
||||
|
||||
public:
|
||||
// Set the object that performs catch-all event handling when the pointer
|
||||
|
|
Loading…
Reference in New Issue
Block a user