Commit 3f9fb162 authored by Julius Künzel's avatar Julius Künzel
Browse files

Make it possible to change selection in slip mode

parent da7214ed
......@@ -3281,7 +3281,7 @@ void MainWindow::showToolMessage()
message = xi18nc("@info:whatsthis", "<shortcut>Ctrl</shortcut> to apply on current track only, <shortcut>Shift</shortcut> to also move guides. You can combine both modifiers.");
toolLabel = i18n("Spacer");
} else if (m_buttonSlipTool->isChecked()) {
message = xi18nc("@info:whatsthis", "<shortcut>Click</shortcut> on an item to slip, <shortcut>Shift</shortcut> to slip only current item of the group"); //TODO
message = xi18nc("@info:whatsthis", "<shortcut>Click</shortcut> on an item to slip, <shortcut>Shift click</shortcut> for multiple selection");
toolLabel = i18n("Slip");
} else if (m_buttonMulticamTool->isChecked()) {
message = xi18nc("@info:whatsthis", "<shortcut>Click</shortcut> on a track view in the project monitor to perform a lift of all tracks except active one");
......
......@@ -759,7 +759,7 @@ QString ProjectManager::projectSceneList(const QString &outputFolder, const QStr
pCore->window()->getMainTimeline()->controller()->updatePreviewConnection(true);
}
if (isTrimming) {
pCore->window()->getMainTimeline()->controller()->requestStartTrimmingMode(-1, false);
pCore->window()->getMainTimeline()->controller()->requestStartTrimmingMode();
}
return scene;
}
......
......@@ -1146,7 +1146,7 @@ Rectangle {
var mainClip = undefined
mainClip = getItemAtPos(tk, pos, false)
trimmingClickFrame = Math.round((scrollView.contentX + mouse.x) / timeline.scaleFactor)
timeline.requestStartTrimmingMode(mainClip.clipId, false)
timeline.requestStartTrimmingMode(mainClip.clipId, shiftPress)
}
if (dragProxy.draggedItem > -1) {
mouse.accepted = false
......
......@@ -1920,7 +1920,7 @@ void TimelineController::removeSplitOverlay()
void TimelineController::updateTrimmingMode() {
if (trimmingActive()) {
requestStartTrimmingMode(-1, false);
requestStartTrimmingMode();
} else {
requestEndTrimmingMode();
}
......@@ -1945,7 +1945,7 @@ void TimelineController::slipPosChanged(int offset) {
pCore->displayMessage(info, DirectMessage);
}
bool TimelineController::requestStartTrimmingMode(int mainClipId, bool onlyCurrent)
bool TimelineController::requestStartTrimmingMode(int mainClipId, bool addToSelection)
{
std::unordered_set<int> sel = m_model->getCurrentSelection();
std::unordered_set<int> newSel;
......@@ -1960,10 +1960,13 @@ bool TimelineController::requestStartTrimmingMode(int mainClipId, bool onlyCurre
mainClipId = -1;
}
if (newSel.empty() && mainClipId != -1) {
newSel.insert(mainClipId);
if ((newSel.empty() || !isInSelection(mainClipId)) && mainClipId != -1) {
m_trimmingMainClip = mainClipId;
emit trimmingMainClipChanged();
if (!addToSelection) {
newSel.clear();
}
newSel.insert(mainClipId);
}
if (newSel != sel) {
......@@ -1977,14 +1980,6 @@ bool TimelineController::requestStartTrimmingMode(int mainClipId, bool onlyCurre
Q_ASSERT(!sel.empty());
if (!isInSelection(mainClipId)) {
if (isInSelection(m_trimmingMainClip)) {
mainClipId = m_trimmingMainClip;
} else {
mainClipId = -1;
}
}
if (mainClipId == -1) {
mainClipId = getMainSelectedClip();
}
......
......@@ -535,7 +535,7 @@ public:
* @returns The bounded offset
*/
int trimmingBoundOffset(int offset);
Q_INVOKABLE bool requestStartTrimmingMode(int clipId, bool onlyCurrent);
Q_INVOKABLE bool requestStartTrimmingMode(int clipId = -1, bool addToSelection = false);
Q_INVOKABLE void requestEndTrimmingMode();
Q_INVOKABLE void slipPosChanged(int offset);
......
Supports Markdown
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