Skip to content

Commit 466d311

Browse files
authored
Merge pull request #4351 from OpenShot/title-editor-tab-switching
Switch to next text field on tab press
2 parents 5468a9a + 13c7b62 commit 466d311

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/windows/title_editor.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from PyQt5.QtWidgets import (
4343
QWidget, QGraphicsScene,
4444
QMessageBox, QDialog, QColorDialog, QFontDialog,
45-
QPushButton, QTextEdit, QLabel
45+
QPushButton, QLineEdit, QLabel
4646
)
4747

4848
import openshot
@@ -137,8 +137,8 @@ def txtLine_changed(self, txtWidget):
137137
# Loop through child widgets (and remove them)
138138
text_list = []
139139
for child in self.settingsContainer.children():
140-
if type(child) == QTextEdit and child.objectName() != "txtFileName":
141-
text_list.append(child.toPlainText())
140+
if type(child) == QLineEdit and child.objectName() != "txtFileName":
141+
text_list.append(child.text())
142142

143143
# Update text values in the SVG
144144
for i, node in enumerate(self.tspan_nodes):
@@ -238,7 +238,7 @@ def load_svg_template(self, filename_field=None):
238238
label.setToolTip(label_line_text)
239239

240240
# create text editor for file name
241-
self.txtFileName = QTextEdit(self)
241+
self.txtFileName = QLineEdit(self)
242242
self.txtFileName.setObjectName("txtFileName")
243243

244244
# If edit mode or reload, set file name
@@ -302,7 +302,7 @@ def load_svg_template(self, filename_field=None):
302302
label.setToolTip(label_line_text)
303303

304304
# create text editor for each text element in title
305-
widget = QTextEdit(_(text))
305+
widget = QLineEdit(_(text))
306306
widget.setFixedHeight(28)
307307
widget.textChanged.connect(functools.partial(self.txtLine_changed, widget))
308308
layout.addRow(label, widget)
@@ -581,10 +581,10 @@ def accept(self):
581581

582582
else:
583583
# Create new title (with unique name)
584-
file_name = "%s.svg" % self.txtFileName.toPlainText().strip()
584+
file_name = "%s.svg" % self.txtFileName.text().strip()
585585
file_path = os.path.join(info.TITLE_PATH, file_name)
586586

587-
if self.txtFileName.toPlainText().strip():
587+
if self.txtFileName.text().strip():
588588
# Do we have unsaved changes?
589589
if os.path.exists(file_path) and not self.edit_file_path:
590590
ret = QMessageBox.question(
@@ -614,7 +614,7 @@ def btnAdvanced_clicked(self):
614614
s = get_app().get_settings()
615615
prog = s.get("title_editor")
616616
# Store filename field to display on reload
617-
filename_text = self.txtFileName.toPlainText().strip()
617+
filename_text = self.txtFileName.text().strip()
618618
try:
619619
# launch advanced title editor
620620
log.info("Advanced title editor command: %s", str([prog, self.filename]))

0 commit comments

Comments
 (0)