Commit 5026ce2b authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Subtitle edit: switch to KTextEdit so we get spell check

parent ee13f34b
......@@ -69,10 +69,10 @@ SubtitleEdit::SubtitleEdit(QWidget *parent)
auto *keyFilter = new ShiftEnterFilter(this);
subText->installEventFilter(keyFilter);
connect(keyFilter, &ShiftEnterFilter::triggerUpdate, this, &SubtitleEdit::updateSubtitle);
connect(subText, &QPlainTextEdit::textChanged, [this]() {
connect(subText, &KTextEdit::textChanged, [this]() {
buttonApply->setEnabled(true);
});
connect(subText, &QPlainTextEdit::cursorPositionChanged, [this]() {
connect(subText, &KTextEdit::cursorPositionChanged, [this]() {
buttonCut->setEnabled(true);
});
......
......@@ -6,56 +6,11 @@
<rect>
<x>0</x>
<y>0</y>
<width>392</width>
<height>366</height>
<width>246</width>
<height>281</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="buttonPrev">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonNext">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAdd">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonCut">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonApply">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
......@@ -69,6 +24,19 @@
</property>
</spacer>
</item>
<item row="0" column="0" colspan="3">
<widget class="KTextEdit" name="subText">
<property name="tabChangesFocus">
<bool>true</bool>
</property>
<property name="acceptRichText">
<bool>false</bool>
</property>
<property name="checkSpellingEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QToolButton" name="buttonDelete">
<property name="text">
......@@ -163,15 +131,60 @@
</layout>
</widget>
</item>
<item row="0" column="0" colspan="3">
<widget class="QPlainTextEdit" name="subText">
<property name="tabChangesFocus">
<bool>true</bool>
</property>
</widget>
<item row="2" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="buttonPrev">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::LeftArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonNext">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonAdd">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonCut">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="buttonApply">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KTextEdit</class>
<extends>QTextEdit</extends>
<header>ktextedit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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