Commit b2635a9b authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Monitor overlay: use guide category as background color, ensure guide at...

Monitor overlay: use guide category as background color, ensure guide at timeline position appears above others
Related to #990
parent d21f2e46
......@@ -1247,6 +1247,7 @@ void Monitor::checkOverlay(int pos)
return;
}
QString overlayText;
QColor color;
if (pos == -1) {
pos = m_timePos->getValue();
}
......@@ -1264,9 +1265,10 @@ void Monitor::checkOverlay(int pos)
CommentedTime marker = model->getMarker(GenTime(pos, pCore->getCurrentFps()), &found);
if (found) {
overlayText = marker.comment();
color = model->markerTypes.at(marker.markerType());
}
}
m_glMonitor->getControllerProxy()->setMarkerComment(overlayText);
m_glMonitor->getControllerProxy()->setMarker(overlayText, color);
}
int Monitor::getZoneStart()
......
......@@ -85,11 +85,6 @@ void MonitorProxy::setOverlayType(int ix)
}
}
QString MonitorProxy::markerComment() const
{
return m_markerComment;
}
bool MonitorProxy::setPosition(int pos)
{
if (m_position == pos) {
......@@ -122,13 +117,14 @@ void MonitorProxy::positionFromConsumer(int pos, bool playing)
}
}
void MonitorProxy::setMarkerComment(const QString &comment)
void MonitorProxy::setMarker(const QString &comment, const QColor &color)
{
if (m_markerComment == comment) {
return;
}
m_markerComment = comment;
emit markerCommentChanged();
m_markerColor = color;
emit markerChanged();
}
int MonitorProxy::zoneIn() const
......
......@@ -44,7 +44,8 @@ class MonitorProxy : public QObject
Q_PROPERTY(int zoneIn READ zoneIn WRITE setZoneIn NOTIFY zoneChanged)
Q_PROPERTY(int zoneOut READ zoneOut WRITE setZoneOut NOTIFY zoneChanged)
Q_PROPERTY(int rulerHeight READ rulerHeight WRITE setRulerHeight NOTIFY rulerHeightChanged)
Q_PROPERTY(QString markerComment READ markerComment NOTIFY markerCommentChanged)
Q_PROPERTY(QString markerComment MEMBER m_markerComment NOTIFY markerChanged)
Q_PROPERTY(QColor markerColor MEMBER m_markerColor NOTIFY markerChanged)
Q_PROPERTY(QString timecode READ timecode NOTIFY timecodeChanged)
Q_PROPERTY(QList <int> audioStreams MEMBER m_audioStreams NOTIFY audioThumbChanged)
Q_PROPERTY(QList <int> audioChannels MEMBER m_audioChannels NOTIFY audioThumbChanged)
......@@ -73,7 +74,6 @@ public:
int rulerHeight() const;
int overlayType() const;
void setOverlayType(int ix);
QString markerComment() const;
const QString timecode() const;
/** brief: update position and end seeking if we reached the requested seek position.
* returns true if the position was unchanged, false otherwise
......@@ -86,7 +86,7 @@ public:
bool audioThumbFormat() const;
bool audioThumbNormalize() const;
void positionFromConsumer(int pos, bool playing);
void setMarkerComment(const QString &comment);
void setMarker(const QString &comment, const QColor &color);
int zoneIn() const;
int zoneOut() const;
void setZoneIn(int pos);
......@@ -123,7 +123,7 @@ signals:
void zoneChanged();
void saveZone(const QPoint zone);
void saveZoneWithUndo(const QPoint, const QPoint&);
void markerCommentChanged();
void markerChanged();
void rulerHeightChanged();
void addSnap(int);
void removeSnap(int);
......@@ -155,6 +155,7 @@ private:
QList <int> m_audioStreams;
QList <int> m_audioChannels;
QString m_markerComment;
QColor m_markerColor;
QString m_clipName;
QString m_clipStream;
int m_clipType;
......
......@@ -215,7 +215,7 @@ Item {
width: fontMetrics.boundingRect(displayText).width + 10
horizontalAlignment: displayText == text ? TextInput.AlignHCenter : TextInput.AlignLeft
background: Rectangle {
color: "#990000ff"
color: controller.markerColor
}
color: "#ffffff"
padding: 0
......
......@@ -110,6 +110,7 @@ Item {
delegate:
Item {
id: guideRoot
z: proxy.position == model.frame ? 20 : 10
Rectangle {
id: markerBase
width: 1
......@@ -117,7 +118,6 @@ Item {
x: model.frame * timeline.scaleFactor
color: model.color
property int markerId: model.id
opacity: 0.8
Rectangle {
visible: timeline.showMarkers
width: mlabel.contentWidth + 4
......
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