- upgraded the Geometry Editor main UI

- upgraded the FCButton widget (and made it used everywhere instead of the QPushButton) so it can have the color and font weight properties settable
This commit is contained in:
Marius Stanciu
2022-05-10 07:01:14 +03:00
committed by Marius
parent 9e2ce70b42
commit e8a15156db
61 changed files with 581 additions and 1336 deletions

View File

@@ -978,7 +978,7 @@ class FCColorEntry(QtWidgets.QFrame):
validator = QtGui.QRegularExpressionValidator(regex, self.entry)
self.entry.setValidator(validator)
self.button = QtWidgets.QPushButton()
self.button = FCButton()
self.button.setFixedSize(15, 15)
self.button.setStyleSheet("border-color: dimgray;")
@@ -3002,27 +3002,63 @@ class FCInputDialogSpinnerButton(QtWidgets.QDialog):
class FCButton(QtWidgets.QPushButton):
def __init__(self, text=None, checkable=None, click_callback=None, parent=None):
def __init__(self, text=None, checkable=None, click_callback=None, bold=False, color=None, parent=None):
super(FCButton, self).__init__(text, parent)
self._bold = False
self._color = None
self.bold = True if bold else False
if color:
self.color = self.patching_text_color(color)
if checkable is not None:
self.setCheckable(checkable)
if click_callback is not None:
self.clicked.connect(click_callback)
@property
def bold(self):
return self._bold
@bold.setter
def bold(self, bold):
self._bold = bold
font = QtGui.QFont()
font.setBold(True) if bold else font.setBold(False)
self.setFont(font)
@property
def color(self):
return self._color
@color.setter
def color(self, color):
self._color = color
self.setStyleSheet("""
QPushButton
{{
color: {color};
}}
""".format(color=color))
def get_value(self):
return self.isChecked()
def set_value(self, val):
self.setText(str(val))
def patching_text_color(self, color):
return color
class FCLabel(QtWidgets.QLabel):
clicked = QtCore.pyqtSignal(bool)
right_clicked = QtCore.pyqtSignal(bool)
middle_clicked = QtCore.pyqtSignal(bool)
def __init__(self, title=None, color=None, bold=None, size=None, parent=None):
"""