rotoscoping: fix color, icons and control point activation

parent cfc84c0b
......@@ -259,6 +259,7 @@ void RotoWidget::slotAddKeyframe(int pos)
if (pos < 0)
m_keyframeWidget->addKeyframe();
slotUpdateDataPoints(m_monitor->effectRoto(), pos);
slotPositionChanged(pos, false);
}
void RotoWidget::slotRemoveKeyframe(int pos)
......
......@@ -19,11 +19,11 @@
#include "simplekeyframewidget.h"
#include "simpletimelinewidget.h"
#include "timecodedisplay.h"
#include "utils/KoIconUtils.h"
#include <QToolButton>
#include <QGridLayout>
#include <QIcon>
#include <klocalizedstring.h>
SimpleKeyframeWidget::SimpleKeyframeWidget(const Timecode &t, int duration, QWidget *parent) :
......@@ -38,17 +38,17 @@ SimpleKeyframeWidget::SimpleKeyframeWidget(const Timecode &t, int duration, QWid
m_buttonAddDelete = new QToolButton(this);
m_buttonAddDelete->setAutoRaise(true);
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
m_buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
m_buttonAddDelete->setToolTip(i18n("Add keyframe"));
m_buttonPrevious = new QToolButton(this);
m_buttonPrevious->setAutoRaise(true);
m_buttonPrevious->setIcon(QIcon::fromTheme(QStringLiteral("media-skip-backward")));
m_buttonPrevious->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-skip-backward")));
m_buttonPrevious->setToolTip(i18n("Go to previous keyframe"));
m_buttonNext = new QToolButton(this);
m_buttonNext->setAutoRaise(true);
m_buttonNext->setIcon(QIcon::fromTheme(QStringLiteral("media-skip-forward")));
m_buttonNext->setIcon(KoIconUtils::themedIcon(QStringLiteral("media-skip-forward")));
m_buttonNext->setToolTip(i18n("Go to next keyframe"));
m_time = new TimecodeDisplay(t, this);
......@@ -125,10 +125,10 @@ void SimpleKeyframeWidget::updateTimecodeFormat()
void SimpleKeyframeWidget::slotAtKeyframe(bool atKeyframe)
{
if (atKeyframe) {
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("edit-delete")));
m_buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-remove")));
m_buttonAddDelete->setToolTip(i18n("Delete keyframe"));
} else {
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("document-new")));
m_buttonAddDelete->setIcon(KoIconUtils::themedIcon(QStringLiteral("list-add")));
m_buttonAddDelete->setToolTip(i18n("Add keyframe"));
}
}
......
......@@ -42,9 +42,8 @@ SimpleTimelineWidget::SimpleTimelineWidget(QWidget* parent) :
setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
QPalette p = palette();
KColorScheme scheme(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
m_colSelected = scheme.decoration(KColorScheme::HoverColor).color();
m_colKeyframe = scheme.foreground(KColorScheme::LinkText).color();
m_colKeyframeBg = scheme.shade(KColorScheme::MidShade);
m_colSelected = palette().highlight().color();
m_colKeyframe = scheme.foreground(KColorScheme::NormalText).color();
}
void SimpleTimelineWidget::setKeyframes(const QList<int> &keyframes)
......@@ -269,9 +268,6 @@ void SimpleTimelineWidget::paintEvent(QPaintEvent* event)
m_scale = width() / (double)(m_duration);
p.translate(0, m_lineHeight);
p.setPen(m_colKeyframe);
p.setBrush(m_colKeyframeBg);
/*
* keyframes
*/
......@@ -280,14 +276,13 @@ void SimpleTimelineWidget::paintEvent(QPaintEvent* event)
foreach (const int &pos, m_keyframes) {
tmp = keyframe;
tmp.translate(pos * m_scale, 0);
if (pos == m_currentKeyframe || pos == m_hoverKeyframe)
if (pos == m_currentKeyframe || pos == m_hoverKeyframe) {
p.setBrush(m_colSelected);
} else {
p.setBrush(m_colKeyframe);
}
p.drawConvexPolygon(tmp);
p.drawLine(QLineF(0, -1, 0, 5).translated(pos * m_scale, 0));
if (pos == m_currentKeyframe || pos == m_hoverKeyframe)
p.setBrush(m_colKeyframeBg);
}
p.setPen(palette().dark().color());
......@@ -295,6 +290,7 @@ void SimpleTimelineWidget::paintEvent(QPaintEvent* event)
/*
* Time-"line"
*/
p.setPen(m_colKeyframe);
p.drawLine(0, 0, width(), 0);
/*
......@@ -302,7 +298,7 @@ void SimpleTimelineWidget::paintEvent(QPaintEvent* event)
*/
QPolygonF position = QPolygonF() << QPointF(0, 1) << QPointF(5, 6) << QPointF(-5, 6);
position.translate(m_position * m_scale, 0);
p.setBrush(palette().dark().color());
p.setBrush(m_colKeyframe);
p.drawConvexPolygon(position);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment