Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
4c12556e
Commit
4c12556e
authored
May 10, 2018
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Focus lower video track on project opening, correctly scroll view when active track changes
parent
3f765fa0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
src/timeline2/model/timelineitemmodel.cpp
src/timeline2/model/timelineitemmodel.cpp
+14
-0
src/timeline2/model/timelineitemmodel.hpp
src/timeline2/model/timelineitemmodel.hpp
+3
-0
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+10
-0
src/timeline2/view/timelinewidget.cpp
src/timeline2/view/timelinewidget.cpp
+1
-1
No files found.
src/timeline2/model/timelineitemmodel.cpp
View file @
4c12556e
...
...
@@ -394,6 +394,20 @@ QVariant TimelineItemModel::getTrackProperty(int tid, const QString &name) const
return
getTrackById_const
(
tid
)
->
getProperty
(
name
);
}
int
TimelineItemModel
::
getFirstVideoTrackIndex
()
const
{
int
trackId
;
auto
it
=
m_allTracks
.
cbegin
();
while
(
it
!=
m_allTracks
.
cend
())
{
trackId
=
getTrackMltIndex
((
*
it
)
->
getId
());
if
((
*
it
)
->
getProperty
(
"kdenlive:audio_track"
).
toInt
()
!=
1
)
{
break
;
}
++
it
;
}
return
trackId
;
}
const
QString
TimelineItemModel
::
getTrackFullName
(
int
tid
)
const
{
QString
tag
=
getTrackTagById
(
tid
);
...
...
src/timeline2/model/timelineitemmodel.hpp
View file @
4c12556e
...
...
@@ -81,6 +81,9 @@ public:
QModelIndex
parent
(
const
QModelIndex
&
index
)
const
override
;
Q_INVOKABLE
void
setTrackProperty
(
int
tid
,
const
QString
&
name
,
const
QString
&
value
);
Q_INVOKABLE
QVariant
getTrackProperty
(
int
tid
,
const
QString
&
name
)
const
;
/** @brief returns the lower video track index in timeline.
**/
int
getFirstVideoTrackIndex
()
const
;
const
QString
getTrackFullName
(
int
tid
)
const
;
void
notifyChange
(
const
QModelIndex
&
topleft
,
const
QModelIndex
&
bottomright
,
bool
start
,
bool
duration
,
bool
updateThumb
)
override
;
void
notifyChange
(
const
QModelIndex
&
topleft
,
const
QModelIndex
&
bottomright
,
const
QVector
<
int
>
&
roles
)
override
;
...
...
src/timeline2/view/qml/timeline.qml
View file @
4c12556e
...
...
@@ -131,6 +131,7 @@ Rectangle {
property
int
copiedClip
:
-
1
property
var
dragList
:
[]
property
int
zoomOnMouse
:
-
1
property
int
viewActiveTrack
:
timeline
.
activeTrack
//onCurrentTrackChanged: timeline.selection = []
onTimeScaleChanged
:
{
...
...
@@ -144,6 +145,15 @@ Rectangle {
ruler
.
adjustStepSize
()
}
onViewActiveTrackChanged
:
{
var
tk
=
Logic
.
getTrackById
(
timeline
.
activeTrack
)
if
(
tk
.
y
<
scrollView
.
flickableItem
.
contentY
)
{
scrollView
.
flickableItem
.
contentY
=
Math
.
max
(
0
,
tk
.
y
-
scrollView
.
height
/
3
)
}
else
if
(
tk
.
y
+
tk
.
height
>
scrollView
.
flickableItem
.
contentY
+
scrollView
.
viewport
.
height
)
{
scrollView
.
flickableItem
.
contentY
=
Math
.
min
(
scrollView
.
flickableItem
.
height
,
tk
.
y
-
scrollView
.
height
/
3
)
}
}
onTimelineSelectionChanged
:
{
if
(
root
.
timelineSelection
.
length
==
0
)
{
root
.
dragList
=
[]
...
...
src/timeline2/view/timelinewidget.cpp
View file @
4c12556e
...
...
@@ -92,7 +92,7 @@ void TimelineWidget::setModel(std::shared_ptr<TimelineItemModel> model)
m_proxy
->
setRoot
(
rootObject
());
setVisible
(
true
);
loading
=
false
;
m_proxy
->
setActiveTrack
(
model
->
get
TrackIndexFromPosition
(
model
->
getTracksCount
()
-
1
));
m_proxy
->
setActiveTrack
(
model
->
get
FirstVideoTrackIndex
(
));
m_proxy
->
checkDuration
();
}
...
...
Write
Preview
Markdown
is supported
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