- added ability to control the color of the project items for the dark theme too

This commit is contained in:
Marius Stanciu
2022-04-14 17:59:32 +03:00
committed by Marius
parent f124ccf4df
commit 377d79d413
5 changed files with 99 additions and 35 deletions

View File

@@ -505,8 +505,16 @@ class ObjectCollection(QtCore.QAbstractItemModel):
return index.internalPointer().data(index.column())
if role == Qt.ItemDataRole.ForegroundRole:
color = QColor(self.app.options['global_proj_item_color'][:-2])
color_disabled = QColor(self.app.options['global_proj_item_dis_color'][:-2])
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
theme = theme_settings.value('theme', type=str)
if theme in ['black', 'dark']:
color = QColor(self.app.options['global_proj_item_color_dark'][:-2])
color_disabled = QColor(self.app.options['global_proj_item_dis_color_dark'][:-2])
else:
color = QColor(self.app.options['global_proj_item_color_light'][:-2])
color_disabled = QColor(self.app.options['global_proj_item_dis_color_light'][:-2])
obj = index.internalPointer().obj
if obj:
return QtGui.QBrush(color) if obj.obj_options["plot"] else QtGui.QBrush(color_disabled)