Skip to content
GitLab
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
5f80bc77
Commit
5f80bc77
authored
Apr 10, 2020
by
Jean-Baptiste Mardelle
Browse files
Rubber selection should not always select bottom track compositions
parent
e9456b2b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/timeline2/view/qml/timeline.qml
View file @
5f80bc77
...
...
@@ -912,6 +912,8 @@ Rectangle {
var
y
=
rubberSelect
.
y
-
ruler
.
height
+
scrollView
.
contentY
var
topTrack
=
Logic
.
getTrackIndexFromPos
(
Math
.
max
(
0
,
y
))
var
bottomTrack
=
Logic
.
getTrackIndexFromPos
(
y
+
rubberSelect
.
height
)
// Check if bottom of rubber selection covers the last track compositions
var
selectBottomCompositions
=
((
y
+
rubberSelect
.
height
)
-
Logic
.
getTrackYFromId
(
tracksRepeater
.
itemAt
(
bottomTrack
).
trackInternalId
)
-
scrollView
.
contentY
)
>
(
Logic
.
getTrackHeightByPos
(
bottomTrack
)
*
0.6
)
if
(
bottomTrack
>=
topTrack
)
{
var
t
=
[]
for
(
var
i
=
topTrack
;
i
<=
bottomTrack
;
i
++
)
{
...
...
@@ -919,7 +921,7 @@ Rectangle {
}
var
startFrame
=
(
scrollView
.
contentX
-
tracksArea
.
x
+
rubberSelect
.
x
)
/
timeline
.
scaleFactor
var
endFrame
=
(
scrollView
.
contentX
-
tracksArea
.
x
+
rubberSelect
.
x
+
rubberSelect
.
width
)
/
timeline
.
scaleFactor
timeline
.
selectItems
(
t
,
startFrame
,
endFrame
,
mouse
.
modifiers
&
Qt
.
ControlModifier
);
timeline
.
selectItems
(
t
,
startFrame
,
endFrame
,
mouse
.
modifiers
&
Qt
.
ControlModifier
,
selectBottomCompositions
);
}
rubberSelect
.
y
=
-
1
}
else
if
(
shiftPress
)
{
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
5f80bc77
...
...
@@ -1189,7 +1189,7 @@ void TimelineController::setZoneOut(int outPoint)
emit
zoneMoved
(
m_zone
);
}
void
TimelineController
::
selectItems
(
const
QVariantList
&
tracks
,
int
startFrame
,
int
endFrame
,
bool
addToSelect
)
void
TimelineController
::
selectItems
(
const
QVariantList
&
tracks
,
int
startFrame
,
int
endFrame
,
bool
addToSelect
,
bool
selectBottomCompositions
)
{
std
::
unordered_set
<
int
>
itemsToSelect
;
if
(
addToSelect
)
{
...
...
@@ -1199,7 +1199,7 @@ void TimelineController::selectItems(const QVariantList &tracks, int startFrame,
if
(
m_model
->
getTrackById_const
(
tracks
.
at
(
i
).
toInt
())
->
isLocked
())
{
continue
;
}
auto
currentClips
=
m_model
->
getItemsInRange
(
tracks
.
at
(
i
).
toInt
(),
startFrame
,
endFrame
,
true
);
auto
currentClips
=
m_model
->
getItemsInRange
(
tracks
.
at
(
i
).
toInt
(),
startFrame
,
endFrame
,
i
<
tracks
.
count
()
-
1
?
true
:
selectBottomCompositions
);
itemsToSelect
.
insert
(
currentClips
.
begin
(),
currentClips
.
end
());
}
m_model
->
requestSetSelection
(
itemsToSelect
);
...
...
src/timeline2/view/timelinecontroller.h
View file @
5f80bc77
...
...
@@ -113,7 +113,7 @@ public:
@param start/endFrame Interval from which to select the items
@param addToSelect if true, the old selection is retained
*/
Q_INVOKABLE
void
selectItems
(
const
QVariantList
&
tracks
,
int
startFrame
,
int
endFrame
,
bool
addToSelect
);
Q_INVOKABLE
void
selectItems
(
const
QVariantList
&
tracks
,
int
startFrame
,
int
endFrame
,
bool
addToSelect
,
bool
selectBottomCompositions
);
/** @brief request a selection with a list of ids*/
Q_INVOKABLE
void
selectItems
(
const
QList
<
int
>
&
ids
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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