#include <KUrl>
#include <KIcon>
#include <KCursor>
-#include <KColorScheme>
#include <KMessageBox>
#include <KIO/NetAccess>
setLineWidth(0);
//setCacheMode(QGraphicsView::CacheBackground);
//setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
+ setAutoFillBackground(false);
setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
-
+ m_activeTrackBrush = KStatefulBrush(KColorScheme::View, KColorScheme::ActiveBackground, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
pixmapCache = new KPixmapCache("kdenlive-thumbs");
KdenliveSettings::setTrackheight(m_tracksHeight);
m_animationTimer = new QTimeLine(800);
}
}
double newHeight = m_tracksHeight * m_document->tracksCount() * matrix().m22();
- m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), newHeight);
+ m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), newHeight - 1);
for (int i = 0; i < m_guides.count(); i++) {
QLineF l = m_guides.at(i)->line();
return;
}
QDomElement effect = insertedEffect.cloneNode().toElement();
- kDebug() << "// update effect ix: " << effect.attribute("kdenlive_ix");
+ //kDebug() << "// update effect ix: " << effect.attribute("kdenlive_ix")<<", TRACK: "<<track;
if (pos < GenTime()) {
// editing a track effect
EffectsParameterList effectParams = getEffectArgs(effect);
if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - track, pos, effectParams))
emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
m_document->setTrackEffect(m_document->tracksCount() - track - 1, ix, effect);
- emit updateTrackEffectState(track - 1);
+ emit updateTrackEffectState(track);
setDocumentModified();
return;
l.setP2(QPointF(l.x2(), maxHeight));
m_guides.at(i)->setLine(l);
}
- m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), maxHeight);
+
+ m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), maxHeight - 1);
setSceneRect(0, 0, sceneRect().width(), m_tracksHeight * m_document->tracksCount());
viewport()->update();
emit tracksChanged();
l.setP2(QPointF(l.x2(), maxHeight));
m_guides.at(i)->setLine(l);
}
- m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), maxHeight);
+ m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), maxHeight - 1);
setSceneRect(0, 0, sceneRect().width(), m_tracksHeight * m_document->tracksCount());
m_selectedTrack = qMin(m_selectedTrack, m_document->tracksCount() - 1);
if (item->type() == AVWIDGET) {
ItemInfo resizeinfo = info;
resizeinfo.track = m_document->tracksCount() - resizeinfo.track;
- bool success = m_document->renderer()->mltResizeClipEnd(resizeinfo, resizeinfo.endPos - resizeinfo.startPos);
+ bool success = m_document->renderer()->mltResizeClipEnd(resizeinfo, resizeinfo.cropDuration);
if (success) {
// Check if there is an automatic transition on that clip (lower track)
Transition *tr = getTransitionItemAtEnd(oldInfo.endPos, oldInfo.track);
}
}
+ // add render zone
+ QPoint z = m_document->zone();
+ snaps.append(GenTime(z.x(), m_document->fps()));
+ snaps.append(GenTime(z.y(), m_document->fps()));
+
qSort(snaps);
m_scene->setSnapList(snaps);
//for (int i = 0; i < m_snapPoints.size(); ++i)
newmatrix = newmatrix.scale(scaleFactor, verticalScale);
m_scene->setScale(scaleFactor, verticalScale);
removeTipAnimation();
- double verticalPos = mapToScene(QPoint(0, viewport()->height() / 2)).y();
bool adjust = false;
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);
+ m_cursorLine->setLine(m_cursorLine->line().x1(), 0, m_cursorLine->line().x1(), newHeight - 1);
for (int i = 0; i < m_guides.count(); i++) {
QLineF l = m_guides.at(i)->line();
l.setP2(QPointF(l.x2(), newHeight));
else
setSceneRect(0, 0, (m_projectDuration + 300), sceneRect().height());
}
+ double verticalPos = mapToScene(QPoint(0, viewport()->height() / 2)).y();
centerOn(QPointF(cursorPos(), verticalPos));
}
void CustomTrackView::drawBackground(QPainter * painter, const QRectF &rect)
{
- //kDebug() << "// DRAW BG: " << rect.width();
painter->setClipRect(rect);
- KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window);
QPen pen1 = painter->pen();
- pen1.setColor(scheme.shade(KColorScheme::DarkShade));
+ pen1.setColor(palette().dark().color());
painter->setPen(pen1);
double min = rect.left();
double max = rect.right();
painter->drawLine(QPointF(min, 0), QPointF(max, 0));
int maxTrack = m_document->tracksCount();
- QColor lockedColor = scheme.background(KColorScheme::NegativeBackground).color();
+ QColor lockedColor = palette().button().color();
QColor audioColor = palette().alternateBase().color();
- QColor base = scheme.background(KColorScheme::NormalBackground).color();
for (int i = 0; i < maxTrack; i++) {
TrackInfo info = m_document->trackInfoAt(maxTrack - i - 1);
if (info.isLocked || info.type == AUDIOTRACK || i == m_selectedTrack) {
const QRectF track(min, m_tracksHeight * i + 1, max - min, m_tracksHeight - 1);
if (i == m_selectedTrack)
- painter->fillRect(track, scheme.background(KColorScheme::ActiveBackground).color());
+ painter->fillRect(track, m_activeTrackBrush.brush(this));
else
painter->fillRect(track, info.isLocked ? lockedColor : audioColor);
}
painter->drawLine(QPointF(min, m_tracksHeight *(i + 1)), QPointF(max, m_tracksHeight *(i + 1)));
}
- int lowerLimit = m_tracksHeight * maxTrack + 1;
- if (height() > lowerLimit) {
- const QRectF bg(min, lowerLimit, max - min, height() - lowerLimit);
- painter->fillRect(bg, base);
- }
}
bool CustomTrackView::findString(const QString &text)
void CustomTrackView::updatePalette()
{
+ m_activeTrackBrush = KStatefulBrush(KColorScheme::View, KColorScheme::ActiveBackground, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
if (m_cursorLine) {
QPen pen1 = QPen();
pen1.setWidth(1);
pen1.setColor(palette().text().color());
m_cursorLine->setPen(pen1);
}
+ emit tracksChanged();
}
void CustomTrackView::removeTipAnimation()
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);
- double val = values.at(j).section(":", 1, 1).toDouble() / factor;
+ QString pos = values.at(j).section(':', 0, 0);
+ double val = values.at(j).section(':', 1, 1).toDouble() / factor;
values[j] = pos + "=" + QString::number(val);
}
// kDebug() << "/ / / /SENDING KEYFR:" << values;