"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/widgets/textproducerwidget.cpp" between
shotcut-20.09.01.tar.gz and shotcut-20.09.13.tar.gz

About: Shotcut is a cross-platform (Qt) advanced video editor.

textproducerwidget.cpp  (shotcut-20.09.01):textproducerwidget.cpp  (shotcut-20.09.13)
skipping to change at line 64 skipping to change at line 64
ui->preset->loadPresets(); ui->preset->loadPresets();
} }
TextProducerWidget::~TextProducerWidget() TextProducerWidget::~TextProducerWidget()
{ {
delete ui; delete ui;
} }
void TextProducerWidget::on_colorButton_clicked() void TextProducerWidget::on_colorButton_clicked()
{ {
if (!m_producer) { QColor color = colorStringToResource(ui->colorLabel->text());
return; if (m_producer) {
color = QColor(QFileInfo(m_producer->get("resource")).baseName());
} }
QColor color(QFileInfo(m_producer->get("resource")).baseName());
QColorDialog dialog(color); QColorDialog dialog(color);
dialog.setOption(QColorDialog::ShowAlphaChannel); dialog.setOption(QColorDialog::ShowAlphaChannel);
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {
auto newColor = dialog.currentColor(); auto newColor = dialog.currentColor();
if (newColor.alpha() == 0 && newColor != color) { if (newColor.alpha() == 0 && newColor != color) {
newColor.setAlpha(255); newColor.setAlpha(255);
} }
ui->colorLabel->setText(colorToString(dialog.currentColor())); ui->colorLabel->setText(colorToString(dialog.currentColor()));
ui->colorLabel->setStyleSheet(QString("color: %1; background-color: %2") ui->colorLabel->setStyleSheet(QString("color: %1; background-color: %2")
.arg((dialog.currentColor().value() < 150) ? "white":"black") .arg((dialog.currentColor().value() < 150) ? "white":"black")
.arg(dialog.currentColor().name())); .arg(dialog.currentColor().name()));
m_producer->set("resource", colorStringToResource(ui->colorLabel->text() if (m_producer) {
).toLatin1().constData()); m_producer->set("resource", colorStringToResource(ui->colorLabel->te
m_producer->set(kShotcutCaptionProperty, ui->colorLabel->text().toLatin1 xt()).toLatin1().constData());
().constData()); m_producer->set(kShotcutCaptionProperty, ui->colorLabel->text().toLa
m_producer->set(kShotcutDetailProperty, ui->colorLabel->text().toLatin1( tin1().constData());
).constData()); m_producer->set(kShotcutDetailProperty, ui->colorLabel->text().toLat
emit producerChanged(m_producer.data()); in1().constData());
emit producerChanged(m_producer.data());
}
} }
} }
Mlt::Producer* TextProducerWidget::newProducer(Mlt::Profile& profile) Mlt::Producer* TextProducerWidget::newProducer(Mlt::Profile& profile)
{ {
Mlt::Producer* p = new Mlt::Producer(profile, "color:"); Mlt::Producer* p = new Mlt::Producer(profile, "color:");
p->set("resource", colorStringToResource(ui->colorLabel->text()).toLatin1(). constData()); p->set("resource", colorStringToResource(ui->colorLabel->text()).toLatin1(). constData());
p->set("mlt_image_format", "rgb24a"); p->set("mlt_image_format", "rgb24a");
MLT.setDurationFromDefault(p); MLT.setDurationFromDefault(p);
p->set(kShotcutCaptionProperty, ui->colorLabel->text().toLatin1().constData( )); p->set(kShotcutCaptionProperty, ui->colorLabel->text().toLatin1().constData( ));
 End of changes. 3 change blocks. 
10 lines changed or deleted 12 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)