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
6da8a847
Commit
6da8a847
authored
Nov 12, 2020
by
Jean-Baptiste Mardelle
Browse files
Add config setting for default subtitle duration, add subtitle by double clicking in subtitle track
parent
93d2d41e
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/kdenlivesettings.kcfg
View file @
6da8a847
...
...
@@ -85,6 +85,11 @@
<label>
Default mix transition duration.
</label>
<default>
00:00:01:00
</default>
</entry>
<entry
name=
"subtitle_duration"
type=
"String"
>
<label>
Default subtitle duration.
</label>
<default>
00:00:05:00
</default>
</entry>
<entry
name=
"autoimagesequence"
type=
"Bool"
>
<label>
Automatically import image sequences.
</label>
...
...
src/timeline2/view/qml/timeline.qml
View file @
6da8a847
...
...
@@ -874,6 +874,11 @@ Rectangle {
onExited
:
{
scim
=
false
}
onDoubleClicked
:
{
if
(
root
.
showSubtitles
&&
root
.
activeTool
===
0
&&
mouse
.
y
>
ruler
.
height
&&
mouse
.
y
<
(
ruler
.
height
+
subtitleTrack
.
height
))
{
timeline
.
addSubtitle
((
scrollView
.
contentX
+
mouseX
)
/
timeline
.
scaleFactor
)
}
}
onPositionChanged
:
{
if
(
pressed
&&
((
mouse
.
buttons
===
Qt
.
MidButton
)
||
(
mouse
.
buttons
===
Qt
.
LeftButton
&&
root
.
activeTool
==
0
&&
(
mouse
.
modifiers
&
Qt
.
ControlModifier
)
&&
!
shiftPress
)))
{
// Pan view
...
...
src/timeline2/view/timelinecontroller.cpp
View file @
6da8a847
...
...
@@ -3829,10 +3829,12 @@ void TimelineController::shiftSubtitle(int oldStartFrame, int newStartFrame, int
pCore
->
pushUndo
(
local_undo
,
local_redo
,
i18n
(
"Move subtitle"
));
}
void
TimelineController
::
addSubtitle
()
void
TimelineController
::
addSubtitle
(
int
startframe
)
{
int
startframe
=
pCore
->
getTimelinePosition
();
int
endframe
=
startframe
+
50
;
//create basic subtitle clip of default width
if
(
startframe
==
-
1
)
{
startframe
=
pCore
->
getTimelinePosition
();
}
int
endframe
=
startframe
+
pCore
->
getDurationFromString
(
KdenliveSettings
::
subtitle_duration
());
auto
subtitleModel
=
pCore
->
projectManager
()
->
current
()
->
getSubtitleModel
();
Fun
local_undo
=
[
subtitleModel
,
startframe
,
endframe
]()
{
...
...
src/timeline2/view/timelinecontroller.h
View file @
6da8a847
...
...
@@ -579,7 +579,7 @@ public:
/** @brief Shift subtitle clips without changing the clip duration */
Q_INVOKABLE
void
shiftSubtitle
(
int
oldStartFrame
,
int
newStartFrame
,
int
endFrame
=
0
,
QString
text
=
QString
());
/** @brief Add subtitle clip at cursor's position in timeline */
Q_INVOKABLE
void
addSubtitle
();
Q_INVOKABLE
void
addSubtitle
(
int
startframe
=
-
1
);
/** @brief Delete subtitle clip with frame as start position*/
Q_INVOKABLE
void
deleteSubtitle
(
int
frameframe
,
int
endframe
,
QString
Ctext
);
...
...
src/ui/configmisc_ui.ui
View file @
6da8a847
...
...
@@ -124,6 +124,16 @@
<item
row=
"3"
column=
"1"
>
<widget
class=
"QLineEdit"
name=
"kcfg_mix_duration"
/>
</item>
<item
row=
"3"
column=
"3"
>
<widget
class=
"QLineEdit"
name=
"kcfg_subtitle_duration"
/>
</item>
<item
row=
"3"
column=
"2"
>
<widget
class=
"QLabel"
name=
"label_9"
>
<property
name=
"text"
>
<string>
Subtitles
</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
...
...
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