mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-22 14:32:58 +02:00
Move drawing code for background of vertical rulers
This commit is contained in:
@@ -293,17 +293,6 @@ void TrackArt::DrawVRuler
|
|||||||
#endif
|
#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
|
// Label and Time tracks do not have a vruler
|
||||||
// But give it a beveled area
|
// But give it a beveled area
|
||||||
t->TypeSwitch(
|
t->TypeSwitch(
|
||||||
|
@@ -13,7 +13,10 @@ Paul Licameli split from TrackPanel.cpp
|
|||||||
|
|
||||||
#include "TrackView.h"
|
#include "TrackView.h"
|
||||||
|
|
||||||
|
#include "../../AColor.h"
|
||||||
#include "../../Track.h"
|
#include "../../Track.h"
|
||||||
|
#include "../../TrackArtist.h"
|
||||||
|
#include "../../TrackPanelDrawingContext.h"
|
||||||
#include "../../ViewInfo.h"
|
#include "../../ViewInfo.h"
|
||||||
|
|
||||||
#include <wx/cursor.h>
|
#include <wx/cursor.h>
|
||||||
@@ -85,3 +88,29 @@ void TrackVRulerControls::DrawZooming
|
|||||||
|
|
||||||
dc->DrawRectangle(rect);
|
dc->DrawRectangle(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TrackVRulerControls::Draw(
|
||||||
|
TrackPanelDrawingContext &context,
|
||||||
|
const wxRect &rect_, unsigned iPass )
|
||||||
|
{
|
||||||
|
// Common initial part of drawing for all subtypes
|
||||||
|
if ( iPass == TrackArtist::PassMargins ) {
|
||||||
|
auto rect = rect_;
|
||||||
|
--rect.width;
|
||||||
|
|
||||||
|
auto dc = &context.dc;
|
||||||
|
|
||||||
|
|
||||||
|
// Paint the background
|
||||||
|
auto pTrack = FindTrack();
|
||||||
|
AColor::MediumTrackInfo(dc, pTrack && pTrack->GetSelected() );
|
||||||
|
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() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -46,6 +46,11 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
std::shared_ptr<Track> DoFindTrack() override;
|
std::shared_ptr<Track> DoFindTrack() override;
|
||||||
|
|
||||||
|
// TrackPanelDrawable implementation
|
||||||
|
void Draw(
|
||||||
|
TrackPanelDrawingContext &context,
|
||||||
|
const wxRect &rect, unsigned iPass ) override;
|
||||||
|
|
||||||
Track *GetTrack() const;
|
Track *GetTrack() const;
|
||||||
|
|
||||||
std::weak_ptr<TrackView> mwTrackView;
|
std::weak_ptr<TrackView> mwTrackView;
|
||||||
|
Reference in New Issue
Block a user