timeline: use similar reverse strategy for inserting/overwriting from

the most recently focused project panel
This commit is contained in:
itsmattkc
2020-03-03 20:13:58 +11:00
parent c1680ad420
commit 2f7819d0ae
4 changed files with 32 additions and 2 deletions
+2 -2
View File
@@ -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
+21
View File
@@ -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);
+4
View File
@@ -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);
}