Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 63e863d7 authored by Vincent Pinon's avatar Vincent Pinon

Adapt again contrast selected/deselected, video/audio/background

parent d23e670a
Pipeline #1879 passed with stage
in 20 minutes and 9 seconds
......@@ -92,7 +92,7 @@ Rectangle {
onClipResourceChanged: {
if (itemType == ProducerType.Color) {
color: Qt.darker(getColor())
color: getColor()
}
}
ToolTip {
......@@ -408,7 +408,7 @@ Rectangle {
when: isLocked
PropertyChanges {
target: clipRoot
color: root.neutralColor
color: root.lockedColor
opacity: 0.8
z: 0
}
......@@ -418,7 +418,7 @@ Rectangle {
when: clipRoot.selected === false
PropertyChanges {
target: clipRoot
color: getColor().hsvValue < 0.45 ? Qt.lighter(getColor(), 2) : Qt.darker(getColor(), 2)
color: Qt.darker(getColor(), 1.5)
z: 0
}
},
......@@ -427,7 +427,7 @@ Rectangle {
when: clipRoot.selected === true
PropertyChanges {
target: clipRoot
color: getColor().hsvValue < 0.45 ? Qt.lighter(getColor(), 3) : Qt.darker(getColor(), 3)
color: getColor()
z: 3
}
}
......
......@@ -184,7 +184,7 @@ Rectangle {
property int duration: timeline.duration
property color audioColor: timeline.audioColor
property color videoColor: timeline.videoColor
property color neutralColor: timeline.neutralColor
property color lockedColor: timeline.lockedColor
property color groupColor: timeline.groupColor
property int clipBeingDroppedId: -1
property string clipBeingDroppedData
......
......@@ -2118,28 +2118,35 @@ void TimelineController::updateEffectKeyframe(int cid, int oldFrame, int newFram
}
}
bool TimelineController::darkBackground() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup());
return scheme.background(KColorScheme::NormalBackground).color().value() < 0.5;
}
QColor TimelineController::videoColor() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::View);
return scheme.background(KColorScheme::LinkBackground).color().darker();
KColorScheme scheme(QApplication::palette().currentColorGroup());
return scheme.foreground(KColorScheme::LinkText).color();
}
QColor TimelineController::audioColor() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::View);
return scheme.background(KColorScheme::NegativeBackground).color();
KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::Complementary);
return scheme.foreground(KColorScheme::ActiveText).color();
}
QColor TimelineController::neutralColor() const
QColor TimelineController::lockedColor() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::View);
return scheme.background(KColorScheme::VisitedBackground).color();
KColorScheme scheme(QApplication::palette().currentColorGroup());
return scheme.foreground(KColorScheme::NegativeText).color();
}
QColor TimelineController::groupColor() const
{
KColorScheme scheme(QApplication::palette().currentColorGroup(), KColorScheme::Complementary);
return scheme.background(KColorScheme::NegativeBackground).color();
KColorScheme scheme(QApplication::palette().currentColorGroup());
return scheme.foreground(KColorScheme::LinkText).color();
//.lighter(darkBackground() ? 160 : 60);
}
void TimelineController::switchRecording(int trackId)
......
......@@ -69,7 +69,7 @@ class TimelineController : public QObject
Q_PROPERTY(int videoTarget READ videoTarget WRITE setVideoTarget NOTIFY videoTargetChanged)
Q_PROPERTY(QColor videoColor READ videoColor NOTIFY colorsChanged)
Q_PROPERTY(QColor audioColor READ audioColor NOTIFY colorsChanged)
Q_PROPERTY(QColor neutralColor READ neutralColor NOTIFY colorsChanged)
Q_PROPERTY(QColor lockedColor READ lockedColor NOTIFY colorsChanged)
Q_PROPERTY(QColor groupColor READ groupColor NOTIFY colorsChanged)
public:
......@@ -136,7 +136,7 @@ public:
Q_INVOKABLE int activeTrack() const { return m_activeTrack; }
Q_INVOKABLE QColor videoColor() const;
Q_INVOKABLE QColor audioColor() const;
Q_INVOKABLE QColor neutralColor() const;
Q_INVOKABLE QColor lockedColor() const;
Q_INVOKABLE QColor groupColor() const;
/* @brief Request a seek operation
@param position is the desired new timeline position
......@@ -467,6 +467,7 @@ private:
int getCurrentItem();
void initializePreview();
bool darkBackground() const;
signals:
void selected(Mlt::Producer *producer);
......
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