From: Simon A. Eugster Date: Tue, 1 Dec 2009 15:44:26 +0000 (+0000) Subject: Position of z-index number field changed X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=82812d2bbe0841ad5534677c55b7fa84dbd890c0;p=kdenlive Position of z-index number field changed reindent.sh ;) svn path=/trunk/kdenlive/; revision=4166 --- diff --git a/icons/cp-oxicons-hisc.sh b/icons/cp-oxicons-hisc.sh index 7ef1990f..74662ea0 100755 --- a/icons/cp-oxicons-hisc.sh +++ b/icons/cp-oxicons-hisc.sh @@ -6,4 +6,8 @@ cp oxsc-action-kdenlive-zindex-down.svgz hisc-action-kdenlive-zindex-down.svgz 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 diff --git a/icons/hi16-action-kdenlive-object-height.png b/icons/hi16-action-kdenlive-object-height.png new file mode 100644 index 00000000..180c6441 Binary files /dev/null and b/icons/hi16-action-kdenlive-object-height.png differ diff --git a/icons/hi16-action-kdenlive-object-width.png b/icons/hi16-action-kdenlive-object-width.png new file mode 100644 index 00000000..dd9668ff Binary files /dev/null and b/icons/hi16-action-kdenlive-object-width.png differ diff --git a/icons/hisc-action-kdenlive-object-height.svgz b/icons/hisc-action-kdenlive-object-height.svgz new file mode 100644 index 00000000..074ea3ca Binary files /dev/null and b/icons/hisc-action-kdenlive-object-height.svgz differ diff --git a/icons/hisc-action-kdenlive-object-width.svgz b/icons/hisc-action-kdenlive-object-width.svgz new file mode 100644 index 00000000..90a20cdb Binary files /dev/null and b/icons/hisc-action-kdenlive-object-width.svgz differ diff --git a/icons/ox16-action-kdenlive-object-height.png b/icons/ox16-action-kdenlive-object-height.png new file mode 100644 index 00000000..180c6441 Binary files /dev/null and b/icons/ox16-action-kdenlive-object-height.png differ diff --git a/icons/ox16-action-kdenlive-object-width.png b/icons/ox16-action-kdenlive-object-width.png new file mode 100644 index 00000000..dd9668ff Binary files /dev/null and b/icons/ox16-action-kdenlive-object-width.png differ diff --git a/icons/oxsc-action-kdenlive-object-height.svgz b/icons/oxsc-action-kdenlive-object-height.svgz new file mode 100644 index 00000000..074ea3ca Binary files /dev/null and b/icons/oxsc-action-kdenlive-object-height.svgz differ diff --git a/icons/oxsc-action-kdenlive-object-width.svgz b/icons/oxsc-action-kdenlive-object-width.svgz new file mode 100644 index 00000000..90a20cdb Binary files /dev/null and b/icons/oxsc-action-kdenlive-object-width.svgz differ diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 2fc109c8..f14d1639 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -1426,11 +1426,11 @@ EffectsParameterList ClipItem::getEffectArgs(const QDomElement effect) 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); } diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index e9856fdf..f6da0f71 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -405,7 +405,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) 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 children = m_selectionGroup->childItems(); @@ -869,7 +869,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) 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 cleandOffsetList; @@ -4456,16 +4456,16 @@ void CustomTrackView::setScale(double scaleFactor, double verticalScale) 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()); diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index 3ed920b0..e4f152ac 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -171,7 +171,7 @@ void KeyframeEdit::slotAddKeyframe() 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(); @@ -220,11 +220,11 @@ void KeyframeEdit::slotGenerateParams(int row, int column) 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(); } diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index d815d1c2..100af343 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -840,7 +840,7 @@ void RenderWidget::checkRenderStatus() 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); @@ -851,17 +851,17 @@ void RenderWidget::checkRenderStatus() 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 %1 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); @@ -1461,7 +1461,7 @@ void RenderWidget::slotStartCurrentJob() { 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); } @@ -1472,12 +1472,11 @@ void RenderWidget::slotCheckJob() 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); diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index 931b5d8f..a9560b75 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -187,31 +187,31 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render 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")); @@ -771,7 +771,7 @@ void TitleWidget::selectionChanged() 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); @@ -966,7 +966,7 @@ void TitleWidget::updateDimension(QGraphicsItem *i) 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 @@ -989,7 +989,7 @@ void TitleWidget::updateDimension(QGraphicsItem *i) value_h->setValue((int) t->boundingRect().height()); } - zValue->blockSignals(false); + zValue->blockSignals(false); value_w->blockSignals(false); value_h->blockSignals(false); } @@ -1841,7 +1841,7 @@ void TitleWidget::slotAddEffect(int ix) QList 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; } @@ -1927,83 +1927,83 @@ void TitleWidget::slotEditShadow() qreal TitleWidget::zIndexBounds(bool maxBound) { - qreal bound = maxBound? -99 : 99; - QList l = graphicsView->scene()->selectedItems(); - if (l.size() > 0) { - QList 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 l = graphicsView->scene()->selectedItems(); + if (l.size() > 0) { + QList 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 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 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 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 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]); + } } } diff --git a/src/titlewidget.h b/src/titlewidget.h index cfafd897..c7708a3b 100644 --- a/src/titlewidget.h +++ b/src/titlewidget.h @@ -160,7 +160,7 @@ private: void updateInfoText(); /** \brief Remove the "start" and "end" info text from animation viewports */ void deleteAnimInfoText(); - + qreal maxZIndex(); qreal zIndexBounds(bool maxBound); @@ -267,7 +267,7 @@ private slots: void slotEditBlur(int ix); void slotEditShadow(); void slotEditTypewriter(int ix); - + /** \brief Changes the z index of objects. */ void slotZIndexUp(); void slotZIndexDown(); diff --git a/src/widgets/titlewidget_ui.ui b/src/widgets/titlewidget_ui.ui index 440d3fee..5b43801e 100644 --- a/src/widgets/titlewidget_ui.ui +++ b/src/widgets/titlewidget_ui.ui @@ -103,7 +103,7 @@ - + W @@ -136,6 +136,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -155,34 +183,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -