Move Submit button next to the input field in MoatDialog

This commit is contained in:
Micah Lee 2021-10-18 18:18:04 -07:00
parent 3b6b74f649
commit 072f90df4f
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -58,6 +58,11 @@ class MoatDialog(QtWidgets.QDialog):
self.solution_lineedit.editingFinished.connect( self.solution_lineedit.editingFinished.connect(
self.solution_lineedit_editing_finished self.solution_lineedit_editing_finished
) )
self.submit_button = QtWidgets.QPushButton(strings._("moat_captcha_submit"))
self.submit_button.clicked.connect(self.submit_clicked)
solution_layout = QtWidgets.QHBoxLayout()
solution_layout.addWidget(self.solution_lineedit)
solution_layout.addWidget(self.submit_button)
# Error label # Error label
self.error_label = QtWidgets.QLabel() self.error_label = QtWidgets.QLabel()
@ -65,8 +70,6 @@ class MoatDialog(QtWidgets.QDialog):
self.error_label.hide() self.error_label.hide()
# Buttons # Buttons
self.submit_button = QtWidgets.QPushButton(strings._("moat_captcha_submit"))
self.submit_button.clicked.connect(self.submit_clicked)
self.reload_button = QtWidgets.QPushButton(strings._("moat_captcha_reload")) self.reload_button = QtWidgets.QPushButton(strings._("moat_captcha_reload"))
self.reload_button.clicked.connect(self.reload_clicked) self.reload_button.clicked.connect(self.reload_clicked)
self.cancel_button = QtWidgets.QPushButton( self.cancel_button = QtWidgets.QPushButton(
@ -74,7 +77,6 @@ class MoatDialog(QtWidgets.QDialog):
) )
self.cancel_button.clicked.connect(self.cancel_clicked) self.cancel_button.clicked.connect(self.cancel_clicked)
buttons_layout = QtWidgets.QHBoxLayout() buttons_layout = QtWidgets.QHBoxLayout()
buttons_layout.addWidget(self.submit_button)
buttons_layout.addStretch() buttons_layout.addStretch()
buttons_layout.addWidget(self.reload_button) buttons_layout.addWidget(self.reload_button)
buttons_layout.addWidget(self.cancel_button) buttons_layout.addWidget(self.cancel_button)
@ -83,7 +85,7 @@ class MoatDialog(QtWidgets.QDialog):
layout = QtWidgets.QVBoxLayout() layout = QtWidgets.QVBoxLayout()
layout.addWidget(self.label) layout.addWidget(self.label)
layout.addWidget(self.captcha) layout.addWidget(self.captcha)
layout.addWidget(self.solution_lineedit) layout.addLayout(solution_layout)
layout.addStretch() layout.addStretch()
layout.addWidget(self.error_label) layout.addWidget(self.error_label)
layout.addLayout(buttons_layout) layout.addLayout(buttons_layout)