Commit 1a11c596 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '2012'

parents 64ed90b6 69ca3d75
Pipeline #41744 passed with stage
in 10 minutes and 26 seconds
......@@ -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)
......
......@@ -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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment