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

Don't allow resizing while dragging. Fixes #134

parent d7852ca1
Pipeline #2294 passed with stage
in 22 minutes
......@@ -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