Commit c6cd033e authored by Sashmita Raghav's avatar Sashmita Raghav Committed by Jean-Baptiste Mardelle

Add color to title clips in the timeline

parent 076a94b9
......@@ -188,6 +188,9 @@ Rectangle {
if (clipStatus == ClipState.Disabled) {
return 'grey'
}
if (itemType == ProducerType.Text) {
return titleColor
}
if (itemType == ProducerType.Image) {
return imageColor
}
......
......@@ -235,6 +235,7 @@ Rectangle {
property int duration: timeline.duration
property color audioColor: timeline.audioColor
property color videoColor: timeline.videoColor
property color titleColor: timeline.titleColor
property color imageColor: timeline.imageColor
property color slideshowColor: timeline.slideshowColor
property color lockedColor: timeline.lockedColor
......
......@@ -2671,6 +2671,15 @@ QColor TimelineController::audioColor() const
return scheme.foreground(KColorScheme::PositiveText).color();
}
QColor TimelineController::titleColor() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup());
QColor base = scheme.foreground(KColorScheme::LinkText).color();
QColor high = scheme.foreground(KColorScheme::NegativeText).color();
QColor title = QColor(qBound(0, base.red() + (int)(high.red() - 128), 255), qBound(0, base.green() + (int)(high.green() - 128), 255), qBound(0, base.blue() + (int)(high.blue() - 128), 255), 255);
return title;
}
QColor TimelineController::imageColor() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup());
......
......@@ -72,6 +72,7 @@ class TimelineController : public QObject
Q_PROPERTY(bool autoScroll READ autoScroll NOTIFY autoScrollChanged)
Q_PROPERTY(QColor videoColor READ videoColor NOTIFY colorsChanged)
Q_PROPERTY(QColor audioColor READ audioColor NOTIFY colorsChanged)
Q_PROPERTY(QColor titleColor READ titleColor NOTIFY colorsChanged)
Q_PROPERTY(QColor imageColor READ imageColor NOTIFY colorsChanged)
Q_PROPERTY(QColor slideshowColor READ slideshowColor NOTIFY colorsChanged)
Q_PROPERTY(QColor targetColor READ targetColor NOTIFY colorsChanged)
......@@ -157,6 +158,7 @@ public:
Q_INVOKABLE int activeTrack() const { return m_activeTrack; }
Q_INVOKABLE QColor videoColor() const;
Q_INVOKABLE QColor audioColor() const;
Q_INVOKABLE QColor titleColor() const;
Q_INVOKABLE QColor imageColor() const;
Q_INVOKABLE QColor slideshowColor() const;
Q_INVOKABLE QColor targetColor() const;
......
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