mainwindow/timelinepanel: closing a timeline will close a sequence entirely

UI detail.
This commit is contained in:
itsmattkc
2020-04-07 03:07:43 +10:00
parent 9f89f57090
commit cf04cad238
7 changed files with 92 additions and 21 deletions
+17 -1
View File
@@ -26,7 +26,8 @@
OLIVE_NAMESPACE_ENTER
TimelinePanel::TimelinePanel(QWidget *parent) :
TimeBasedPanel(parent)
TimeBasedPanel(parent),
signal_instead_of_close_(false)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("TimelinePanel");
@@ -152,6 +153,11 @@ void TimelinePanel::OverwriteFootageAtPlayhead(const QList<Footage *> &footage)
static_cast<TimelineWidget*>(GetTimeBasedWidget())->OverwriteFootageAtPlayhead(footage);
}
void TimelinePanel::SetSignalInsteadOfClose(bool e)
{
signal_instead_of_close_ = e;
}
void TimelinePanel::Retranslate()
{
TimeBasedPanel::Retranslate();
@@ -159,4 +165,14 @@ void TimelinePanel::Retranslate()
SetTitle(tr("Timeline"));
}
void TimelinePanel::closeEvent(QCloseEvent *event)
{
if (signal_instead_of_close_) {
event->ignore();
emit CloseRequested();
} else {
PanelWidget::closeEvent(event);
}
}
OLIVE_NAMESPACE_EXIT