Commit eb3c8212 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Cleaner indication of in/out/markers on monitor

parent ab4b6377
Pipeline #9276 passed with stage
in 14 minutes and 11 seconds
......@@ -1127,10 +1127,11 @@ void Monitor::checkOverlay(int pos)
if (pos == -1) {
pos = m_timePos->getValue();
}
QPoint zone = m_glMonitor->getControllerProxy()->zone();
std::shared_ptr<MarkerListModel> model(nullptr);
if (m_id == Kdenlive::ClipMonitor && m_controller) {
model = m_controller->getMarkerModel();
if (m_id == Kdenlive::ClipMonitor) {
if (m_controller) {
model = m_controller->getMarkerModel();
}
} else if (m_id == Kdenlive::ProjectMonitor && pCore->currentDoc()) {
model = pCore->currentDoc()->getGuideModel();
}
......@@ -1138,13 +1139,7 @@ void Monitor::checkOverlay(int pos)
if (model) {
bool found = false;
CommentedTime marker = model->getMarker(GenTime(pos, m_monitorManager->timecode().fps()), &found);
if (!found) {
if (pos == zone.x()) {
overlayText = i18n("In Point");
} else if (pos == zone.y() - 1) {
overlayText = i18n("Out Point");
}
} else {
if (found) {
overlayText = marker.comment();
}
}
......
......@@ -174,6 +174,54 @@ Item {
rightMargin: 10
}
}
Label {
id: inPoint
font: fixedFont
anchors {
left: parent.left
bottom: parent.bottom
}
visible: root.showMarkers && controller.position == controller.zoneIn
text: i18n("In Point")
color: "white"
background: Rectangle {
color: "#228b22"
}
height: marker.height
width: textMetricsIn.width + 10
leftPadding:0
rightPadding:0
horizontalAlignment: TextInput.AlignHCenter
TextMetrics {
id: textMetricsIn
font: inPoint.font
text: inPoint.text
}
}
Label {
id: outPoint
font: fixedFont
anchors {
left: inPoint.visible ? inPoint.right : parent.left
bottom: parent.bottom
}
visible: root.showMarkers && controller.position + 1 == controller.zoneOut
text: i18n("Out Point")
color: "white"
background: Rectangle {
color: "#ff4500"
}
width: textMetricsOut.width + 10
height: marker.height
leftPadding:0
rightPadding:0
horizontalAlignment: TextInput.AlignHCenter
TextMetrics {
id: textMetricsOut
font: outPoint.font
text: outPoint.text
}
}
TextField {
id: marker
font: fixedFont
......@@ -185,7 +233,7 @@ Item {
root.editCurrentMarker()
}
anchors {
left: parent.left
left: outPoint.visible ? outPoint.right : inPoint.visible ? inPoint.right : parent.left
bottom: parent.bottom
}
visible: root.showMarkers && text != ""
......@@ -193,11 +241,10 @@ Item {
width: textMetrics.width + 10
horizontalAlignment: TextInput.AlignHCenter
background: Rectangle {
color: controller.position == controller.zoneIn ? "#9900ff00" : controller.position == controller.zoneOut ? "#99ff0000" : "#990000ff"
color: "#990000ff"
}
color: "white"
leftPadding:0
rightPadding:0
padding:0
TextMetrics {
id: textMetrics
......
......@@ -147,36 +147,83 @@ Item {
rightMargin: 10
}
}
TextField {
id: marker
Label {
id: inPoint
font: fixedFont
objectName: "markertext"
activeFocusOnPress: true
text: controller.markerComment
width: textMetrics.width + 10
horizontalAlignment: TextInput.AlignHCenter
anchors {
left: parent.left
bottom: parent.bottom
}
visible: root.showMarkers && controller.position == controller.zoneIn
text: i18n("In Point")
color: "white"
background: Rectangle {
color: controller.position == controller.zoneIn ? "#9900ff00" : controller.position == controller.zoneOut ? "#99ff0000" : "#990000ff"
color: "#228b22"
}
height: marker.height
width: textMetricsIn.width + 10
leftPadding:0
rightPadding:0
horizontalAlignment: TextInput.AlignHCenter
TextMetrics {
id: textMetricsIn
font: inPoint.font
text: inPoint.text
}
}
Label {
id: outPoint
font: fixedFont
anchors {
left: inPoint.visible ? inPoint.right : parent.left
bottom: parent.bottom
}
visible: root.showMarkers && controller.position + 1 == controller.zoneOut
text: i18n("Out Point")
color: "white"
background: Rectangle {
color: "#ff4500"
}
width: textMetricsOut.width + 10
height: marker.height
leftPadding:0
rightPadding:0
horizontalAlignment: TextInput.AlignHCenter
TextMetrics {
id: textMetrics
font: marker.font
text: controller.markerComment
id: textMetricsOut
font: outPoint.font
text: outPoint.text
}
}
TextField {
id: marker
font: fixedFont
objectName: "markertext"
activeFocusOnPress: true
onEditingFinished: {
root.markerText = marker.displayText
marker.focus = false
root.editCurrentMarker()
}
anchors {
left: parent.left
left: outPoint.visible ? outPoint.right : inPoint.visible ? inPoint.right : parent.left
bottom: parent.bottom
}
visible: root.showMarkers && text != ""
text: controller.markerComment
width: textMetrics.width + 10
horizontalAlignment: TextInput.AlignHCenter
background: Rectangle {
color: "#990000ff"
}
color: "white"
padding:0
TextMetrics {
id: textMetrics
font: marker.font
text: controller.markerComment
}
maximumLength: 25
}
}
......
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