m_frameHeight = render->renderHeight();
showToolbars(TITLE_SELECT);
+ splitter->setStretchFactor(0, 20);
+
//If project is drop frame, set the input mask as such.
title_duration->setInputMask("");
title_duration->setValidator(m_tc.validator());
gradient->setSpread(QGradient::ReflectSpread);
scene->setBackgroundBrush(*gradient);*/
+ QPen framepen(Qt::DotLine);
+ framepen.setColor(Qt::red);
+
+ m_frameBorder = new QGraphicsRectItem(QRectF(0, 0, m_frameWidth, m_frameHeight));
+ m_frameBorder->setPen(framepen);
+ m_frameBorder->setZValue(-1100);
+ m_frameBorder->setBrush(Qt::transparent);
+ m_frameBorder->setFlags(0);
+ graphicsView->scene()->addItem(m_frameBorder);
+
m_frameImage = new QGraphicsPixmapItem();
QTransform qtrans;
qtrans.scale(2.0, 2.0);
connect(m_scene, SIGNAL(newText(QGraphicsTextItem *)), this , SLOT(slotNewText(QGraphicsTextItem *)));
connect(zoom_slider, SIGNAL(valueChanged(int)), this , SLOT(slotUpdateZoom(int)));
- QPen framepen(Qt::DotLine);
- framepen.setColor(Qt::red);
-
- m_frameBorder = new QGraphicsRectItem(QRectF(0, 0, m_frameWidth, m_frameHeight));
- m_frameBorder->setPen(framepen);
- m_frameBorder->setZValue(-1100);
- m_frameBorder->setBrush(Qt::transparent);
- m_frameBorder->setFlags(0);
- graphicsView->scene()->addItem(m_frameBorder);
// mbd: load saved settings
readChoices();
void TitleWidget::displayBackgroundFrame()
{
+ QRectF r = m_frameBorder->sceneBoundingRect();
if (!displayBg->isChecked()) {
- QPixmap bg(m_frameWidth / 2, m_frameHeight / 2);
QPixmap pattern(20, 20);
pattern.fill();
QColor bgcolor(210, 210, 210);
- QPainter p;
- p.begin(&pattern);
+ QPainter p(&pattern);
p.fillRect(QRect(0, 0, 10, 10), bgcolor);
p.fillRect(QRect(10, 10, 20, 20), bgcolor);
p.end();
QBrush br(pattern);
-
- p.begin(&bg);
- p.fillRect(bg.rect(), br);
- p.end();
+ QPixmap bg((int) (r.width() / 2), (int) (r.height()/ 2));
+ QPainter p2(&bg);
+ p2.fillRect(bg.rect(), br);
+ p2.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)));
+ QImage img = m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), QString(), m_render->frameRenderWidth() / 2, m_render->renderHeight() / 2);
+ m_frameImage->setPixmap(QPixmap::fromImage(img.scaled(r.width() / 2, r.height() / 2)));
}
}
// item->setTextCursor(cur);
cur.clearSelection();
item->setTextCursor(cur);
+ item->setDefaultTextColor(color);
}
}
KFileDialog *fs = new KFileDialog(KUrl(m_projectTitlePath), "application/x-kdenlivetitle", this);
fs->setOperationMode(KFileDialog::Saving);
fs->setMode(KFile::File);
-#if KDE_IS_VERSION(4,2,0)
fs->setConfirmOverwrite(true);
-#endif
fs->setKeepLocation(true);
fs->exec();
url = fs->selectedUrl();
selectionChanged();
}
-QString TitleWidget::getTooltipWithShortcut(const QString text, QAction *button)
+QString TitleWidget::getTooltipWithShortcut(const QString &text, QAction *button)
{
return text + " <b>" + button->shortcut().toString() + "</b>";
}