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
69ca3d75
Commit
69ca3d75
authored
Nov 21, 2020
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add shortcut in/out/delete buttons to subtitle widget
parent
78f5b9df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
34 deletions
+73
-34
src/dialogs/subtitleedit.cpp
src/dialogs/subtitleedit.cpp
+18
-0
src/ui/editsub_ui.ui
src/ui/editsub_ui.ui
+55
-34
No files found.
src/dialogs/subtitleedit.cpp
View file @
69ca3d75
...
...
@@ -62,6 +62,9 @@ SubtitleEdit::SubtitleEdit(QWidget *parent)
buttonApply
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"dialog-ok-apply"
)));
buttonAdd
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"list-add"
)));
buttonCut
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-cut"
)));
buttonIn
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"zone-in"
)));
buttonOut
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"zone-out"
)));
buttonDelete
->
setIcon
(
QIcon
::
fromTheme
(
QStringLiteral
(
"edit-delete"
)));
auto
*
keyFilter
=
new
ShiftEnterFilter
(
this
);
subText
->
installEventFilter
(
keyFilter
);
connect
(
keyFilter
,
&
ShiftEnterFilter
::
triggerUpdate
,
this
,
&
SubtitleEdit
::
updateSubtitle
);
...
...
@@ -80,8 +83,14 @@ SubtitleEdit::SubtitleEdit(QWidget *parent)
m_duration
->
setEnabled
(
false
);
position_box
->
addWidget
(
m_position
);
auto
*
spacer
=
new
QSpacerItem
(
1
,
1
,
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Maximum
);
position_box
->
addSpacerItem
(
spacer
);
spacer
=
new
QSpacerItem
(
1
,
1
,
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Maximum
);
end_box
->
addWidget
(
m_endPosition
);
end_box
->
addSpacerItem
(
spacer
);
duration_box
->
addWidget
(
m_duration
);
spacer
=
new
QSpacerItem
(
1
,
1
,
QSizePolicy
::
MinimumExpanding
,
QSizePolicy
::
Maximum
);
duration_box
->
addSpacerItem
(
spacer
);
connect
(
m_position
,
&
TimecodeDisplay
::
timeCodeEditingFinished
,
[
this
]
(
int
value
)
{
if
(
buttonApply
->
isEnabled
())
{
updateSubtitle
();
...
...
@@ -114,6 +123,15 @@ SubtitleEdit::SubtitleEdit(QWidget *parent)
connect
(
buttonApply
,
&
QToolButton
::
clicked
,
this
,
&
SubtitleEdit
::
updateSubtitle
);
connect
(
buttonPrev
,
&
QToolButton
::
clicked
,
this
,
&
SubtitleEdit
::
goToPrevious
);
connect
(
buttonNext
,
&
QToolButton
::
clicked
,
this
,
&
SubtitleEdit
::
goToNext
);
connect
(
buttonIn
,
&
QToolButton
::
clicked
,
[
this
]()
{
pCore
->
triggerAction
(
QStringLiteral
(
"resize_timeline_clip_start"
));
});
connect
(
buttonOut
,
&
QToolButton
::
clicked
,
[
this
]()
{
pCore
->
triggerAction
(
QStringLiteral
(
"resize_timeline_clip_end"
));
});
connect
(
buttonDelete
,
&
QToolButton
::
clicked
,
[
this
]()
{
pCore
->
triggerAction
(
QStringLiteral
(
"delete_timeline_clip"
));
});
}
void
SubtitleEdit
::
setModel
(
std
::
shared_ptr
<
SubtitleModel
>
model
)
...
...
src/ui/editsub_ui.ui
View file @
69ca3d75
...
...
@@ -11,33 +11,6 @@
</rect>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
colspan=
"3"
>
<widget
class=
"QPlainTextEdit"
name=
"subText"
>
<property
name=
"tabChangesFocus"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"position_label"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Maximum"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Position
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"duration_label"
>
<property
name=
"text"
>
<string>
End
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"duration_label_2"
>
<property
name=
"text"
>
...
...
@@ -45,7 +18,7 @@
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
colspan=
"
2
"
>
<item
row=
"4"
column=
"0"
colspan=
"
3
"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QToolButton"
name=
"buttonPrev"
>
...
...
@@ -90,7 +63,27 @@
</item>
</layout>
</item>
<item
row=
"4"
column=
"2"
>
<item
row=
"4"
column=
"4"
>
<widget
class=
"QToolButton"
name=
"buttonDelete"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"2"
colspan=
"3"
>
<layout
class=
"QHBoxLayout"
name=
"end_box"
/>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"duration_label"
>
<property
name=
"text"
>
<string>
End
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"2"
colspan=
"3"
>
<layout
class=
"QHBoxLayout"
name=
"duration_box"
/>
</item>
<item
row=
"4"
column=
"3"
>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
...
...
@@ -103,14 +96,42 @@
</property>
</spacer>
</item>
<item
row=
"1"
column=
"
1"
colspan=
"2
"
>
<item
row=
"1"
column=
"
2"
colspan=
"3
"
>
<layout
class=
"QHBoxLayout"
name=
"position_box"
/>
</item>
<item
row=
"2"
column=
"1"
colspan=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"end_box"
/>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"position_label"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Maximum"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Position
</string>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
colspan=
"2"
>
<layout
class=
"QHBoxLayout"
name=
"duration_box"
/>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QToolButton"
name=
"buttonIn"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QToolButton"
name=
"buttonOut"
>
<property
name=
"text"
>
<string>
...
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
colspan=
"5"
>
<widget
class=
"QPlainTextEdit"
name=
"subText"
>
<property
name=
"tabChangesFocus"
>
<bool>
true
</bool>
</property>
</widget>
</item>
</layout>
</widget>
...
...
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