int doc_width = doc.documentElement().attribute("width").toInt();
int doc_height = doc.documentElement().attribute("height").toInt();
if (doc_width != m_width || doc_height != m_height) {
- KMessageBox::information(kapp->activeWindow(), i18n("This title clip was created with a different frame size. It will now be converted to the current project's size."), i18n("Resizing Title Clip"));
+ KMessageBox::information(kapp->activeWindow(), i18n("This title clip was created with a different frame size."), i18n("Title Profile"));
//TODO: convert using QTransform
+ m_width = doc_width;
+ m_height = doc_height;
}
}
//TODO: get default title duration instead of hardcoded one
l.at(6).toDouble(), l.at(7).toDouble(), l.at(8).toDouble()
);
}
+
+int TitleDocument::frameWidth() const
+{
+ return m_width;
+}
+
+int TitleDocument::frameHeight() const
+{
+ return m_height;
+}
+
+
/** \brief Get the background color (incl. alpha) from the document, if possibly
* \returns The background color of the document, inclusive alpha. If none found, returns (0,0,0,0) */
QColor getBackgroundColor();
+ int frameWidth() const;
+ int frameHeight() const;
enum ItemOrigin {OriginXLeft = 0, OriginYTop = 1};
enum AxisPosition {AxisDefault = 0, AxisInverted = 1};
readChoices();
initViewports();
- QTimer::singleShot(500, this, SLOT(slotAdjustZoom()));
graphicsView->show();
//graphicsView->setRenderHint(QPainter::Antialiasing);
graphicsView->setInteractive(true);
if (!url.isEmpty()) {
double out;
m_count = m_titledocument.loadDocument(url, m_startViewport, m_endViewport, &out) + 1;
+ adjustFrameSize();
title_duration->setText(m_tc.getTimecode(GenTime(out), m_render->fps()));
slotSelectTool();
} else {
slotTextTool();
}
+ QTimer::singleShot(200, this, SLOT(slotAdjustZoom()));
}
TitleWidget::~TitleWidget()
m_scene->clearTextSelection();
double out;
m_count = m_titledocument.loadDocument(url, m_startViewport, m_endViewport, &out) + 1;
+ adjustFrameSize();
title_duration->setText(m_tc.getTimecode(GenTime(out / 1000.0), m_render->fps()));
insertingValues = true;
startViewportX->setValue(m_startViewport->data(0).toInt());
endViewportSize->setValue(m_endViewport->data(2).toInt());
insertingValues = false;
slotSelectTool();
+ slotAdjustZoom();
}
}
{
double out;
m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport, &out);
- kDebug() << "\n\n// TITLE OUT: " << out;
+ adjustFrameSize();
title_duration->setText(m_tc.getTimecode(GenTime(out / 1000.0), m_render->fps()));
/*if (doc.documentElement().hasAttribute("out")) {
GenTime duration = GenTime(doc.documentElement().attribute("out").toDouble() / 1000.0);
kcolorbutton->setColor(background_color);
horizontalSlider->blockSignals(false);
kcolorbutton->blockSignals(false);
-
+ QTimer::singleShot(200, this, SLOT(slotAdjustZoom()));
slotSelectTool();
}
cropImage->setChecked(titleConfig.readEntry("crop_image", cropImage->isChecked()));
}
+void TitleWidget::adjustFrameSize()
+{
+ m_frameWidth = m_titledocument.frameWidth();
+ m_frameHeight = m_titledocument.frameHeight();
+ m_frameBorder->setRect(0, 0, m_frameWidth, m_frameHeight);
+ displayBackgroundFrame();
+}
+
+
+
+