moved some timelineview functions into a timelineviewbase for reusing
Later classes will feature similar functionality to the TimelineView, moving them to a base class that can be easily reused seems like a good idea.
This commit is contained in:
@@ -20,17 +20,14 @@
|
||||
|
||||
#include "timelineplayhead.h"
|
||||
|
||||
TimelinePlayhead::TimelinePlayhead()
|
||||
{
|
||||
#include <QPainter>
|
||||
|
||||
}
|
||||
|
||||
QColor TimelinePlayhead::PlayheadColor()
|
||||
const QColor &TimelinePlayhead::PlayheadColor() const
|
||||
{
|
||||
return playhead_color_;
|
||||
}
|
||||
|
||||
QColor TimelinePlayhead::PlayheadHighlightColor()
|
||||
const QColor &TimelinePlayhead::PlayheadHighlightColor() const
|
||||
{
|
||||
return playhead_highlight_color_;
|
||||
}
|
||||
@@ -44,3 +41,14 @@ void TimelinePlayhead::SetPlayheadHighlightColor(QColor c)
|
||||
{
|
||||
playhead_highlight_color_ = c;
|
||||
}
|
||||
|
||||
void TimelinePlayhead::Draw(QPainter* painter, const QRectF& playhead_rect) const
|
||||
{
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->setBrush(PlayheadHighlightColor());
|
||||
painter->drawRect(playhead_rect);
|
||||
|
||||
painter->setPen(PlayheadColor());
|
||||
painter->setBrush(Qt::NoBrush);
|
||||
painter->drawLine(QLineF(playhead_rect.topLeft(), playhead_rect.bottomLeft()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user