X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftitlewidget.cpp;h=7af47ac43256cebdc82613b1a4cd61ad5e9788e3;hb=c60577adb3b7427f8a39acb35d6e7577b6c67130;hp=4822cba2082de468296277dc752bc78a61bdedb5;hpb=b93295675e9670f26ebca37e56960ab84ab94cc8;p=kdenlive diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index 4822cba2..7af47ac4 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -462,6 +462,8 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render m_endViewport->setData(0, m_frameWidth); m_endViewport->setData(1, m_frameHeight); + // scale the view so that the title widget is not too big at startup + graphicsView->scale(.5, .5); if (!url.isEmpty()) loadTitle(url); else { slotTextTool(); @@ -780,7 +782,7 @@ void TitleWidget::displayBackgroundFrame() p.end(); m_frameImage->setPixmap(bg); } else { - m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), m_frameWidth / 2, m_frameHeight / 2))); + m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), QString(), m_frameWidth / 2, m_frameHeight / 2))); } } @@ -1785,6 +1787,11 @@ void TitleWidget::saveTitle(KUrl url) { if (anim_start->isChecked()) slotAnimStart(false); if (anim_end->isChecked()) slotAnimEnd(false); + bool embed_image=false; + if (KMessageBox::questionYesNo(this, i18n("Do you want to embed Images into this TitleDocument?\nThis is most needed for sharing Titles.")) != KMessageBox::No) + { + embed_image=true; + } if (url.isEmpty()) { KFileDialog *fs = new KFileDialog(KUrl(m_projectTitlePath), "application/x-kdenlivetitle", this); fs->setOperationMode(KFileDialog::Saving); @@ -1798,7 +1805,7 @@ void TitleWidget::saveTitle(KUrl url) delete fs; } if (!url.isEmpty()) { - if (m_titledocument.saveDocument(url, m_startViewport, m_endViewport, m_tc.getFrameCount(title_duration->text()) - 1) == false) + if (m_titledocument.saveDocument(url, m_startViewport, m_endViewport, m_tc.getFrameCount(title_duration->text()), embed_image) == false) KMessageBox::error(this, i18n("Cannot write to file %1", url.path())); } } @@ -1806,21 +1813,21 @@ void TitleWidget::saveTitle(KUrl url) QDomDocument TitleWidget::xml() { QDomDocument doc = m_titledocument.xml(m_startViewport, m_endViewport); - doc.documentElement().setAttribute("out", m_tc.getFrameCount(title_duration->text()) - 1); + doc.documentElement().setAttribute("out", m_tc.getFrameCount(title_duration->text())); return doc; } int TitleWidget::outPoint() const { - return m_tc.getFrameCount(title_duration->text()) - 1; + return m_tc.getFrameCount(title_duration->text()); } void TitleWidget::setXml(QDomDocument doc) { int out; - m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport, &out); + m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport, &out, m_projectTitlePath); adjustFrameSize(); - title_duration->setText(m_tc.getTimecode(GenTime(out + 1, m_render->fps()))); + title_duration->setText(m_tc.getTimecode(GenTime(out, m_render->fps()))); /*if (doc.documentElement().hasAttribute("out")) { GenTime duration = GenTime(doc.documentElement().attribute("out").toDouble() / 1000.0); title_duration->setText(m_tc.getTimecode(duration));