timeline: began crude edit tool functionality
This commit is contained in:
@@ -37,6 +37,7 @@ OLIVE_NAMESPACE_ENTER
|
||||
|
||||
TimelineView::TimelineView(Qt::Alignment vertical_alignment, QWidget *parent) :
|
||||
TimelineViewBase(parent),
|
||||
selections_(nullptr),
|
||||
show_beam_cursor_(false),
|
||||
connected_track_list_(nullptr)
|
||||
{
|
||||
@@ -242,6 +243,24 @@ void TimelineView::drawForeground(QPainter *painter, const QRectF &rect)
|
||||
cursor_x,
|
||||
track_y + GetTrackHeight(track_index));
|
||||
}
|
||||
|
||||
if (selections_ && !selections_->isEmpty()) {
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->setBrush(QColor(0, 0, 0, 64));
|
||||
|
||||
for (auto it=selections_->cbegin(); it!=selections_->cend(); it++) {
|
||||
if (it.key().type() == connected_track_list_->type()) {
|
||||
int track_index = it.key().index();
|
||||
|
||||
foreach (const TimeRange& range, it.value()) {
|
||||
painter->drawRect(TimeToScene(range.in()),
|
||||
GetTrackY(track_index),
|
||||
TimeToScene(range.length()),
|
||||
GetTrackHeight(track_index));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TimelineView::ToolChangedEvent(Tool::Item tool)
|
||||
|
||||
Reference in New Issue
Block a user