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
259
Issues
259
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
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
824741bd
Commit
824741bd
authored
Nov 23, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Subtitle track: add expand button and track label
parent
046dd663
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
4 deletions
+42
-4
src/timeline2/view/qml/TrackHead.qml
src/timeline2/view/qml/TrackHead.qml
+2
-2
src/timeline2/view/qml/timeline.qml
src/timeline2/view/qml/timeline.qml
+40
-2
No files found.
src/timeline2/view/qml/TrackHead.qml
View file @
824741bd
...
...
@@ -101,7 +101,7 @@ Rectangle {
background
:
Rectangle
{
color
:
trackTarget
.
bgColor
}
width
:
2
*
fontMetrics
.
boundingRect
(
"
M
"
).
w
idth
width
:
2
*
root
.
trackTagW
idth
height
:
trackHeadRoot
.
height
verticalAlignment
:
Text
.
AlignTop
horizontalAlignment
:
Text
.
AlignHCenter
...
...
@@ -294,7 +294,7 @@ Rectangle {
background
:
Rectangle
{
color
:
trackLed
.
bgColor
}
width
:
fontMetrics
.
boundingRect
(
"
M
"
).
w
idth
*
trackHeadRoot
.
trackTag
.
length
width
:
root
.
trackTagW
idth
*
trackHeadRoot
.
trackTag
.
length
height
:
root
.
collapsedHeight
-
2
y
:
1
verticalAlignment
:
Text
.
AlignVCenter
...
...
src/timeline2/view/qml/timeline.qml
View file @
824741bd
...
...
@@ -309,6 +309,7 @@ Rectangle {
property
bool
paletteUnchanged
:
true
property
int
maxLabelWidth
:
20
*
root
.
baseUnit
*
Math
.
sqrt
(
root
.
timeScale
)
property
bool
showSubtitles
:
false
property
int
trackTagWidth
:
fontMetrics
.
boundingRect
(
"
M
"
).
width
onSeekingFinishedChanged
:
{
playhead
.
opacity
=
seekingFinished
?
1
:
0.5
...
...
@@ -715,6 +716,43 @@ Rectangle {
scrollView
.
contentY
=
Math
.
max
(
newScroll
,
0
)
}
}
Item
{
id
:
subtitleTrackHeader
width
:
tracksContainerArea
.
width
height
:
subtitleTrack
.
height
property
bool
collapsed
:
subtitleTrack
.
height
==
root
.
collapsedHeight
ToolButton
{
id
:
expandSubButton
focusPolicy
:
Qt
.
NoFocus
property
var
modifier
:
0
anchors.left
:
parent
.
left
anchors.leftMargin
:
2
*
root
.
trackTagWidth
width
:
root
.
collapsedHeight
height
:
root
.
collapsedHeight
contentItem
:
Item
{
Image
{
source
:
subtitleTrackHeader
.
collapsed
?
"
image://icon/go-next
"
:
"
image://icon/go-down
"
anchors.centerIn
:
parent
width
:
root
.
collapsedHeight
-
4
height
:
root
.
collapsedHeight
-
4
cache
:
root
.
paletteUnchanged
}
}
onClicked
:
{
if
(
subtitleTrack
.
height
>
root
.
collapsedHeight
)
{
subtitleTrack
.
height
=
root
.
collapsedHeight
}
else
{
subtitleTrack
.
height
=
5
*
root
.
baseUnit
}
}
}
Label
{
anchors.left
:
expandSubButton
.
left
anchors.top
:
expandSubButton
.
bottom
font
:
miniFont
text
:
i18n
(
"
Subtitles
"
)
}
}
Column
{
id
:
trackHeaders
y
:
subtitleTrack
.
height
...
...
@@ -906,7 +944,7 @@ Rectangle {
scim
=
false
}
onDoubleClicked
:
{
if
(
root
.
showSubtitles
&&
root
.
activeTool
===
0
&&
mouse
.
y
>
ruler
.
height
&&
mouse
.
y
<
(
ruler
.
height
+
subtitleTrack
.
height
))
{
if
(
mouse
.
buttons
===
Qt
.
LeftButton
&&
root
.
showSubtitles
&&
root
.
activeTool
===
0
&&
mouse
.
y
>
ruler
.
height
&&
mouse
.
y
<
(
ruler
.
height
+
subtitleTrack
.
height
))
{
timeline
.
addSubtitle
((
scrollView
.
contentX
+
mouseX
)
/
timeline
.
scaleFactor
)
}
}
...
...
@@ -1124,7 +1162,7 @@ Rectangle {
Item
{
id
:
subtitleTrack
width
:
tracksContainerArea
.
width
height
:
showSubtitles
?
root
.
baseUnit
*
4
:
0
height
:
showSubtitles
?
root
.
baseUnit
*
5
:
0
Repeater
{
id
:
subtitlesRepeater
;
model
:
subtitleDelegateModel
}
MouseArea
{
anchors.fill
:
parent
...
...
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