File size: 661 Bytes
b2fbb41 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import sys
from qtpy.QtWidgets import QCheckBox
from qtpy.QtGui import QMouseEvent
class QFontChecker(QCheckBox):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if sys.platform == 'darwin':
self.setStyleSheet("min-width: 45px")
class AlignmentChecker(QCheckBox):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
if sys.platform == 'darwin':
self.setStyleSheet("min-width: 15px")
def mousePressEvent(self, event: QMouseEvent) -> None:
if self.isChecked():
return event.accept()
return super().mousePressEvent(event)
|