Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
784454e3
Commit
784454e3
authored
Jun 05, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix groups keeping keyboard grab state on unselect,
add Shift modifier to move items faster with keyboard Related to #203 #216
parent
c6561575
Pipeline
#4054
passed with stage
in 29 minutes
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/timeline2/model/timelinemodel.cpp
View file @
784454e3
...
...
@@ -3115,22 +3115,27 @@ bool TimelineModel::requestClearSelection(bool onDeletion)
return
true
;
}
if
(
isGroup
(
m_currentSelection
))
{
if
(
m_groups
->
getType
(
m_currentSelection
)
==
GroupType
::
Selection
)
{
// Reset offset display on clips
std
::
unordered_set
<
int
>
items
=
getCurrentSelection
();
for
(
auto
&
id
:
items
)
{
if
(
isClip
(
id
))
{
m_allClips
[
id
]
->
clearOffset
();
if
(
m_allClips
[
id
]
->
isGrabbed
())
{
m_allClips
[
id
]
->
setGrab
(
false
);
}
}
else
if
(
isComposition
(
id
))
{
if
(
m_allCompositions
[
id
]
->
isGrabbed
())
{
m_allCompositions
[
id
]
->
setGrab
(
false
);
}
// Reset offset display on clips
std
::
unordered_set
<
int
>
items
=
getCurrentSelection
();
for
(
auto
&
id
:
items
)
{
if
(
isGroup
(
id
))
{
std
::
unordered_set
<
int
>
children
=
m_groups
->
getLeaves
(
id
);
for
(
int
c
:
children
)
{
items
.
insert
(
c
);
}
}
else
if
(
isClip
(
id
))
{
m_allClips
[
id
]
->
clearOffset
();
if
(
m_allClips
[
id
]
->
isGrabbed
())
{
m_allClips
[
id
]
->
setGrab
(
false
);
}
}
else
if
(
isComposition
(
id
))
{
if
(
m_allCompositions
[
id
]
->
isGrabbed
())
{
m_allCompositions
[
id
]
->
setGrab
(
false
);
}
}
if
(
m_groups
->
getType
(
m_currentSelection
)
==
GroupType
::
Selection
)
{
m_groups
->
destructGroupItem
(
m_currentSelection
);
}
m_groups
->
destructGroupItem
(
m_currentSelection
);
}
}
else
{
if
(
isClip
(
m_currentSelection
))
{
...
...
src/timeline2/view/qml/Clip.qml
View file @
784454e3
...
...
@@ -255,10 +255,12 @@ Rectangle {
}
Keys.onShortcutOverride
:
event
.
accepted
=
clipRoot
.
isGrabbed
&&
(
event
.
key
===
Qt
.
Key_Left
||
event
.
key
===
Qt
.
Key_Right
||
event
.
key
===
Qt
.
Key_Up
||
event
.
key
===
Qt
.
Key_Down
)
Keys.onLeftPressed
:
{
controller
.
requestClipMove
(
clipRoot
.
clipId
,
clipRoot
.
trackId
,
clipRoot
.
modelStart
-
1
,
true
,
true
,
true
);
var
offset
=
event
.
modifiers
===
Qt
.
ShiftModifier
?
timeline
.
fps
()
:
1
controller
.
requestClipMove
(
clipRoot
.
clipId
,
clipRoot
.
trackId
,
clipRoot
.
modelStart
-
offset
,
true
,
true
,
true
);
}
Keys.onRightPressed
:
{
controller
.
requestClipMove
(
clipRoot
.
clipId
,
clipRoot
.
trackId
,
clipRoot
.
modelStart
+
1
,
true
,
true
,
true
);
var
offset
=
event
.
modifiers
===
Qt
.
ShiftModifier
?
timeline
.
fps
()
:
1
controller
.
requestClipMove
(
clipRoot
.
clipId
,
clipRoot
.
trackId
,
clipRoot
.
modelStart
+
offset
,
true
,
true
,
true
);
}
Keys.onUpPressed
:
{
controller
.
requestClipMove
(
clipRoot
.
clipId
,
controller
.
getNextTrackId
(
clipRoot
.
trackId
),
clipRoot
.
modelStart
,
true
,
true
,
true
);
...
...
src/timeline2/view/qml/Composition.qml
View file @
784454e3
...
...
@@ -122,10 +122,12 @@ Item {
hoverEnabled
:
true
Keys.onShortcutOverride
:
event
.
accepted
=
compositionRoot
.
isGrabbed
&&
(
event
.
key
===
Qt
.
Key_Left
||
event
.
key
===
Qt
.
Key_Right
||
event
.
key
===
Qt
.
Key_Up
||
event
.
key
===
Qt
.
Key_Down
)
Keys.onLeftPressed
:
{
controller
.
requestCompositionMove
(
compositionRoot
.
clipId
,
compositionRoot
.
originalTrackId
,
compositionRoot
.
modelStart
-
1
,
true
,
true
)
var
offset
=
event
.
modifiers
===
Qt
.
ShiftModifier
?
timeline
.
fps
()
:
1
controller
.
requestCompositionMove
(
compositionRoot
.
clipId
,
compositionRoot
.
originalTrackId
,
compositionRoot
.
modelStart
-
offset
,
true
,
true
)
}
Keys.onRightPressed
:
{
controller
.
requestCompositionMove
(
compositionRoot
.
clipId
,
compositionRoot
.
originalTrackId
,
compositionRoot
.
modelStart
+
1
,
true
,
true
)
var
offset
=
event
.
modifiers
===
Qt
.
ShiftModifier
?
timeline
.
fps
()
:
1
controller
.
requestCompositionMove
(
compositionRoot
.
clipId
,
compositionRoot
.
originalTrackId
,
compositionRoot
.
modelStart
+
offset
,
true
,
true
)
}
Keys.onUpPressed
:
{
controller
.
requestCompositionMove
(
compositionRoot
.
clipId
,
controller
.
getNextTrackId
(
compositionRoot
.
originalTrackId
),
compositionRoot
.
modelStart
,
true
,
true
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment