timeline: use similar reverse strategy for inserting/overwriting from
the most recently focused project panel
This commit is contained in:
@@ -41,6 +41,8 @@ public:
|
||||
|
||||
Folder* GetSelectedFolder();
|
||||
|
||||
QList<Footage*> GetSelectedFootage();
|
||||
|
||||
ProjectViewModel* model();
|
||||
|
||||
virtual void SelectAll() override;
|
||||
@@ -64,8 +66,6 @@ private slots:
|
||||
|
||||
void ProjectNameChanged();
|
||||
|
||||
QList<Footage*> GetSelectedFootage();
|
||||
|
||||
};
|
||||
|
||||
#endif // PROJECT_PANEL_H
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
|
||||
#include "timeline.h"
|
||||
|
||||
#include "panel/panelmanager.h"
|
||||
#include "panel/project/project.h"
|
||||
|
||||
TimelinePanel::TimelinePanel(QWidget *parent) :
|
||||
TimeBasedPanel(parent)
|
||||
{
|
||||
@@ -89,6 +92,24 @@ void TimelinePanel::DecreaseTrackHeight()
|
||||
static_cast<TimelineWidget*>(GetTimeBasedWidget())->DecreaseTrackHeight();
|
||||
}
|
||||
|
||||
void TimelinePanel::Insert()
|
||||
{
|
||||
ProjectPanel* project_panel = PanelManager::instance()->MostRecentlyFocused<ProjectPanel>();
|
||||
|
||||
if (project_panel) {
|
||||
InsertFootageAtPlayhead(project_panel->GetSelectedFootage());
|
||||
}
|
||||
}
|
||||
|
||||
void TimelinePanel::Overwrite()
|
||||
{
|
||||
ProjectPanel* project_panel = PanelManager::instance()->MostRecentlyFocused<ProjectPanel>();
|
||||
|
||||
if (project_panel) {
|
||||
OverwriteFootageAtPlayhead(project_panel->GetSelectedFootage());
|
||||
}
|
||||
}
|
||||
|
||||
void TimelinePanel::InsertFootageAtPlayhead(const QList<Footage *> &footage)
|
||||
{
|
||||
static_cast<TimelineWidget*>(GetTimeBasedWidget())->InsertFootageAtPlayhead(footage);
|
||||
|
||||
@@ -55,6 +55,10 @@ public:
|
||||
|
||||
virtual void DecreaseTrackHeight() override;
|
||||
|
||||
virtual void Insert() override;
|
||||
|
||||
virtual void Overwrite() override;
|
||||
|
||||
void InsertFootageAtPlayhead(const QList<Footage *> &footage);
|
||||
|
||||
void OverwriteFootageAtPlayhead(const QList<Footage *> &footage);
|
||||
|
||||
@@ -186,6 +186,11 @@ void TimelineWidget::ImportTool::DragDrop(TimelineViewMouseEvent *event)
|
||||
void TimelineWidget::ImportTool::PlaceAt(const QList<Footage *> &footage, const rational &start, bool insert)
|
||||
{
|
||||
dragged_footage_ = footage;
|
||||
|
||||
if (dragged_footage_.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
PrepGhosts(start, 0);
|
||||
DropGhosts(insert);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user