Browse Source

change style of save warning dialog buttons on Haiku for better integration

master
Ivan Holmes 3 years ago
parent
commit
6fc46a46b8
  1. 10
      csgui/messageBox.py

10
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):
"""

Loading…
Cancel
Save