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

Fix timeline guide uneditable when over clip

BUG: 373463
parent c19b8b06
......@@ -26,7 +26,6 @@
<file alias="linear.svg">../data/pics/breeze-light/lt_linear.svg</file>
<file alias="discrete.svg">../data/pics/breeze-light/lt_discrete.svg</file>
<file alias="smooth.svg">../data/pics/breeze-light/lt_smooth.svg</file>
<file alias="project-defaults.svg">../data/pics/breeze-light/lt_project-defaults.svg</file>
<file alias="kdenlive.png">../data/icons/48-apps-kdenlive.png</file>
</qresource>
</RCC>
......@@ -566,7 +566,7 @@ void ClipItem::paint(QPainter *painter,
textColor = palette.highlightedText().color();
textBgColor = palette.highlight().color();
framePen.setColor(textBgColor);
paintColor.setRed(qMin(paintColor.red() * 2, 255));
paintColor.setRed(qMin((int) (paintColor.red() * 1.5), 255));
}
else {
textColor = palette.text().color();
......
......@@ -919,7 +919,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
// context menu requested
if (event->button() == Qt::RightButton) {
// Check if we want keyframes context menu
if (!m_dragItem && !m_dragGuide) {
if (!m_dragGuide) {
// check if there is a guide close to mouse click
QList<QGraphicsItem *> guidesCollisionList = items(event->pos().x() - 5, event->pos().y(), 10, 2); // a rect of height < 2 does not always collide with the guide
for (int i = 0; i < guidesCollisionList.count(); ++i) {
......@@ -1372,6 +1372,16 @@ GenTime CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, b
void CustomTrackView::mouseDoubleClickEvent(QMouseEvent *event)
{
// Check if double click on guide
QList<QGraphicsItem *> collisionList = items(event->pos());
for (int i = 0; i < collisionList.count(); ++i) {
if (collisionList.at(i)->type() == GUIDEITEM) {
Guide *editGuide = static_cast<Guide*>(collisionList.at(i));
if (editGuide) slotEditGuide(editGuide->info());
event->accept();
return;
}
}
if (m_dragItem && m_dragItem->keyframesCount() > 0) {
// add keyframe
GenTime keyFramePos = GenTime((int)(mapToScene(event->pos()).x()), m_document->fps()) - m_dragItem->startPos();// + m_dragItem->cropStart();
......@@ -1392,12 +1402,6 @@ void CustomTrackView::mouseDoubleClickEvent(QMouseEvent *event)
emit clipItemSelected(item, item->selectedEffectIndex());
} else if (m_dragItem && !m_dragItem->isItemLocked()) {
editItemDuration();
} else {
QList<QGraphicsItem *> collisionList = items(event->pos());
if (collisionList.count() == 1 && collisionList.at(0)->type() == GUIDEITEM) {
Guide *editGuide = static_cast<Guide*>(collisionList.at(0));
if (editGuide) slotEditGuide(editGuide->info());
}
}
}
......@@ -1566,7 +1570,7 @@ void CustomTrackView::displayContextMenu(QPoint pos, AbstractClipItem *clip)
m_editGuide->setEnabled(m_dragGuide != NULL);
m_markerMenu->clear();
m_markerMenu->setEnabled(false);
if (clip == NULL) {
if (clip == NULL || m_dragGuide) {
m_timelineContextMenu->popup(pos);
} else if (isGroup) {
m_pasteEffectsAction->setEnabled(m_copiedItems.count() == 1);
......
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