]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackview.cpp
Fix timeline corruption when creating new project with fps != default fps
[kdenlive] / src / effectstackview.cpp
index 0908fea54ef122ac898cf82343183872f0a68f34..4f08611f1cc9d862c3619d84df43ddb00a7870f7 100644 (file)
@@ -23,6 +23,7 @@
 #include "docclipbase.h"
 #include "projectlist.h"
 #include "kthumb.h"
+#include "monitoreditwidget.h"
 #include "monitorscene.h"
 #include "kdenlivesettings.h"
 
@@ -48,9 +49,11 @@ EffectStackView::EffectStackView(Monitor *monitor, QWidget *parent) :
     m_ui.setupUi(this);
     QVBoxLayout *vbox1 = new QVBoxLayout(m_ui.frame);
     m_effectedit = new EffectStackEdit(monitor, m_ui.frame);
-    vbox1->setContentsMargins(0, 0, 0, 0);
+    vbox1->setContentsMargins(2, 0, 2, 0);
     vbox1->setSpacing(0);
     vbox1->addWidget(m_effectedit);
+    m_ui.splitter->setStretchFactor(0, 0);
+    m_ui.splitter->setStretchFactor(1, 200);
 
     //m_ui.region_url->fileDialog()->setFilter(ProjectList::getExtensions());
     //m_ui.effectlist->horizontalHeader()->setVisible(false);
@@ -176,9 +179,9 @@ void EffectStackView::slotClipItemSelected(ClipItem* c, int ix)
         m_clipref = c;
         if (c) {
             QString cname = m_clipref->clipName();
-            if (cname.length() > 20) {
+            if (cname.length() > 30) {
                 m_ui.checkAll->setToolTip(i18n("Effects for %1").arg(cname));
-                cname.truncate(17);
+                cname.truncate(27);
                 m_ui.checkAll->setText(i18n("Effects for %1").arg(cname) + "...");
             } else {
                 m_ui.checkAll->setToolTip(QString());
@@ -294,8 +297,7 @@ void EffectStackView::setupListView(int ix)
         m_ui.buttonShowComments->setEnabled(false);
         m_ui.labelComment->setHidden(true);
     } else {
-        qMin(ix, 0);
-        qMax(ix, m_ui.effectlist->count() - 1);
+        ix = qBound(0, ix, m_ui.effectlist->count() - 1);
         m_ui.effectlist->setCurrentRow(ix);
         m_ui.checkAll->setEnabled(true);
     }
@@ -485,7 +487,7 @@ void EffectStackView::slotCheckAll(int state)
 void EffectStackView::slotCheckMonitorPosition(int renderPos)
 {
     if (m_trackMode || (renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
-        if (!m_monitor->getEffectScene()->views().at(0)->isVisible())
+        if (!m_monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
             m_monitor->slotEffectScene(true);
     } else {
         m_monitor->slotEffectScene(false);