further work on timeline rewrite
This commit is contained in:
+21
-2
@@ -1,9 +1,28 @@
|
||||
#include "timelinearea.h"
|
||||
|
||||
TimelineArea::TimelineArea() :
|
||||
track_list_(nullptr)
|
||||
track_list_(nullptr),
|
||||
alignment_(olive::timeline::kAlignmentTop)
|
||||
{
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
|
||||
// LABELS
|
||||
QWidget* label_container = new QWidget();
|
||||
QVBoxLayout* label_container_layout = new QVBoxLayout(label_container);
|
||||
layout->addWidget(label_container);
|
||||
|
||||
// VIEW
|
||||
view_ = new TimelineView();
|
||||
layout->addWidget(view_);
|
||||
|
||||
// SCROLLBAR
|
||||
QScrollBar* scrollbar = new QScrollBar(Qt::Vertical);
|
||||
layout->addWidget(scrollbar);
|
||||
}
|
||||
|
||||
void TimelineArea::SetAlignment(olive::timeline::Alignment alignment)
|
||||
{
|
||||
alignment_ = alignment;
|
||||
}
|
||||
|
||||
void TimelineArea::SetTrackList(Sequence *sequence, Track::Type track_list)
|
||||
@@ -29,7 +48,7 @@ void TimelineArea::RefreshLabels()
|
||||
|
||||
labels_.resize(track_list_->TrackCount());
|
||||
for (int i=0;i<labels_.size();i++) {
|
||||
labels_.at(i).settra
|
||||
labels_[i].SetTrack(track_list_->TrackAt(i));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "timeline/sequence.h"
|
||||
#include "timeline/track.h"
|
||||
#include "timeline/tracklist.h"
|
||||
#include "timeline/timelinefunctions.h"
|
||||
#include "ui/timelineview.h"
|
||||
#include "ui/timelinelabel.h"
|
||||
|
||||
@@ -13,6 +14,7 @@ class TimelineArea : public QWidget
|
||||
public:
|
||||
TimelineArea();
|
||||
|
||||
void SetAlignment(olive::timeline::Alignment alignment);
|
||||
void SetTrackList(Sequence* sequence, Track::Type track_list);
|
||||
public slots:
|
||||
void RefreshLabels();
|
||||
@@ -20,6 +22,7 @@ private:
|
||||
TrackList* track_list_;
|
||||
TimelineView* view_;
|
||||
QVector<TimelineLabel> labels_;
|
||||
olive::timeline::Alignment alignment_;
|
||||
};
|
||||
|
||||
#endif // TIMELINEAREA_H
|
||||
|
||||
@@ -72,6 +72,8 @@ TimelineView::TimelineView(QWidget *parent) : QWidget(parent) {
|
||||
track_resizing = false;
|
||||
setMouseTracking(true);
|
||||
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ void draw_waveform(ClipPtr clip, const FootageStream *ms, long media_length, QPa
|
||||
class TimelineView : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TimelineView(QWidget *parent);
|
||||
explicit TimelineView(QWidget *parent = nullptr);
|
||||
|
||||
QScrollBar* scrollBar;
|
||||
bool bottom_align;
|
||||
|
||||
Reference in New Issue
Block a user