cp ox16-action-kdenlive-zindex-top.png hi16-action-kdenlive-zindex-top.png
cp oxsc-action-kdenlive-zindex-top.svgz hisc-action-kdenlive-zindex-top.svgz
cp ox16-action-kdenlive-zindex-bottom.png hi16-action-kdenlive-zindex-bottom.png
-cp oxsc-action-kdenlive-zindex-bottom.svgz hisc-action-kdenlive-zindex-bottom.svgz
\ No newline at end of file
+cp oxsc-action-kdenlive-zindex-bottom.svgz hisc-action-kdenlive-zindex-bottom.svgz
+cp ox16-action-kdenlive-object-width.png hi16-action-kdenlive-object-width.png
+cp oxsc-action-kdenlive-object-width.svgz hisc-action-kdenlive-object-width.svgz
+cp ox16-action-kdenlive-object-height.png hi16-action-kdenlive-object-height.png
+cp oxsc-action-kdenlive-object-height.svgz hisc-action-kdenlive-object-height.svgz
QDomElement e = params.item(i).toElement();
//kDebug() << "/ / / /SENDING EFFECT PARAM: " << e.attribute("type") << ", NAME_ " << e.attribute("tag");
if (e.attribute("type") == "simplekeyframe") {
-
+
QStringList values = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
double factor = e.attribute("factor", "1").toDouble();
for (int j = 0; j < values.count(); j++) {
- QString pos = values.at(j).section(":", 0, 0);
+ QString pos = values.at(j).section(":", 0, 0);
double val = values.at(j).section(":", 1, 1).toDouble() / factor;
values[j] = pos + "=" + QString::number(val);
}
return;
} else if (m_operationMode == SPACER && move && m_selectionGroup) {
// spacer tool
- snappedPos = getSnapPointForPos(mappedXPos + m_spacerOffset);
+ snappedPos = getSnapPointForPos(mappedXPos + m_spacerOffset);
if (snappedPos < 0) snappedPos = 0;
// Make sure there is no collision
QList<QGraphicsItem *> children = m_selectionGroup->childItems();
selection.at(i)->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
}
}
- m_spacerOffset = m_selectionGroup->sceneBoundingRect().left() - (int)(mapToScene(m_clickEvent).x());
+ m_spacerOffset = m_selectionGroup->sceneBoundingRect().left() - (int)(mapToScene(m_clickEvent).x());
if (!offsetList.isEmpty()) {
qSort(offsetList);
QList <GenTime> cleandOffsetList;
if (verticalScale != matrix().m22()) adjust = true;
setMatrix(newmatrix);
if (adjust) {
- double newHeight = m_tracksHeight * m_document->tracksCount() * matrix().m22();
- m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), newHeight);
+ double newHeight = m_tracksHeight * m_document->tracksCount() * matrix().m22();
+ m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), newHeight);
for (int i = 0; i < m_guides.count(); i++) {
- QLineF l = m_guides.at(i)->line();
- l.setP2(QPointF(l.x2(), newHeight));
- m_guides.at(i)->setLine(l);
+ QLineF l = m_guides.at(i)->line();
+ l.setP2(QPointF(l.x2(), newHeight));
+ m_guides.at(i)->setLine(l);
}
setSceneRect(0, 0, sceneRect().width(), m_tracksHeight * m_document->tracksCount());
}
-
+
int diff = sceneRect().width() - m_projectDuration;
if (diff * newmatrix.m11() < 50) {
if (newmatrix.m11() < 0.4) setSceneRect(0, 0, (m_projectDuration + 100 / newmatrix.m11()), sceneRect().height());
keyframe_list->insertRow(newrow);
keyframe_list->setVerticalHeaderItem(newrow, new QTableWidgetItem(m_timecode.getTimecodeFromFrames(result)));
for (int i = 0; i < keyframe_list->columnCount(); i++) {
- keyframe_list->setItem(newrow, i, new QTableWidgetItem(keyframe_list->item(item->row(), i)->text()));
+ keyframe_list->setItem(newrow, i, new QTableWidgetItem(keyframe_list->item(item->row(), i)->text()));
}
//keyframe_list->resizeRowToContents(newrow);
slotAdjustKeyframeInfo();
void KeyframeEdit::generateAllParams()
{
for (int col = 0; col < keyframe_list->columnCount(); col++) {
- QString keyframes;
- for (int i = 0; i < keyframe_list->rowCount(); i++) {
- if (keyframe_list->item(i, col)) keyframes.append(QString::number(m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text())) + ':' + keyframe_list->item(i, col)->text() + ';');
- }
- m_params[col].setAttribute("keyframes", keyframes);
+ QString keyframes;
+ for (int i = 0; i < keyframe_list->rowCount(); i++) {
+ if (keyframe_list->item(i, col)) keyframes.append(QString::number(m_timecode.getFrameCount(keyframe_list->verticalHeaderItem(i)->text())) + ':' + keyframe_list->item(i, col)->text() + ';');
+ }
+ m_params[col].setAttribute("keyframes", keyframes);
}
emit parameterChanged();
}
if (item->data(1, Qt::UserRole + 2).toInt() == WAITINGJOB) {
item->setData(1, Qt::UserRole + 1, QTime::currentTime());
waitingJob = true;
- startRendering(item);
+ startRendering(item);
break;
}
item = m_view.running_jobs->itemBelow(item);
void RenderWidget::startRendering(QTreeWidgetItem *item)
{
if (item->data(1, Qt::UserRole + 4).isNull()) {
- // Normal render process
- if (QProcess::startDetached(m_renderer, item->data(1, Qt::UserRole + 3).toStringList()) == false) {
- item->setData(1, Qt::UserRole + 2, FINISHEDJOB);
- item->setData(1, Qt::UserRole, i18n("Rendering crashed"));
- item->setIcon(0, KIcon("dialog-close"));
- item->setData(2, Qt::UserRole, 100);
+ // Normal render process
+ if (QProcess::startDetached(m_renderer, item->data(1, Qt::UserRole + 3).toStringList()) == false) {
+ item->setData(1, Qt::UserRole + 2, FINISHEDJOB);
+ item->setData(1, Qt::UserRole, i18n("Rendering crashed"));
+ item->setIcon(0, KIcon("dialog-close"));
+ item->setData(2, Qt::UserRole, 100);
} else KNotification::event("RenderStarted", i18n("Rendering <i>%1</i> started", item->text(1)), QPixmap(), this);
} else {
- // Script item
+ // Script item
if (QProcess::startDetached(item->data(1, Qt::UserRole + 3).toString()) == false) {
- item->setData(1, Qt::UserRole + 2, FINISHEDJOB);
+ item->setData(1, Qt::UserRole + 2, FINISHEDJOB);
item->setData(1, Qt::UserRole, i18n("Rendering crashed"));
item->setIcon(0, KIcon("dialog-close"));
item->setData(2, Qt::UserRole, 100);
{
QTreeWidgetItem *current = m_view.running_jobs->currentItem();
if (current && current->data(1, Qt::UserRole + 2).toInt() == WAITINGJOB)
- startRendering(current);
+ startRendering(current);
m_view.start_job->setEnabled(false);
}
if (current) {
if (current->data(1, Qt::UserRole + 2).toInt() == RUNNINGJOB) {
m_view.abort_job->setText(i18n("Abort Job"));
- m_view.start_job->setEnabled(false);
- }
- else {
- m_view.abort_job->setText(i18n("Remove Job"));
- m_view.start_job->setEnabled(current->data(1, Qt::UserRole + 2).toInt() == WAITINGJOB);
- }
+ m_view.start_job->setEnabled(false);
+ } else {
+ m_view.abort_job->setText(i18n("Remove Job"));
+ m_view.start_job->setEnabled(current->data(1, Qt::UserRole + 2).toInt() == WAITINGJOB);
+ }
activate = true;
}
m_view.abort_job->setEnabled(activate);
m_unicodeAction->setToolTip(i18n("Insert Unicode character") + ' ' + m_unicodeAction->shortcut().toString());
connect(m_unicodeAction, SIGNAL(triggered()), this, SLOT(slotInsertUnicode()));
buttonInsertUnicode->setDefaultAction(m_unicodeAction);
-
+
m_zUp = new QAction(KIcon("kdenlive-zindex-up"), QString(), this);
m_zUp->setShortcut(Qt::Key_PageUp);
m_zUp->setToolTip(i18n("Raise object"));
connect(m_zUp, SIGNAL(triggered()), this, SLOT(slotZIndexUp()));
zUp->setDefaultAction(m_zUp);
-
+
m_zDown = new QAction(KIcon("kdenlive-zindex-down"), QString(), this);
m_zDown->setShortcut(Qt::Key_PageDown);
m_zDown->setToolTip(i18n("Lower object"));
connect(m_zDown, SIGNAL(triggered()), this, SLOT(slotZIndexDown()));
zDown->setDefaultAction(m_zDown);
-
+
m_zTop = new QAction(KIcon("kdenlive-zindex-top"), QString(), this);
m_zTop->setShortcut(Qt::Key_Home);
m_zTop->setToolTip(i18n("Raise object to top"));
connect(m_zTop, SIGNAL(triggered()), this, SLOT(slotZIndexTop()));
zTop->setDefaultAction(m_zTop);
-
+
m_zBottom = new QAction(KIcon("kdenlive-zindex-bottom"), QString(), this);
m_zBottom->setShortcut(Qt::Key_End);
m_zBottom->setToolTip(i18n("Lower object to bottom"));
connect(m_zBottom, SIGNAL(triggered()), this, SLOT(slotZIndexBottom()));
zBottom->setDefaultAction(m_zBottom);
-
+
zDown->setIcon(KIcon("kdenlive-zindex-down"));
zTop->setIcon(KIcon("kdenlive-zindex-top"));
zBottom->setIcon(KIcon("kdenlive-zindex-bottom"));
effect_stack->setHidden(true);
}
#else
- effect_list->blockSignals(true);
+ effect_list->blockSignals(true);
effect_list->setCurrentIndex(effect_list->findData((int) NOEFFECT));
effect_list->blockSignals(false);
effect_stack->setHidden(true);
value_h->blockSignals(true);
zValue->blockSignals(true);
- zValue->setValue((int) i->zValue());
+ zValue->setValue((int) i->zValue());
if (i->type() == IMAGEITEM) {
// Get multipliers for rotation/scaling
value_h->setValue((int) t->boundingRect().height());
}
- zValue->blockSignals(false);
+ zValue->blockSignals(false);
value_w->blockSignals(false);
value_h->blockSignals(false);
}
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
int effect = effect_list->itemData(ix).toInt();
if (effect == NOEFFECT) {
- if (l.size() == 1) l[0]->setData(100, QVariant());
+ if (l.size() == 1) l[0]->setData(100, QVariant());
effect_stack->setHidden(true);
return;
}
qreal TitleWidget::zIndexBounds(bool maxBound)
{
- qreal bound = maxBound? -99 : 99;
- QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
- if (l.size() > 0) {
- QList<QGraphicsItem*> lItems = graphicsView->scene()->items(l[0]->sceneBoundingRect(), Qt::IntersectsItemShape);
- if (lItems.size() > 0) {
- int n = lItems.size();
- qreal z;
- if (maxBound) {
- for (int i = 0; i < n; i++) {
- z = lItems[i]->zValue();
- if (z > bound && !lItems[i]->isSelected()) {
- bound = z;
- }
- }
- } else {
- // Get minimum z index.
- for (int i = 0; i < n; i++) {
- z = lItems[i]->zValue();
- if (z < bound && !lItems[i]->isSelected() && z > -999) {
- // There are items at the very bottom (background e.g.) with z-index < -1000.
- bound = z;
- }
- }
- }
- }
- }
- return bound;
-}
-
-void TitleWidget::slotZIndexUp()
+ qreal bound = maxBound ? -99 : 99;
+ QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
+ if (l.size() > 0) {
+ QList<QGraphicsItem*> lItems = graphicsView->scene()->items(l[0]->sceneBoundingRect(), Qt::IntersectsItemShape);
+ if (lItems.size() > 0) {
+ int n = lItems.size();
+ qreal z;
+ if (maxBound) {
+ for (int i = 0; i < n; i++) {
+ z = lItems[i]->zValue();
+ if (z > bound && !lItems[i]->isSelected()) {
+ bound = z;
+ }
+ }
+ } else {
+ // Get minimum z index.
+ for (int i = 0; i < n; i++) {
+ z = lItems[i]->zValue();
+ if (z < bound && !lItems[i]->isSelected() && z > -999) {
+ // There are items at the very bottom (background e.g.) with z-index < -1000.
+ bound = z;
+ }
+ }
+ }
+ }
+ }
+ return bound;
+}
+
+void TitleWidget::slotZIndexUp()
{
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
if (l.size() >= 1) {
- qreal currentZ = l[0]->zValue();
- qreal max = zIndexBounds(true);
- if (currentZ <= max) {
- l[0]->setZValue(currentZ+1);
- updateDimension(l[0]);
- }
+ qreal currentZ = l[0]->zValue();
+ qreal max = zIndexBounds(true);
+ if (currentZ <= max) {
+ l[0]->setZValue(currentZ + 1);
+ updateDimension(l[0]);
+ }
}
}
-void TitleWidget::slotZIndexTop()
+void TitleWidget::slotZIndexTop()
{
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
if (l.size() >= 1) {
- qreal currentZ = l[0]->zValue();
- qreal max = zIndexBounds(true);
- if (currentZ <= max) {
- l[0]->setZValue(max+1);
- updateDimension(l[0]);
- }
+ qreal currentZ = l[0]->zValue();
+ qreal max = zIndexBounds(true);
+ if (currentZ <= max) {
+ l[0]->setZValue(max + 1);
+ updateDimension(l[0]);
+ }
}
}
-void TitleWidget::slotZIndexDown()
+void TitleWidget::slotZIndexDown()
{
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
if (l.size() >= 1) {
- qreal currentZ = l[0]->zValue();
- qreal min = zIndexBounds(false);
- if (currentZ >= min) {
- l[0]->setZValue(currentZ-1);
- updateDimension(l[0]);
- }
+ qreal currentZ = l[0]->zValue();
+ qreal min = zIndexBounds(false);
+ if (currentZ >= min) {
+ l[0]->setZValue(currentZ - 1);
+ updateDimension(l[0]);
+ }
}
}
-void TitleWidget::slotZIndexBottom()
+void TitleWidget::slotZIndexBottom()
{
QList<QGraphicsItem*> l = graphicsView->scene()->selectedItems();
if (l.size() >= 1) {
- qreal currentZ = l[0]->zValue();
- qreal min = zIndexBounds(false);
- if (currentZ >= min) {
- l[0]->setZValue(min-1);
- updateDimension(l[0]);
- }
+ qreal currentZ = l[0]->zValue();
+ qreal min = zIndexBounds(false);
+ if (currentZ >= min) {
+ l[0]->setZValue(min - 1);
+ updateDimension(l[0]);
+ }
}
}
void updateInfoText();
/** \brief Remove the "start" and "end" info text from animation viewports */
void deleteAnimInfoText();
-
+
qreal maxZIndex();
qreal zIndexBounds(bool maxBound);
void slotEditBlur(int ix);
void slotEditShadow();
void slotEditTypewriter(int ix);
-
+
/** \brief Changes the z index of objects. */
void slotZIndexUp();
void slotZIndexDown();
</widget>
</item>
<item>
- <widget class="QLabel" name="label_18">
+ <widget class="QLabel" name="lWidth">
<property name="text">
<string>W</string>
</property>
</property>
</widget>
</item>
+ <item>
+ <widget class="QToolButton" name="zUp">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="zDown">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="zTop">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="zBottom">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
<item>
<widget class="QLabel" name="label_12">
<property name="text">
</item>
</layout>
</item>
- <item row="0" column="1">
- <widget class="QToolButton" name="zUp">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QToolButton" name="zDown">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="3">
- <widget class="QToolButton" name="zTop">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="0" column="4">
- <widget class="QToolButton" name="zBottom">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
</layout>
</widget>
</item>