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

Don't allow resizing while dragging. Fixes #134

parent f9b69acd
Pipeline #2293 passed with stage
in 21 minutes and 49 seconds
......@@ -160,6 +160,10 @@ Rectangle {
scrollTimer.running = false
scrollTimer.stop()
}
function isDragging() {
return dragProxy.draggedItem > -1 && dragProxyArea.pressed
}
function initDrag(itemObject, itemCoord, itemId, itemPos, itemTrack, isComposition) {
dragProxy.x = itemObject.modelStart * timeScale
......
......@@ -556,8 +556,21 @@ void TimelineController::unGroupSelection(int cid)
}
}
bool TimelineController::dragOperationRunning()
{
QVariant returnedValue;
QMetaObject::invokeMethod(m_root, "isDragging", Q_RETURN_ARG(QVariant, returnedValue));
return returnedValue.toBool();
}
void TimelineController::setInPoint()
{
if (dragOperationRunning()) {
// Don't allow timeline operation while drag in progress
qDebug()<<"Cannot operate while dragging";
return;
}
int cursorPos = timelinePosition();
const auto selection = m_model->getCurrentSelection();
if (!selection.empty()) {
......@@ -579,6 +592,11 @@ int TimelineController::timelinePosition() const
void TimelineController::setOutPoint()
{
if (dragOperationRunning()) {
// Don't allow timeline operation while drag in progress
qDebug()<<"Cannot operate while dragging";
return;
}
int cursorPos = timelinePosition();
const auto selection = m_model->getCurrentSelection();
if (!selection.empty()) {
......
......@@ -439,6 +439,8 @@ public:
void grabCurrent();
/** @brief Returns keys for all used thumbnails */
QStringList getThumbKeys();
/** @brief Returns true if a drag operation is currently running in timeline */
bool dragOperationRunning();
public slots:
void resetView();
......
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