mirror of
https://github.com/rbreu/beeref.git
synced 2026-03-11 08:54:28 +00:00
Unify close buttons
This commit is contained in:
parent
e5b96589d2
commit
7bc8d5201f
2 changed files with 10 additions and 10 deletions
|
|
@ -192,6 +192,13 @@ class HelpDialog(QtWidgets.QDialog):
|
|||
layout = QtWidgets.QVBoxLayout()
|
||||
self.setLayout(layout)
|
||||
layout.addWidget(tabs)
|
||||
|
||||
# Bottom row of buttons
|
||||
buttons = QtWidgets.QDialogButtonBox(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Close)
|
||||
buttons.rejected.connect(self.reject)
|
||||
layout.addWidget(buttons)
|
||||
|
||||
self.show()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -105,25 +105,18 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
layout.addWidget(tabs)
|
||||
|
||||
# Bottom row of buttons
|
||||
buttons = QtWidgets.QDialogButtonBox()
|
||||
buttons = QtWidgets.QDialogButtonBox(
|
||||
QtWidgets.QDialogButtonBox.StandardButton.Close)
|
||||
buttons.rejected.connect(self.reject)
|
||||
reset_btn = QtWidgets.QPushButton('&Restore Defaults')
|
||||
reset_btn.setAutoDefault(False)
|
||||
reset_btn.clicked.connect(self.on_restore_defaults)
|
||||
buttons.addButton(reset_btn,
|
||||
QtWidgets.QDialogButtonBox.ButtonRole.ActionRole)
|
||||
|
||||
close_btn = QtWidgets.QPushButton('&Close')
|
||||
close_btn.setAutoDefault(True)
|
||||
close_btn.clicked.connect(self.on_close)
|
||||
buttons.addButton(close_btn,
|
||||
QtWidgets.QDialogButtonBox.ButtonRole.ActionRole)
|
||||
|
||||
layout.addWidget(buttons)
|
||||
self.show()
|
||||
|
||||
def on_close(self, *args, **kwargs):
|
||||
self.close()
|
||||
|
||||
def on_restore_defaults(self, *args, **kwargs):
|
||||
reply = QtWidgets.QMessageBox.question(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Reference in a new issue