"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/widgets/colorproducerwidget.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.

colorproducerwidget.cpp  (shotcut-20.09.01):colorproducerwidget.cpp  (shotcut-20.09.13)
skipping to change at line 63 skipping to change at line 63
ui->preset->loadPresets(); ui->preset->loadPresets();
} }
ColorProducerWidget::~ColorProducerWidget() ColorProducerWidget::~ColorProducerWidget()
{ {
delete ui; delete ui;
} }
void ColorProducerWidget::on_colorButton_clicked() void ColorProducerWidget::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(newColor)); ui->colorLabel->setText(colorToString(newColor));
ui->colorLabel->setStyleSheet(QString("color: %1; background-color: %2") ui->colorLabel->setStyleSheet(QString("color: %1; background-color: %2")
.arg((newColor.value() < 150)? "white":"bl ack") .arg((newColor.value() < 150)? "white":"bl ack")
.arg(newColor.name())); .arg(newColor.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* ColorProducerWidget::newProducer(Mlt::Profile& profile) Mlt::Producer* ColorProducerWidget::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);
if (ui->lineEdit->text().isEmpty() || ui->lineEdit->text() == m_title) { if (ui->lineEdit->text().isEmpty() || ui->lineEdit->text() == m_title) {
 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)