diff --git a/csgui/messageBox.py b/csgui/messageBox.py index 73808ff..edf0988 100644 --- a/csgui/messageBox.py +++ b/csgui/messageBox.py @@ -1,4 +1,5 @@ -from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut +from PyQt5.QtWidgets import QApplication, QAction, QLabel, QDialogButtonBox, QDialog, QFileDialog, QMessageBox, QPushButton, QLineEdit, QCheckBox, QSpinBox, QDoubleSpinBox, QTableWidgetItem, QTabWidget, QComboBox, QWidget, QScrollArea, QMainWindow, QShortcut, QDialogButtonBox +import sys class UnsavedMessageBox(QMessageBox): """ @@ -15,7 +16,12 @@ class UnsavedMessageBox(QMessageBox): self.setStandardButtons( QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel) self.setDefaultButton(QMessageBox.Save) - + + # If we are running on Haiku, use the MacOS button style to fit in more + # with native applications + if sys.platform.startswith("haiku"): + buttonBox = self.findChild(QDialogButtonBox) + buttonBox.setStyleSheet("* { button-layout: 1}") class UnreadableMessageBox(QMessageBox): """