diff --git a/.gitignore b/.gitignore
index f957e1b3..30a8ae85 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,4 @@ build/
.DS_Store
.AppleDouble
.LSOverride
+.vscode
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a0a11a43..1b6724f5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,10 @@ CHANGELOG for FlatCAM Evo beta
- in Geometry Editor, in Copy Tool - work in progress (adding utility geometry for the array mode)
- in Geometry Editor, in Copy Tool - linear array utility geometry is working
- in Geometry Editor, COpy Tool, finished the copy-as-array feature except the 2D array type which was not implemented yet
+- Added new python module dependency for `darkdetect` which is used to detec the operating system appearance
+- Updated code application wide to set theme based on OS appearance at launch
+- Added option to have dark canvas in Light mode
+- Added combination of colors to be used for labels in the Preferences tab. The existing colors have been retained for Light mode and alternative colors added that work better in Dark mode
16.04.2022
@@ -7464,4 +7468,3 @@ Previously added features by Dennis
- Groups in Project view.
- Pan view by dragging in visualizer window with pressed MMB.
- OpenGL-based visualizer.
-
diff --git a/appDatabase.py b/appDatabase.py
index f2fddc2e..ac37adbd 100644
--- a/appDatabase.py
+++ b/appDatabase.py
@@ -200,7 +200,7 @@ class ToolsDB2UI:
self.description_vlay.addStretch()
# Tool Name
- self.name_label = FCLabel('%s:' % _('Name'))
+ self.name_label = FCLabel('%s:' % (self.app.theme_safe_color('red'), _('Name')))
self.name_label.setToolTip(
_("Tool name.\n"
"This is not used in the app, it's function\n"
diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py
index dc39ae36..090ce4d9 100644
--- a/appGUI/MainGUI.py
+++ b/appGUI/MainGUI.py
@@ -41,6 +41,8 @@ import gettext
import appTranslation as fcTranslate
import builtins
+import darkdetect
+
fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
@@ -60,6 +62,20 @@ class MainGUI(QtWidgets.QMainWindow):
self.app = app
self.decimals = self.app.decimals
+ # The menu bar theming differs between operating systems
+ # Windows menu theme is controlled by the application
+ # MacOS menu theme is controlled by OS
+ if sys.platform == 'win32':
+ if self.app.options["global_theme"] == 'light':
+ self.menu_resource_location = 'assets/resources'
+ else:
+ self.menu_resource_location = 'assets/resources/dark_resources'
+ else:
+ if darkdetect.isLight():
+ self.menu_resource_location = 'assets/resources'
+ else:
+ self.menu_resource_location = 'assets/resources/dark_resources'
+
# Divine icon pack by Ipapun @ finicons.com
# #######################################################################
@@ -72,7 +88,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.menu = self.menuBar()
self.menu_toggle_nb = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/notebook32.png'), _("Toggle Panel"))
+ QtGui.QIcon(self.menu_resource_location + '/notebook32.png'), _("Toggle Panel"))
self.menu_toggle_nb.setToolTip(
_("Toggle Panel")
)
@@ -88,7 +104,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.menufile.setToolTipsVisible(True)
# New Project
- self.menufilenewproject = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/file16.png'),
+ self.menufilenewproject = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/file16.png'),
'%s...\t%s' % (_('New Project'), _("Ctrl+N")), self)
self.menufilenewproject.setToolTip(
_("Will create a new, blank project")
@@ -96,88 +112,88 @@ class MainGUI(QtWidgets.QMainWindow):
self.menufile.addAction(self.menufilenewproject)
# New Category (Excellon, Geometry)
- self.menufilenew = self.menufile.addMenu(QtGui.QIcon(self.app.resource_location + '/file16.png'), _('New'))
+ self.menufilenew = self.menufile.addMenu(QtGui.QIcon(self.menu_resource_location + '/file16.png'), _('New'))
self.menufilenew.setToolTipsVisible(True)
self.menufilenewgeo = self.menufilenew.addAction(
- QtGui.QIcon(self.app.resource_location + '/new_file_geo16.png'), '%s\t%s' % (_('Geometry'), _('N')))
+ QtGui.QIcon(self.menu_resource_location + '/new_file_geo16.png'), '%s\t%s' % (_('Geometry'), _('N')))
self.menufilenewgeo.setToolTip(
_("Will create a new, empty Geometry Object.")
)
self.menufilenewgrb = self.menufilenew.addAction(
- QtGui.QIcon(self.app.resource_location + '/new_file_grb16.png'), '%s\t%s' % (_('Gerber'), _('B')))
+ QtGui.QIcon(self.menu_resource_location + '/new_file_grb16.png'), '%s\t%s' % (_('Gerber'), _('B')))
self.menufilenewgrb.setToolTip(
_("Will create a new, empty Gerber Object.")
)
self.menufilenewexc = self.menufilenew.addAction(
- QtGui.QIcon(self.app.resource_location + '/new_file_exc16.png'), '%s\t%s' % (_('Excellon'), _('L')))
+ QtGui.QIcon(self.menu_resource_location + '/new_file_exc16.png'), '%s\t%s' % (_('Excellon'), _('L')))
self.menufilenewexc.setToolTip(
_("Will create a new, empty Excellon Object.")
)
self.menufilenew.addSeparator()
self.menufilenewdoc = self.menufilenew.addAction(
- QtGui.QIcon(self.app.resource_location + '/notes16_1.png'), '%s\t%s' % (_('Document'), _('D')))
+ QtGui.QIcon(self.menu_resource_location + '/notes16_1.png'), '%s\t%s' % (_('Document'), _('D')))
self.menufilenewdoc.setToolTip(
_("Will create a new, empty Document Object.")
)
self.menufile_open = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/folder32_bis.png'), '%s' % _('Open'))
+ QtGui.QIcon(self.menu_resource_location + '/folder32_bis.png'), '%s' % _('Open'))
self.menufile_open.setToolTipsVisible(True)
# Open Project ...
self.menufileopenproject = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/folder16.png'), '%s...\t%s' % (_('Open Project'), _('Ctrl+O')),
+ QtGui.QIcon(self.menu_resource_location + '/folder16.png'), '%s...\t%s' % (_('Open Project'), _('Ctrl+O')),
self)
self.menufile_open.addAction(self.menufileopenproject)
self.menufile_open.addSeparator()
# Open Gerber ...
- self.menufileopengerber = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/flatcam_icon24.png'),
+ self.menufileopengerber = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/flatcam_icon24.png'),
'%s...\t%s' % (_('Open Gerber'), _('Ctrl+G')), self)
self.menufile_open.addAction(self.menufileopengerber)
# Open Excellon ...
- self.menufileopenexcellon = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/open_excellon32.png'),
+ self.menufileopenexcellon = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/open_excellon32.png'),
'%s...\t%s' % (_('Open Excellon'), _('Ctrl+E')), self)
self.menufile_open.addAction(self.menufileopenexcellon)
# Open G-Code ...
self.menufileopengcode = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/code.png'), '%s...\t%s' % (_('Open G-Code'), ''), self)
+ QtGui.QIcon(self.menu_resource_location + '/code.png'), '%s...\t%s' % (_('Open G-Code'), ''), self)
self.menufile_open.addAction(self.menufileopengcode)
self.menufile_open.addSeparator()
# Open Config File...
self.menufileopenconfig = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/folder16.png'), '%s...\t%s' % (_('Open Config'), ''), self)
+ QtGui.QIcon(self.menu_resource_location + '/folder16.png'), '%s...\t%s' % (_('Open Config'), ''), self)
self.menufile_open.addAction(self.menufileopenconfig)
# Recent
self.recent_projects = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/recent_files.png'), _("Recent projects"))
+ QtGui.QIcon(self.menu_resource_location + '/recent_files.png'), _("Recent projects"))
self.recent = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/recent_files.png'), _("Recent files"))
+ QtGui.QIcon(self.menu_resource_location + '/recent_files.png'), _("Recent files"))
# SAVE category
- self.menufile_save = self.menufile.addMenu(QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save'))
+ self.menufile_save = self.menufile.addMenu(QtGui.QIcon(self.menu_resource_location + '/save_as.png'), _('Save'))
# Save Project
self.menufilesaveproject = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/floppy16.png'), '%s...\t%s' % (_('Save Project'), _('Ctrl+S')),
+ QtGui.QIcon(self.menu_resource_location + '/floppy16.png'), '%s...\t%s' % (_('Save Project'), _('Ctrl+S')),
self)
self.menufile_save.addAction(self.menufilesaveproject)
# Save Project As ...
- self.menufilesaveprojectas = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/floppy16.png'),
+ self.menufilesaveprojectas = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/floppy16.png'),
'%s...\t%s' % (_('Save Project As'), _('Ctrl+Shift+S')), self)
self.menufile_save.addAction(self.menufilesaveprojectas)
# Save Project Copy ...
# self.menufilesaveprojectcopy = QtGui.QAction(
- # QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('Save Project Copy ...'), self)
+ # QtGui.QIcon(self.menu_resource_location + '/floppy16.png'), _('Save Project Copy ...'), self)
# self.menufile_save.addAction(self.menufilesaveprojectcopy)
self.menufile_save.addSeparator()
@@ -187,18 +203,18 @@ class MainGUI(QtWidgets.QMainWindow):
# Scripting
self.menufile_scripting = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/script16.png'), _('Scripting'))
+ QtGui.QIcon(self.menu_resource_location + '/script16.png'), _('Scripting'))
self.menufile_scripting.setToolTipsVisible(True)
- self.menufilenewscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/script_new16.png'),
+ self.menufilenewscript = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/script_new16.png'),
'%s...\t%s' % (_('New Script'), ''), self)
- self.menufileopenscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/open_script32.png'),
+ self.menufileopenscript = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/open_script32.png'),
'%s...\t%s' % (_('Open Script'), ''), self)
self.menufileopenscriptexample = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/open_script32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/open_script32.png'),
'%s...\t%s' % (_('Open Example'), ''), self)
self.menufilerunscript = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/script16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/script16.png'),
'%s...\t%s' % (_('Run Script'), _('Shift+S')), self)
self.menufilerunscript.setToolTip(
_("Will run the opened Tcl Script thus\n"
@@ -216,51 +232,51 @@ class MainGUI(QtWidgets.QMainWindow):
# Import ...
self.menufileimport = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/import.png'), _('Import'))
+ QtGui.QIcon(self.menu_resource_location + '/import.png'), _('Import'))
self.menufileimportsvg = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/svg16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/svg16.png'),
'%s...\t%s' % (_('SVG as Geometry Object'), ''), self)
self.menufileimport.addAction(self.menufileimportsvg)
self.menufileimportsvg_as_gerber = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/svg16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/svg16.png'),
'%s...\t%s' % (_('SVG as Gerber Object'), ''), self)
self.menufileimport.addAction(self.menufileimportsvg_as_gerber)
self.menufileimport.addSeparator()
self.menufileimportdxf = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/dxf16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/dxf16.png'),
'%s...\t%s' % (_('DXF as Geometry Object'), ''), self)
self.menufileimport.addAction(self.menufileimportdxf)
self.menufileimportdxf_as_gerber = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/dxf16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/dxf16.png'),
'%s...\t%s' % (_('DXF as Gerber Object'), ''), self)
self.menufileimport.addAction(self.menufileimportdxf_as_gerber)
self.menufileimport.addSeparator()
self.menufileimport_hpgl2_as_geo = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/dxf16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/dxf16.png'),
'%s...\t%s' % (_('HPGL2 as Geometry Object'), ''), self)
self.menufileimport.addAction(self.menufileimport_hpgl2_as_geo)
self.menufileimport.addSeparator()
# Export ...
self.menufileexport = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/export.png'), _('Export'))
+ QtGui.QIcon(self.menu_resource_location + '/export.png'), _('Export'))
self.menufileexport.setToolTipsVisible(True)
self.menufileexportsvg = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/export.png'),
+ QtGui.QIcon(self.menu_resource_location + '/export.png'),
'%s...\t%s' % (_('Export SVG'), ''), self)
self.menufileexport.addAction(self.menufileexportsvg)
self.menufileexportdxf = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/export.png'),
+ QtGui.QIcon(self.menu_resource_location + '/export.png'),
'%s...\t%s' % (_('Export DXF'), ''), self)
self.menufileexport.addAction(self.menufileexportdxf)
self.menufileexport.addSeparator()
self.menufileexportpng = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/export_png32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/export_png32.png'),
'%s...\t%s' % (_('Export PNG'), ''), self)
self.menufileexportpng.setToolTip(
_("Will export an image in PNG format,\n"
@@ -272,7 +288,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.menufileexport.addSeparator()
self.menufileexportexcellon = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/drill32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/drill32.png'),
'%s...\t%s' % (_('Export Excellon'), ''), self)
self.menufileexportexcellon.setToolTip(
_("Will export an Excellon Object as Excellon file,\n"
@@ -282,7 +298,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.menufileexport.addAction(self.menufileexportexcellon)
self.menufileexportgerber = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/flatcam_icon32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/flatcam_icon32.png'),
'%s...\t%s' % (_('Export Gerber'), ''), self)
self.menufileexportgerber.setToolTip(
_("Will export an Gerber Object as Gerber file,\n"
@@ -295,18 +311,18 @@ class MainGUI(QtWidgets.QMainWindow):
self.menufile.addSeparator()
self.menufile_backup = self.menufile.addMenu(
- QtGui.QIcon(self.app.resource_location + '/backup24.png'), _('Backup'))
+ QtGui.QIcon(self.menu_resource_location + '/backup24.png'), _('Backup'))
# Import Preferences
self.menufileimportpref = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/backup_import24.png'),
+ QtGui.QIcon(self.menu_resource_location + '/backup_import24.png'),
'%s...\t%s' % (_('Import Preferences from file'), ''), self
)
self.menufile_backup.addAction(self.menufileimportpref)
# Export Preferences
self.menufileexportpref = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/backup_export24.png'),
+ QtGui.QIcon(self.menu_resource_location + '/backup_export24.png'),
'%s...\t%s' % (_('Export Preferences to file'), ''), self)
self.menufile_backup.addAction(self.menufileexportpref)
@@ -315,14 +331,14 @@ class MainGUI(QtWidgets.QMainWindow):
# Save Defaults
self.menufilesavedefaults = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/defaults.png'),
+ QtGui.QIcon(self.menu_resource_location + '/defaults.png'),
'%s\t%s' % (_('Save Preferences'), ''), self)
self.menufile_backup.addAction(self.menufilesavedefaults)
# Separator
self.menufile.addSeparator()
self.menufile_print = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/printer32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/printer32.png'),
'%s\t%s' % (_('Print (PDF)'), _('Ctrl+P')))
self.menufile.addAction(self.menufile_print)
@@ -331,7 +347,7 @@ class MainGUI(QtWidgets.QMainWindow):
# Quit
self.menufile_exit = QtGui.QAction(
- QtGui.QIcon(self.app.resource_location + '/power16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/power16.png'),
'%s\t%s' % (_('Exit'), ''), self)
# exitAction.setShortcut('Ctrl+Q')
# exitAction.setStatusTip('Exit application')
@@ -344,10 +360,10 @@ class MainGUI(QtWidgets.QMainWindow):
# Separator
self.menuedit.addSeparator()
self.menueditedit = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/edit16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/edit16.png'),
'%s\t%s' % (_('Edit Object'), _('E')))
self.menueditok = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/power16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/power16.png'),
'%s\t%s' % (_('Exit Editor'), _('Ctrl+S')))
# adjust the initial state of the menu entries related to the editor
@@ -358,17 +374,17 @@ class MainGUI(QtWidgets.QMainWindow):
# Separator
self.menuedit.addSeparator()
self.menuedit_convert = self.menuedit.addMenu(
- QtGui.QIcon(self.app.resource_location + '/convert24.png'), _('Conversion'))
+ QtGui.QIcon(self.menu_resource_location + '/convert24.png'), _('Conversion'))
self.menuedit_convert_sg2mg = self.menuedit_convert.addAction(
- QtGui.QIcon(self.app.resource_location + '/convert24.png'),
+ QtGui.QIcon(self.menu_resource_location + '/convert24.png'),
'%s\t%s' % (_('Convert Single to MultiGeo'), ''))
self.menuedit_convert_sg2mg.setToolTip(
_("Will convert a Geometry object from single_geometry type\n"
"to a multi_geometry type.")
)
self.menuedit_convert_mg2sg = self.menuedit_convert.addAction(
- QtGui.QIcon(self.app.resource_location + '/convert24.png'),
+ QtGui.QIcon(self.menu_resource_location + '/convert24.png'),
'%s\t%s' % (_('Convert Multi to SingleGeo'), ''))
self.menuedit_convert_mg2sg.setToolTip(
_("Will convert a Geometry object from multi_geometry type\n"
@@ -377,21 +393,21 @@ class MainGUI(QtWidgets.QMainWindow):
# Separator
self.menuedit_convert.addSeparator()
self.menueditconvert_any2geo = self.menuedit_convert.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy_geo.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy_geo.png'),
'%s\t%s' % (_('Convert Any to Geo'), ''))
self.menueditconvert_any2gerber = self.menuedit_convert.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy_geo.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy_geo.png'),
'%s\t%s' % (_('Convert Any to Gerber'), ''))
self.menueditconvert_any2excellon = self.menuedit_convert.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy_geo.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy_geo.png'),
'%s\t%s' % (_('Convert Any to Excellon'), ''))
self.menuedit_convert.setToolTipsVisible(True)
# ############################ EDIT -> JOIN ######################################################
self.menuedit_join = self.menuedit.addMenu(
- QtGui.QIcon(self.app.resource_location + '/join16.png'), _('Join Objects'))
+ QtGui.QIcon(self.menu_resource_location + '/join16.png'), _('Join Objects'))
self.menuedit_join2geo = self.menuedit_join.addAction(
- QtGui.QIcon(self.app.resource_location + '/join16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/join16.png'),
'%s\t%s' % (_('Join Geo/Gerber/Exc -> Geo'), ''))
self.menuedit_join2geo.setToolTip(
_("Merge a selection of objects, which can be of type:\n"
@@ -401,13 +417,13 @@ class MainGUI(QtWidgets.QMainWindow):
"into a new combo Geometry object.")
)
self.menuedit_join_exc2exc = self.menuedit_join.addAction(
- QtGui.QIcon(self.app.resource_location + '/join16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/join16.png'),
'%s\t%s' % (_('Join Excellon(s) -> Excellon'), ''))
self.menuedit_join_exc2exc.setToolTip(
_("Merge a selection of Excellon objects into a new combo Excellon object.")
)
self.menuedit_join_grb2grb = self.menuedit_join.addAction(
- QtGui.QIcon(self.app.resource_location + '/join16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/join16.png'),
'%s\t%s' % (_('Join Gerber(s) -> Gerber'), ''))
self.menuedit_join_grb2grb.setToolTip(
_("Merge a selection of Gerber objects into a new combo Gerber object.")
@@ -418,50 +434,50 @@ class MainGUI(QtWidgets.QMainWindow):
# Separator
self.menuedit.addSeparator()
self.menueditcopyobject = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy.png'),
'%s\t%s' % (_('Copy'), _('Ctrl+C')))
# Separator
self.menuedit.addSeparator()
self.menueditdelete = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/trash16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/trash16.png'),
'%s\t%s' % (_('Delete'), _('DEL')))
# Separator
self.menuedit.addSeparator()
self.menuedit_numeric_move = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/move32_bis.png'),
+ QtGui.QIcon(self.menu_resource_location + '/move32_bis.png'),
'%s\t%s' % (_('Num Move'), ''))
self.menueditorigin = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/origin16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/origin16.png'),
'%s\t%s' % (_('Set Origin'), _('O')))
self.menuedit_move2origin = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/origin2_16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/origin2_16.png'),
'%s\t%s' % (_('Move to Origin'), _('Shift+O')))
self.menuedit_center_in_origin = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/origin3_32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/origin3_32.png'),
'%s\t%s' % (_('Custom Origin'), ''))
self.menueditjump = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/jump_to16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/jump_to16.png'),
'%s\t%s' % (_('Jump to Location'), _('J')))
self.menueditlocate = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/locate16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/locate16.png'),
'%s\t%s' % (_('Locate in Object'), _('Shift+J')))
# Separator
self.menuedit.addSeparator()
self.menuedittoggleunits = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/toggle_units16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/toggle_units16.png'),
'%s\t%s' % (_('Toggle Units'), _('Q')))
self.menueditselectall = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/select_all.png'),
+ QtGui.QIcon(self.menu_resource_location + '/select_all.png'),
'%s\t%s' % (_('Select All'), _('Ctrl+A')))
# Separator
self.menuedit.addSeparator()
self.menueditpreferences = self.menuedit.addAction(
- QtGui.QIcon(self.app.resource_location + '/pref.png'),
+ QtGui.QIcon(self.menu_resource_location + '/pref.png'),
'%s\t%s' % (_('Preferences'), _('Shift+P')))
# #############################################################################################################
@@ -470,44 +486,44 @@ class MainGUI(QtWidgets.QMainWindow):
self.menuoptions = self.menu.addMenu(_('Options'))
self.menuoptions_transform_rotate = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/rotate.png'),
+ QtGui.QIcon(self.menu_resource_location + '/rotate.png'),
'%s\t%s' % (_("Rotate Selection"), _('Shift+(R)')))
# Separator
self.menuoptions.addSeparator()
self.menuoptions_transform_skewx = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/skewX.png'),
+ QtGui.QIcon(self.menu_resource_location + '/skewX.png'),
'%s\t%s' % (_("Skew on X axis"), _('Shift+X')))
self.menuoptions_transform_skewy = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/skewY.png'),
+ QtGui.QIcon(self.menu_resource_location + '/skewY.png'),
'%s\t%s' % (_("Skew on Y axis"), _('Shift+Y')))
# Separator
self.menuoptions.addSeparator()
self.menuoptions_transform_flipx = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/flipx.png'),
+ QtGui.QIcon(self.menu_resource_location + '/flipx.png'),
'%s\t%s' % (_("Flip on X axis"), _('X')))
self.menuoptions_transform_flipy = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/flipy.png'),
+ QtGui.QIcon(self.menu_resource_location + '/flipy.png'),
'%s\t%s' % (_("Flip on Y axis"), _('Y')))
# Separator
self.menuoptions.addSeparator()
self.menuoptions_view_source = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/source32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/source32.png'),
'%s\t%s' % (_("View source"), _('Alt+S')))
self.menuoptions_tools_db = self.menuoptions.addAction(
- QtGui.QIcon(self.app.resource_location + '/database32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/database32.png'),
'%s\t%s' % (_("Tools Database"), _('Ctrl+D')))
# Separator
self.menuoptions.addSeparator()
# ########################### Options ->Experimental ##########################################################
self.menuoptions_experimental = self.menuoptions.addMenu(
- QtGui.QIcon(self.app.resource_location + '/experiment32.png'), _('Experimental'))
+ QtGui.QIcon(self.menu_resource_location + '/experiment32.png'), _('Experimental'))
self.menuoptions_experimental_3D_area = self.menuoptions_experimental.addAction(
- QtGui.QIcon(self.app.resource_location + '/3D_area32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/3D_area32.png'),
'%s\t%s' % (_('3D Area'), ''))
# Separator
self.menuoptions.addSeparator()
@@ -517,71 +533,71 @@ class MainGUI(QtWidgets.QMainWindow):
# #############################################################################################################
self.menuview = self.menu.addMenu(_('View'))
self.menuviewenable = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/replot16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/replot16.png'),
'%s\t%s' % (_('Enable all'), _('Alt+1')))
self.menuviewdisableall = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/clear_plot16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/clear_plot16.png'),
'%s\t%s' % (_('Disable all'), _('Alt+2')))
self.menuviewenableother = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/replot16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/replot16.png'),
'%s\t%s' % (_('Enable non-selected'), _('Alt+3')))
self.menuviewdisableother = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/clear_plot16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/clear_plot16.png'),
'%s\t%s' % (_('Disable non-selected'), _('Alt+4')))
# Separator
self.menuview.addSeparator()
self.menuview_zoom_fit = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/zoom_fit32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/zoom_fit32.png'),
'%s\t%s' % (_("Zoom Fit"), _('V')))
self.menuview_zoom_in = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/zoom_in32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/zoom_in32.png'),
'%s\t%s' % (_("Zoom In"), _('=')))
self.menuview_zoom_out = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/zoom_out32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/zoom_out32.png'),
'%s\t%s' % (_("Zoom Out"), _('-')))
self.menuview.addSeparator()
# Replot all
self.menuview_replot = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/replot32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/replot32.png'),
'%s\t%s' % (_("Redraw All"), _('F5')))
self.menuview.addSeparator()
self.menuview_toggle_code_editor = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/code_editor32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/code_editor32.png'),
'%s\t%s' % (_('Toggle Code Editor'), _('Shift+E')))
self.menuview.addSeparator()
self.menuview_toggle_fscreen = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/fscreen32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/fscreen32.png'),
'%s\t%s' % (_("Toggle FullScreen"), _('Alt+F10')))
self.menuview_toggle_parea = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/plot32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/plot32.png'),
'%s\t%s' % (_("Toggle Plot Area"), _('Ctrl+F10')))
self.menuview_toggle_notebook = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/notebook32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/notebook32.png'),
'%s\t%s' % (_("Toggle Project/Properties/Tool"), _('`')))
self.menuview.addSeparator()
self.menuview_toggle_grid = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/grid32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/grid32.png'),
'%s\t%s' % (_("Toggle Grid Snap"), _('G')))
self.menuview_toggle_grid_lines = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/grid_lines32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/grid_lines32.png'),
'%s\t%s' % (_("Toggle Grid Lines"), _('Shift+G')))
self.menuview_toggle_axis = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/axis32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/axis32.png'),
'%s\t%s' % (_("Toggle Axis"), _('Shift+A')))
self.menuview_toggle_workspace = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/workspace24.png'),
+ QtGui.QIcon(self.menu_resource_location + '/workspace24.png'),
'%s\t%s' % (_("Toggle Workspace"), _('Shift+W')))
self.menuview_toggle_hud = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/hud_32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/hud_32.png'),
'%s\t%s' % (_("Toggle HUD"), _('Shift+H')))
self.menuview.addSeparator()
self.menuview_show_log = self.menuview.addAction(
- QtGui.QIcon(self.app.resource_location + '/log32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/log32.png'),
'%s\t%s' % (_("Error Log"), ''))
# ########################################################################
@@ -590,10 +606,10 @@ class MainGUI(QtWidgets.QMainWindow):
self.menuobjects = self.menu.addMenu(_('Objects'))
self.menuobjects.addSeparator()
self.menuobjects_selall = self.menuobjects.addAction(
- QtGui.QIcon(self.app.resource_location + '/select_all.png'),
+ QtGui.QIcon(self.menu_resource_location + '/select_all.png'),
'%s\t%s' % (_('Select All'), ''))
self.menuobjects_unselall = self.menuobjects.addAction(
- QtGui.QIcon(self.app.resource_location + '/deselect_all32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/deselect_all32.png'),
'%s\t%s' % (_('Deselect All'), ''))
# ########################################################################
@@ -602,7 +618,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.menu_plugins = QtWidgets.QMenu(_('Plugins'))
self.menu_plugins_action = self.menu.addMenu(self.menu_plugins)
self.menu_plugins_shell = self.menu_plugins.addAction(
- QtGui.QIcon(self.app.resource_location + '/shell16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/shell16.png'),
'%s\t%s' % (_('Command Line'), _('S')))
# ########################################################################
@@ -610,49 +626,49 @@ class MainGUI(QtWidgets.QMainWindow):
# ########################################################################
self.menuhelp = self.menu.addMenu(_('Help'))
self.menuhelp_manual = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/globe16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/globe16.png'),
'%s\t%s' % (_('Online Help'), _('F1')))
self.menuhelp_bookmarks = self.menuhelp.addMenu(
- QtGui.QIcon(self.app.resource_location + '/bookmarks16.png'), _('Bookmarks'))
+ QtGui.QIcon(self.menu_resource_location + '/bookmarks16.png'), _('Bookmarks'))
self.menuhelp_bookmarks.addSeparator()
self.menuhelp_bookmarks_manager = self.menuhelp_bookmarks.addAction(
- QtGui.QIcon(self.app.resource_location + '/bookmarks16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/bookmarks16.png'),
'%s\t%s' % (_('Bookmarks Manager'), ''))
self.menuhelp.addSeparator()
self.menuhelp_report_bug = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/bug16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/bug16.png'),
'%s\t%s' % (_('Report a bug'), ''))
self.menuhelp.addSeparator()
self.menuhelp_exc_spec = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/pdf_link16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/pdf_link16.png'),
'%s\t%s' % (_('Excellon Specification'), ''))
self.menuhelp_gerber_spec = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/pdf_link16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/pdf_link16.png'),
'%s\t%s' % (_('Gerber Specification'), ''))
self.menuhelp.addSeparator()
self.menuhelp_shortcut_list = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/shortcuts24.png'),
+ QtGui.QIcon(self.menu_resource_location + '/shortcuts24.png'),
'%s\t%s' % (_('Shortcuts List'), _('F3')))
self.menuhelp_videohelp = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/youtube32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/youtube32.png'),
'%s\t%s' % (_('YouTube Channel'), _('F4')))
self.menuhelp.addSeparator()
self.menuhelp_donate = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/paypal32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/paypal32.png'),
'%s\t%s' % (_('Donate'), ''))
self.menuhelp_readme = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/warning.png'),
+ QtGui.QIcon(self.menu_resource_location + '/warning.png'),
'%s\t%s' % (_("How To"), ''))
self.menuhelp_about = self.menuhelp.addAction(
- QtGui.QIcon(self.app.resource_location + '/about32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/about32.png'),
'%s\t%s' % (_('About'), ''))
# ########################################################################
@@ -662,79 +678,79 @@ class MainGUI(QtWidgets.QMainWindow):
self.menu.addMenu(self.geo_editor_menu)
self.geo_add_circle_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/circle32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/circle32.png'),
'%s\t%s' % (_('Add Circle'), _('O'))
)
self.geo_add_arc_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/arc16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/arc16.png'),
'%s\t%s' % (_('Add Arc'), _('A')))
self.geo_editor_menu.addSeparator()
self.geo_add_rectangle_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/rectangle32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/rectangle32.png'),
'%s\t%s' % (_('Add Rectangle'), _('R'))
)
self.geo_add_polygon_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/polygon32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/polygon32.png'),
'%s\t%s' % (_('Add Polygon'), _('N'))
)
self.geo_add_path_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/path32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/path32.png'),
'%s\t%s' % (_('Add Path'), _('P')))
self.geo_editor_menu.addSeparator()
self.geo_add_text_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/text32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/text32.png'),
'%s\t%s' % (_('Add Text'), _('T')))
self.geo_editor_menu.addSeparator()
self.geo_union_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/union16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/union16.png'),
'%s\t%s' % (_('Polygon Union'), _('U')))
self.geo_intersection_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/intersection16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/intersection16.png'),
'%s\t%s' % (_('Polygon Intersection'), _('E')))
self.geo_subtract_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/subtract16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/subtract16.png'),
'%s\t%s' % (_('Polygon Subtraction'), _('S'))
)
self.geo_subtract_alt_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/subtract16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/subtract16.png'),
'%s\t%s' % (_('Alt Subtraction'), '')
)
self.geo_editor_menu.addSeparator()
self.geo_cutpath_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/cutpath16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/cutpath16.png'),
'%s\t%s' % (_('Cut Path'), _('X')))
# self.move_menuitem = self.menu.addAction(
- # QtGui.QIcon(self.app.resource_location + '/move16.png'), "Move Objects 'm'")
+ # QtGui.QIcon(self.menu_resource_location + '/move16.png'), "Move Objects 'm'")
self.geo_copy_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy16.png'),
'%s\t%s' % (_("Copy Geom"), _('C')))
self.geo_delete_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/deleteshape16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/deleteshape16.png'),
'%s\t%s' % (_("Delete Shape"), _('DEL'))
)
self.geo_editor_menu.addSeparator()
self.geo_move_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/move32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/move32.png'),
'%s\t%s' % (_("Move"), _('M')))
self.geo_buffer_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/buffer16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/buffer16.png'),
'%s\t%s' % (_("Buffer"), _('B'))
)
self.geo_simplification_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/simplify32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/simplify32.png'),
'%s\t%s' % (_("Simplification"), '')
)
self.geo_paint_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/paint20_1.png'),
+ QtGui.QIcon(self.menu_resource_location + '/paint20_1.png'),
'%s\t%s' % (_("Paint"), _('I'))
)
self.geo_transform_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/transform.png'),
+ QtGui.QIcon(self.menu_resource_location + '/transform.png'),
'%s\t%s' % (_("Transformation"), _('Alt+R'))
)
self.geo_editor_menu.addSeparator()
self.geo_cornersnap_menuitem = self.geo_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/corner32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/corner32.png'),
'%s\t%s' % (_("Toggle Corner Snap"), _('K'))
)
@@ -745,36 +761,36 @@ class MainGUI(QtWidgets.QMainWindow):
self.menu.addMenu(self.exc_editor_menu)
self.exc_add_array_drill_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/rectangle32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/rectangle32.png'),
'%s\t%s' % (_('Add Drill Array'), _('A')))
self.exc_add_drill_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/plus16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/plus16.png'),
'%s\t%s' % (_('Add Drill'), _('D')))
self.exc_editor_menu.addSeparator()
self.exc_add_array_slot_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/slot_array26.png'),
+ QtGui.QIcon(self.menu_resource_location + '/slot_array26.png'),
'%s\t%s' % (_('Add Slot Array'), _('Q')))
self.exc_add_slot_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/slot26.png'),
+ QtGui.QIcon(self.menu_resource_location + '/slot26.png'),
'%s\t%s' % (_('Add Slot'), _('W')))
self.exc_editor_menu.addSeparator()
self.exc_resize_drill_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/resize16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/resize16.png'),
'%s\t%s' % (_('Resize Drill(S)'), _('R'))
)
self.exc_copy_drill_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy32.png'),
'%s\t%s' % (_('Copy'), _('C')))
self.exc_delete_drill_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/deleteshape32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/deleteshape32.png'),
'%s\t%s' % (_('Delete'), _('DEL'))
)
self.exc_editor_menu.addSeparator()
self.exc_move_drill_menuitem = self.exc_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/move32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/move32.png'),
'%s\t%s' % (_('Move Drill'), _('M')))
# ########################################################################
@@ -784,55 +800,55 @@ class MainGUI(QtWidgets.QMainWindow):
self.menu.addMenu(self.grb_editor_menu)
self.grb_add_pad_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/aperture16.png'),
+ QtGui.QIcon(self.menu_resource_location + '/aperture16.png'),
'%s\t%s' % (_('Add Pad'), _('P')))
self.grb_add_pad_array_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/padarray32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/padarray32.png'),
'%s\t%s' % (_('Add Pad Array'), _('A')))
self.grb_add_track_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/track32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/track32.png'),
'%s\t%s' % (_('Add Track'), _('T')))
self.grb_add_region_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/rectangle32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/rectangle32.png'),
'%s\t%s' % (_('Add Region'), _('N')))
self.grb_editor_menu.addSeparator()
self.grb_convert_poly_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/poligonize32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/poligonize32.png'),
'%s\t%s' % (_("Poligonize"), _('Alt+N')))
self.grb_add_semidisc_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/semidisc32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/semidisc32.png'),
'%s\t%s' % (_("Add SemiDisc"), _('E')))
self.grb_add_disc_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/disc32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/disc32.png'),
'%s\t%s' % (_("Add Disc"), _('D')))
self.grb_add_buffer_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/buffer16-2.png'),
+ QtGui.QIcon(self.menu_resource_location + '/buffer16-2.png'),
'%s\t%s' % (_('Buffer'), _('B')))
self.grb_add_scale_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/scale32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/scale32.png'),
'%s\t%s' % (_('Scale'), _('S')))
self.grb_add_markarea_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/markarea32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/markarea32.png'),
'%s\t%s' % (_('Mark Area'), _('Alt+A')))
self.grb_add_eraser_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/eraser26.png'),
+ QtGui.QIcon(self.menu_resource_location + '/eraser26.png'),
'%s\t%s' % (_('Eraser'), _('Ctrl+E')))
self.grb_transform_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/transform.png'),
+ QtGui.QIcon(self.menu_resource_location + '/transform.png'),
'%s\t%s' % (_("Transform"), _('Alt+R')))
self.grb_editor_menu.addSeparator()
self.grb_copy_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/copy32.png'),
'%s\t%s' % (_('Copy'), _('C')))
self.grb_delete_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/deleteshape32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/deleteshape32.png'),
'%s\t%s' % (_('Delete'), _('DEL')))
self.grb_editor_menu.addSeparator()
self.grb_move_menuitem = self.grb_editor_menu.addAction(
- QtGui.QIcon(self.app.resource_location + '/move32.png'),
+ QtGui.QIcon(self.menu_resource_location + '/move32.png'),
'%s\t%s' % (_('Move'), _('M')))
self.grb_editor_menu.menuAction().setVisible(False)
@@ -850,71 +866,71 @@ class MainGUI(QtWidgets.QMainWindow):
self.menuproject = QtWidgets.QMenu()
self.menuprojectenable = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/replot32.png'), _('Enable Plot'))
+ QtGui.QIcon(self.menu_resource_location + '/replot32.png'), _('Enable Plot'))
self.menuprojectdisable = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/clear_plot32.png'), _('Disable Plot'))
+ QtGui.QIcon(self.menu_resource_location + '/clear_plot32.png'), _('Disable Plot'))
self.menuproject.addSeparator()
self.menuprojectcolor = self.menuproject.addMenu(
- QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Set Color'))
+ QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Set Color'))
self.menuproject_red = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/red32.png'), _('Red'))
+ QtGui.QIcon(self.menu_resource_location + '/red32.png'), _('Red'))
self.menuproject_blue = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/blue32.png'), _('Blue'))
+ QtGui.QIcon(self.menu_resource_location + '/blue32.png'), _('Blue'))
self.menuproject_yellow = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/yellow32.png'), _('Yellow'))
+ QtGui.QIcon(self.menu_resource_location + '/yellow32.png'), _('Yellow'))
self.menuproject_green = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/green32.png'), _('Green'))
+ QtGui.QIcon(self.menu_resource_location + '/green32.png'), _('Green'))
self.menuproject_purple = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/violet32.png'), _('Purple'))
+ QtGui.QIcon(self.menu_resource_location + '/violet32.png'), _('Purple'))
self.menuproject_brown = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/brown32.png'), _('Brown'))
+ QtGui.QIcon(self.menu_resource_location + '/brown32.png'), _('Brown'))
self.menuproject_brown = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/indigo32.png'), _('Indigo'))
+ QtGui.QIcon(self.menu_resource_location + '/indigo32.png'), _('Indigo'))
self.menuproject_brown = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/white32.png'), _('White'))
+ QtGui.QIcon(self.menu_resource_location + '/white32.png'), _('White'))
self.menuproject_brown = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/black32.png'), _('Black'))
+ QtGui.QIcon(self.menu_resource_location + '/black32.png'), _('Black'))
self.menuprojectcolor.addSeparator()
self.menuproject_custom = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Custom'))
+ QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Custom'))
self.menuprojectcolor.addSeparator()
self.menuproject_custom = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Opacity'))
+ QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Opacity'))
self.menuproject_custom = self.menuprojectcolor.addAction(
- QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Default'))
+ QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Default'))
self.menuproject.addSeparator()
self.menuprojectviewsource = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/source32.png'), _('View Source'))
+ QtGui.QIcon(self.menu_resource_location + '/source32.png'), _('View Source'))
self.menuprojectedit = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/edit_ok32.png'), _('Edit'))
+ QtGui.QIcon(self.menu_resource_location + '/edit_ok32.png'), _('Edit'))
self.menuprojectcopy = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/copy32.png'), _('Copy'))
+ QtGui.QIcon(self.menu_resource_location + '/copy32.png'), _('Copy'))
self.menuprojectdelete = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/delete32.png'), _('Delete'))
+ QtGui.QIcon(self.menu_resource_location + '/delete32.png'), _('Delete'))
self.menuprojectsave = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save'))
+ QtGui.QIcon(self.menu_resource_location + '/save_as.png'), _('Save'))
self.menuproject.addSeparator()
self.menuprojectproperties = self.menuproject.addAction(
- QtGui.QIcon(self.app.resource_location + '/properties32.png'), _('Properties'))
+ QtGui.QIcon(self.menu_resource_location + '/properties32.png'), _('Properties'))
# ########################################################################
# ####################### Central Widget -> Splitter # ##################
@@ -2355,7 +2371,7 @@ class MainGUI(QtWidgets.QMainWindow):
self.app.log.debug("Clearing the settings in QSettings. GUI settings cleared.")
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
- theme_settings.setValue('theme', 'white')
+ theme_settings.setValue('theme', 'light')
del theme_settings
diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py
index 3f162c48..b499f599 100644
--- a/appGUI/ObjectUI.py
+++ b/appGUI/ObjectUI.py
@@ -40,12 +40,12 @@ class ObjectUI(QtWidgets.QWidget):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
- self.resource_loc = 'assets/resources'
+ self.resource_loc = 'assets/resources/dark_resources'
layout = QtWidgets.QVBoxLayout()
self.setLayout(layout)
@@ -89,7 +89,7 @@ class ObjectUI(QtWidgets.QWidget):
# #############################################################################################################
# Transformations Frame
# #############################################################################################################
- self.transform_label = FCLabel('%s' % _('Transformations'))
+ self.transform_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Transformations')))
self.transform_label.setToolTip(
_("Geometrical transformations of the current object.")
)
@@ -182,7 +182,7 @@ class GerberObjectUI(ObjectUI):
ObjectUI.__init__(self, title=_('Gerber Object'), parent=parent, app=self.app)
- self.general_label = FCLabel('%s' % _("General Information"))
+ self.general_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("General Information")))
self.general_label.setToolTip(_("General data about the object."))
self.custom_box.addWidget(self.general_label)
@@ -284,7 +284,7 @@ class GerberObjectUI(ObjectUI):
# #############################################################################################################
# Gerber Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(_("Tools/apertures in the loaded object."))
self.custom_box.addWidget(self.tools_table_label)
@@ -371,7 +371,7 @@ class GerberObjectUI(ObjectUI):
# #############################################################################################################
# PLUGINS Frame
# #############################################################################################################
- self.tool_lbl = FCLabel('%s' % _("Plugins"))
+ self.tool_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Plugins")))
self.custom_box.addWidget(self.tool_lbl)
plugins_frame = FCFrame()
@@ -589,19 +589,19 @@ class ExcellonObjectUI(ObjectUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
- self.resource_loc = 'assets/resources'
+ self.resource_loc = 'assets/resources/dark_resources'
ObjectUI.__init__(self, title=_('Excellon Object'),
icon_file=self.resource_loc + '/drill32.png',
parent=parent,
app=self.app)
- self.general_label = FCLabel('%s' % _("General Information"))
+ self.general_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("General Information")))
self.general_label.setToolTip(_("General data about the object."))
self.custom_box.addWidget(self.general_label)
@@ -691,7 +691,7 @@ class ExcellonObjectUI(ObjectUI):
# #############################################################################################################
# Excellon Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s: ' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s: ' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(_("Tools/apertures in the loaded object."))
self.custom_box.addWidget(self.tools_table_label)
@@ -777,7 +777,7 @@ class ExcellonObjectUI(ObjectUI):
# #############################################################################################################
# Plugins Frame
# #############################################################################################################
- self.tool_lbl = FCLabel('%s' % _("Plugins"))
+ self.tool_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Plugins")))
self.custom_box.addWidget(self.tool_lbl)
plugins_frame = FCFrame()
@@ -926,19 +926,19 @@ class GeometryObjectUI(ObjectUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
- self.resource_loc = 'assets/resources'
+ self.resource_loc = 'assets/resources/dark_resources'
super(GeometryObjectUI, self).__init__(
title=_('Geometry Object'),
icon_file=self.resource_loc + '/geometry32.png', parent=parent, app=self.app
)
- self.general_label = FCLabel('%s' % _("General Information"))
+ self.general_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("General Information")))
self.general_label.setToolTip(_("General data about the object."))
self.custom_box.addWidget(self.general_label)
@@ -1021,7 +1021,7 @@ class GeometryObjectUI(ObjectUI):
# #############################################################################################################
# Gerber Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(_("Tools/apertures in the loaded object."))
self.custom_box.addWidget(self.tools_table_label)
@@ -1103,7 +1103,7 @@ class GeometryObjectUI(ObjectUI):
# #############################################################################################################
# PLUGINS Frame
# #############################################################################################################
- self.tools_label = FCLabel('%s' % _('Plugins'))
+ self.tools_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _('Plugins')))
self.custom_box.addWidget(self.tools_label)
plugins_frame = FCFrame()
@@ -1267,12 +1267,12 @@ class CNCObjectUI(ObjectUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
- self.resource_loc = 'assets/resources'
+ self.resource_loc = 'assets/resources/dark_resources'
ObjectUI.__init__(self, title=_('CNC Job Object'),
icon_file=self.resource_loc + '/cnc32.png', parent=parent,
@@ -1280,7 +1280,7 @@ class CNCObjectUI(ObjectUI):
# for i in range(0, self.common_grid.count()):
# self.common_grid.itemAt(i).widget().hide()
- self.general_label = FCLabel('%s' % _("General Information"))
+ self.general_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("General Information")))
self.general_label.setToolTip(_("General data about the object."))
self.custom_box.addWidget(self.general_label)
@@ -1369,7 +1369,7 @@ class CNCObjectUI(ObjectUI):
# #############################################################################################################
# COMMON PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.custom_box.addWidget(self.param_label)
self.gp_frame = FCFrame()
@@ -1441,7 +1441,7 @@ class CNCObjectUI(ObjectUI):
# #############################################################################################################
# CNC Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(_("Tools/apertures in the loaded object."))
self.custom_box.addWidget(self.tools_table_label)
@@ -1517,7 +1517,7 @@ class CNCObjectUI(ObjectUI):
# #############################################################################################################
# ###################### PLUGINS ##########################################################################
# #############################################################################################################
- self.tool_lbl = FCLabel('%s' % _("Plugins"))
+ self.tool_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Plugins")))
self.custom_box.addWidget(self.tool_lbl)
# Levelling Tool - will process the generated GCode using a Height Map generating levelled GCode
@@ -1585,12 +1585,12 @@ class ScriptObjectUI(ObjectUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
- self.resource_loc = 'assets/resources'
+ self.resource_loc = 'assets/resources/dark_resources'
ObjectUI.__init__(self, title=_('Script Object'),
icon_file=self.resource_loc + '/script_new24.png',
@@ -1652,12 +1652,12 @@ class DocumentObjectUI(ObjectUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
- self.resource_loc = 'assets/resources'
+ self.resource_loc = 'assets/resources/dark_resources'
ObjectUI.__init__(self, title=_('Document Object'),
icon_file=self.resource_loc + '/notes16_1.png',
diff --git a/appGUI/PlotCanvas.py b/appGUI/PlotCanvas.py
index 2253ce71..2ba5003b 100644
--- a/appGUI/PlotCanvas.py
+++ b/appGUI/PlotCanvas.py
@@ -54,9 +54,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
if settings.contains("theme"):
theme = settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
+
+ if theme == 'light' and not dark_canvas:
self.line_color = (0.3, 0.0, 0.0, 1.0)
# self.rect_hud_color = Color('#0000FF10')
self.rect_hud_color = Color('#80808040')
@@ -384,9 +389,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas):
if settings.contains("theme"):
theme = settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
+
+ if theme == 'light' and not dark_canvas:
color = 'dimgray'
else:
color = '#dededeff'
@@ -712,7 +722,7 @@ class CursorBig(QtCore.QObject):
# if 'edge_color' in kwargs:
# color = kwargs['edge_color']
# else:
- # if self.app.options['global_theme'] == 'white':
+ # if self.app.options['global_theme'] == 'light':
# color = '#000000FF'
# else:
# color = '#FFFFFFFF'
diff --git a/appGUI/PlotCanvas3d.py b/appGUI/PlotCanvas3d.py
index 98051ece..1c3d6e13 100644
--- a/appGUI/PlotCanvas3d.py
+++ b/appGUI/PlotCanvas3d.py
@@ -66,14 +66,19 @@ class PlotCanvas3d(QtCore.QObject, scene.SceneCanvas):
if settings.contains("theme"):
theme = settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
+
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
if settings.contains("axis_font_size"):
a_fsize = settings.value('axis_font_size', type=int)
else:
a_fsize = 8
- if theme == 'white':
+ if theme == 'light' and not dark_canvas:
theme_color = Color('#FFFFFF')
tick_color = Color('#000000')
back_color = str(QPalette().color(QPalette.ColorRole.Window).name())
@@ -131,7 +136,7 @@ class PlotCanvas3d(QtCore.QObject, scene.SceneCanvas):
# self.xaxis.link_view(self.view)
# self.yaxis.link_view(self.view)
- # if theme == 'white':
+ # if theme == 'light':
# self.grid = scene.GridLines(parent=self.view.scene, color='dimgray')
# else:
# self.grid = scene.GridLines(parent=self.view.scene, color='#dededeff')
diff --git a/appGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py
index 2b5609e8..45d34023 100644
--- a/appGUI/PlotCanvasLegacy.py
+++ b/appGUI/PlotCanvasLegacy.py
@@ -82,7 +82,18 @@ class CanvasCache(QtCore.QObject):
self.axes.set_xticks([])
self.axes.set_yticks([])
- if self.app.options['global_theme'] == 'white':
+ settings = QtCore.QSettings("Open Source", "FlatCAM")
+ if settings.contains("theme"):
+ theme = settings.value('theme', type=str)
+ else:
+ theme = 'light'
+
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
+
+ if theme == 'light' and not dark_canvas:
self.axes.set_facecolor('#FFFFFF')
else:
self.axes.set_facecolor('#000000')
@@ -154,7 +165,7 @@ class PlotCanvasLegacy(QtCore.QObject):
self.app = app
- if self.app.options['global_theme'] == 'white':
+ if self.app.options['global_theme'] == 'light':
theme_color = '#FFFFFF'
tick_color = '#000000'
self.rect_hud_color = '#0000FF10'
@@ -639,7 +650,7 @@ class PlotCanvasLegacy(QtCore.QObject):
if self.app.options["global_cursor_color_enabled"]:
color = self.app.options["global_cursor_color"]
else:
- if self.app.options['global_theme'] == 'white':
+ if self.app.options['global_theme'] == 'light':
color = '#000000'
else:
color = '#FFFFFF'
@@ -694,7 +705,7 @@ class PlotCanvasLegacy(QtCore.QObject):
if color:
color = color
else:
- if self.app.options['global_theme'] == 'white':
+ if self.app.options['global_theme'] == 'light':
color = '#000000'
else:
color = '#FFFFFF'
@@ -737,7 +748,7 @@ class PlotCanvasLegacy(QtCore.QObject):
self.canvas.blit(self.axes.bbox)
def clear_cursor(self, state):
- if self.app.options['global_theme'] == 'white':
+ if self.app.options['global_theme'] == 'light':
color = '#000000'
else:
color = '#FFFFFF'
diff --git a/appGUI/VisPyCanvas.py b/appGUI/VisPyCanvas.py
index 597980d3..991f3546 100644
--- a/appGUI/VisPyCanvas.py
+++ b/appGUI/VisPyCanvas.py
@@ -39,9 +39,14 @@ class VisPyCanvas(scene.SceneCanvas):
if settings.contains("theme"):
theme = settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
+
+ if theme == 'light' and not dark_canvas:
theme_color = Color('#FFFFFF')
tick_color = Color('#000000')
back_color = str(QPalette().color(QPalette.ColorRole.Window).name())
@@ -97,10 +102,15 @@ class VisPyCanvas(scene.SceneCanvas):
if settings.contains("theme"):
theme = settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
+
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
self.view = view
- if theme == 'white':
+ if theme == 'light' and not dark_canvas:
self.grid = scene.GridLines(parent=self.view.scene, color='dimgray')
else:
self.grid = scene.GridLines(parent=self.view.scene, color='#dededeff')
diff --git a/appGUI/preferences/OptionUI.py b/appGUI/preferences/OptionUI.py
index fd645a14..d1cdb4ac 100644
--- a/appGUI/preferences/OptionUI.py
+++ b/appGUI/preferences/OptionUI.py
@@ -275,7 +275,7 @@ class HeadingOptionUI(OptionUI):
self.color = color if color else ""
def build_heading_widget(self):
- heading = FCLabel('%s' % (str(self.color), _(self.label_text)))
+ heading = FCLabel('%s' % (self.app.theme_safe_color(''), str(self.color), _(self.label_text)))
heading.setToolTip(_(self.label_tooltip))
return heading
diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py
index 7c320beb..35a4a37d 100644
--- a/appGUI/preferences/PreferencesUIManager.py
+++ b/appGUI/preferences/PreferencesUIManager.py
@@ -74,6 +74,7 @@ class PreferencesUIManager(QtCore.QObject):
# General GUI Preferences
"global_appearance": self.ui.general_pref_form.general_gui_group.appearance_radio,
+ "global_dark_canvas": self.ui.general_pref_form.general_gui_group.dark_canvas_cb,
"global_layout": self.ui.general_pref_form.general_gui_group.layout_combo,
"global_hover_shape": self.ui.general_pref_form.general_gui_group.hover_cb,
"global_selection_shape": self.ui.general_pref_form.general_gui_group.selection_cb,
@@ -1070,13 +1071,19 @@ class PreferencesUIManager(QtCore.QObject):
else:
appearance = None
+ if appearance_settings.contains("dark_canvas"):
+ dark_canvas = appearance_settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = None
+
should_restart = False
appearance_new_val = self.ui.general_pref_form.general_gui_group.appearance_radio.get_value()
+ dark_canvas_new_val = self.ui.general_pref_form.general_gui_group.dark_canvas_cb.get_value()
ge = self.defaults["global_graphic_engine"]
ge_val = self.ui.general_pref_form.general_app_group.ge_radio.get_value()
- if appearance_new_val != appearance or ge != ge_val:
+ if appearance_new_val != appearance or ge != ge_val or dark_canvas_new_val != dark_canvas:
msgbox = FCMessageBox(parent=self.ui)
title = _("Application will restart")
txt = _("Are you sure you want to continue?")
@@ -1096,14 +1103,21 @@ class PreferencesUIManager(QtCore.QObject):
if appearance_new_val != appearance:
if response == bt_yes:
appearance_settings.setValue('appearance', appearance_new_val)
-
- # This will write the setting to the platform specific storage.
- del appearance_settings
-
should_restart = True
else:
self.ui.general_pref_form.general_gui_group.appearance_radio.set_value(appearance)
- else:
+
+ if dark_canvas_new_val != dark_canvas:
+ if response == bt_yes:
+ appearance_settings.setValue('dark_canvas', dark_canvas_new_val)
+ should_restart = True
+ else:
+ self.ui.general_pref_form.general_gui_group.dark_canvas_cb.set_value(dark_canvas)
+
+ # This will write the setting to the platform specific storage.
+ del appearance_settings
+
+ if ge != ge_val:
if response == bt_yes:
self.defaults["global_graphic_engine"] = ge_val
should_restart = True
diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py
index 217ffbcd..77c67e9c 100644
--- a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py
+++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py
@@ -23,7 +23,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.export_gcode_label = FCLabel('%s' % _("Parameters"))
+ self.export_gcode_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
"make this object to a file.")
diff --git a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py
index 95a79cc7..82bb49b6 100644
--- a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py
+++ b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py
@@ -25,7 +25,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(
_("A list of Editor parameters.")
)
diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py
index 57ddd6fb..370fe2b5 100644
--- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py
+++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py
@@ -24,7 +24,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Plot Frame
# #############################################################################################################
- self.plot_options_label = FCLabel('%s' % _("Plot Options"))
+ self.plot_options_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Plot Options")))
self.layout.addWidget(self.plot_options_label)
plot_frame = FCFrame()
@@ -71,7 +71,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Decimals Frame
# #############################################################################################################
- self.layout.addWidget(FCLabel('%s' % _("G-code Decimals")))
+ self.layout.addWidget(FCLabel('%s' % (self.app.theme_safe_color('teal'), _("G-code Decimals"))))
dec_frame = FCFrame()
self.layout.addWidget(dec_frame)
@@ -141,7 +141,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Travel Frame
# #############################################################################################################
- self.travel_color_label = FCLabel('%s' % _('Travel Line Color'))
+ self.travel_color_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Travel Line Color')))
self.layout.addWidget(self.travel_color_label)
travel_frame = FCFrame()
@@ -190,7 +190,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Object Color Frame
# #############################################################################################################
- self.cnc_color_label = FCLabel('%s' % _('Object Color'))
+ self.cnc_color_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Object Color')))
self.layout.addWidget(self.cnc_color_label)
obj_frame = FCFrame()
diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py
index e3a222e1..2485f9a5 100644
--- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py
+++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py
@@ -25,7 +25,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# GCode Frame
# #############################################################################################################
- self.export_gcode_label = FCLabel('%s' % _("Export G-Code"))
+ self.export_gcode_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Export G-Code")))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
"make this object to a file.")
diff --git a/appGUI/preferences/cncjob/CNCJobPPGroupUI.py b/appGUI/preferences/cncjob/CNCJobPPGroupUI.py
index 9ddc875e..bb6b0b97 100644
--- a/appGUI/preferences/cncjob/CNCJobPPGroupUI.py
+++ b/appGUI/preferences/cncjob/CNCJobPPGroupUI.py
@@ -22,7 +22,7 @@ class CNCJobPPGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.comp_gcode_label = FCLabel('%s' % _("Compensation"))
+ self.comp_gcode_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Compensation")))
self.comp_gcode_label.setToolTip(
_("Compensate CNC bed issues.")
)
diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py
index 135e94aa..26c9f90c 100644
--- a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py
+++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py
@@ -24,7 +24,7 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.exc_label = FCLabel('%s' % _('Advanced Options'))
+ self.exc_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _('Advanced Options')))
self.exc_label.setToolTip(
_("A list of advanced parameters.\n"
"Those parameters are available only for\n"
diff --git a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py
index c0ab3814..4ebb275a 100644
--- a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py
+++ b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py
@@ -23,7 +23,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(
_("A list of Excellon Editor parameters.")
)
@@ -79,7 +79,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Linear Array Frame
# #############################################################################################################
- self.drill_array_linear_label = FCLabel('%s' % _('Linear Drill Array'))
+ self.drill_array_linear_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Linear Drill Array')))
self.layout.addWidget(self.drill_array_linear_label)
lin_frame = FCFrame()
@@ -134,7 +134,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Circular Array Frame
# #############################################################################################################
- self.drill_array_circ_label = FCLabel('%s' % _('Circular Drill Array'))
+ self.drill_array_circ_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Circular Drill Array')))
self.layout.addWidget(self.drill_array_circ_label)
circ_frame = FCFrame()
@@ -173,7 +173,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Slots Frame
# #############################################################################################################
- self.drill_array_circ_label = FCLabel('%s' % _('Slots'))
+ self.drill_array_circ_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Slots')))
self.layout.addWidget(self.drill_array_circ_label)
slots_frame = FCFrame()
@@ -236,7 +236,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Slots Array Frame
# #############################################################################################################
- self.slot_array_linear_label = FCLabel('%s' % _('Linear Slot Array'))
+ self.slot_array_linear_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Linear Slot Array')))
self.layout.addWidget(self.slot_array_linear_label)
slot_array_frame = FCFrame()
@@ -306,7 +306,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Circular Slot Array Frame
# #############################################################################################################
- self.slot_array_circ_label = FCLabel('%s' % _('Circular Slot Array'))
+ self.slot_array_circ_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Circular Slot Array')))
self.layout.addWidget(self.slot_array_circ_label)
circ_slot_frame = FCFrame()
diff --git a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py
index 8ff30202..70bc620b 100644
--- a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py
+++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py
@@ -23,7 +23,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Export Frame
# #############################################################################################################
- self.export_options_label = FCLabel('%s' % _("Export Options"))
+ self.export_options_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Export Options")))
self.export_options_label.setToolTip(
_("The parameters set here are used in the file exported\n"
"when using the File -> Export -> Export Excellon menu entry.")
diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py
index ff0276ed..8e7af0b6 100644
--- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py
+++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py
@@ -27,7 +27,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Plot Frame
# #############################################################################################################
- self.plot_options_label = FCLabel('%s' % _("Plot Options"))
+ self.plot_options_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Plot Options")))
self.layout.addWidget(self.plot_options_label)
plot_frame = FCFrame()
@@ -77,7 +77,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Excellon Format Frame
# #############################################################################################################
- self.excellon_format_label = FCLabel('%s' % _("Excellon Format"))
+ self.excellon_format_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Excellon Format")))
self.excellon_format_label.setToolTip(
_("The NC drill files, usually named Excellon files\n"
"are files that can be found in different formats.\n"
@@ -220,7 +220,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Optimization Frame
# #############################################################################################################
- self.excellon_general_label = FCLabel('%s' % _("Path Optimization"))
+ self.excellon_general_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Path Optimization")))
self.layout.addWidget(self.excellon_general_label)
opt_frame = FCFrame()
@@ -272,7 +272,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
# Fusing Frame
# #############################################################################################################
# Fuse Tools
- self.join_geo_label = FCLabel('%s' % _('Join Option'))
+ self.join_geo_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Join Option')))
self.layout.addWidget(self.join_geo_label)
fuse_frame = FCFrame()
@@ -291,7 +291,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Object Color Frame
# #############################################################################################################
- self.gerber_color_label = FCLabel('%s' % _('Object Color'))
+ self.gerber_color_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Object Color')))
self.layout.addWidget(self.gerber_color_label)
obj_frame = FCFrame()
diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py
index 83310e31..7cfda2a0 100644
--- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py
+++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py
@@ -24,7 +24,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.cncjob_label = FCLabel('%s' % _('Parameters'))
+ self.cncjob_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.cncjob_label.setToolTip(
_("Parameters used to create a CNC Job object\n"
"for this drill object.")
diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py
index 17e6274a..11b30c7a 100644
--- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py
+++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py
@@ -26,9 +26,9 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
self.resource_loc = 'assets/resources'
else:
self.resource_loc = 'assets/resources'
@@ -37,7 +37,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# Grid Settings Frame
# #############################################################################################################
# GRID Settings
- self.grid_label = FCLabel('%s' % _('Grid Settings'))
+ self.grid_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Grid Settings')))
self.layout.addWidget(self.grid_label)
grids_frame = FCFrame()
@@ -90,7 +90,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# Workspace Frame
# #############################################################################################################
# Workspace
- self.workspace_label = FCLabel('%s' % _('Workspace Settings'))
+ self.workspace_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Workspace Settings')))
self.layout.addWidget(self.workspace_label)
wk_frame = FCFrame()
@@ -191,7 +191,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# Font Frame
# #############################################################################################################
# Font Size
- self.font_size_label = FCLabel('%s' % _('Font Size'))
+ self.font_size_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Font Size')))
self.layout.addWidget(self.font_size_label)
fnt_frame = FCFrame()
@@ -283,7 +283,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# Axis Frame
# #############################################################################################################
# Axis Size
- self.axis_label = FCLabel('%s' % _('Axis'))
+ self.axis_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Axis')))
self.layout.addWidget(self.axis_label)
ax_frame = FCFrame()
@@ -305,7 +305,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# #############################################################################################################
# Mouse Frame
# #############################################################################################################
- self.mouse_lbl = FCLabel('%s' % _('Mouse Settings'))
+ self.mouse_lbl = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Mouse Settings')))
self.layout.addWidget(self.mouse_lbl)
m_frame = FCFrame()
@@ -408,7 +408,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.par_label = FCLabel('%s' % _('Parameters'))
+ self.par_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.layout.addWidget(self.par_label)
par_frame = FCFrame()
@@ -496,9 +496,14 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme_settings.contains("dark_canvas"):
+ dark_canvas = theme_settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
+
+ if theme == 'light' and not dark_canvas:
self.app.cursor_color_3D = 'black'
else:
self.app.cursor_color_3D = 'gray'
@@ -509,4 +514,4 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
def on_axis_color_entry(self):
self.app.options['global_axis_color'] = self.axis_color_entry.get_value()
- self.app.plotcanvas.apply_axis_color()
\ No newline at end of file
+ self.app.plotcanvas.apply_axis_color()
diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py
index 5ff68cbd..e7238968 100644
--- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py
+++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py
@@ -28,7 +28,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Grid0 Frame
# #############################################################################################################
- self.unitslabel = FCLabel('%s' % _('Units'))
+ self.unitslabel = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Units')))
self.unitslabel.setToolTip(_("The default value for the application units.\n"
"Whatever is selected here is set every time\n"
"the application is started."))
@@ -76,7 +76,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.precision_inch_label, 4, 0)
grid0.addWidget(self.precision_inch_entry, 4, 1)
- self.par_label = FCLabel('%s' % _("Parameters"))
+ self.par_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.layout.addWidget(self.par_label)
# #############################################################################################################
@@ -166,7 +166,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Grid0 Frame
# #############################################################################################################
- self.app_level_label = FCLabel('%s' % _('Application Level'))
+ self.app_level_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Application Level')))
self.app_level_label.setToolTip(_("Choose the default level of usage for FlatCAM.\n"
"BASIC level -> reduced functionality, best for beginner's.\n"
"ADVANCED level -> full functionality.\n\n"
@@ -189,7 +189,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
# Grid3 Frame
# #############################################################################################################
# Languages for FlatCAM
- self.languagelabel = FCLabel('%s' % _('Languages'))
+ self.languagelabel = FCLabel('%s' % (self.app.theme_safe_color('DarkCyan'), _('Languages')))
self.languagelabel.setToolTip(_("Set the language used throughout FlatCAM."))
self.layout.addWidget(self.languagelabel)
@@ -213,7 +213,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
# ----------- APPLICATION STARTUP SETTINGS ------------------
# -----------------------------------------------------------
- self.startup_label = FCLabel('%s' % _('Startup Settings'))
+ self.startup_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Startup Settings')))
self.layout.addWidget(self.startup_label)
# #############################################################################################################
@@ -284,7 +284,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
self.ois_version_check = OptionalInputSection(self.version_check_cb, [self.send_stats_cb])
# Save Settings
- self.save_label = FCLabel('%s' % _("Save Settings"))
+ self.save_label = FCLabel('%s' % (self.app.theme_safe_color('purple'), _("Save Settings")))
self.layout.addWidget(self.save_label)
# #############################################################################################################
@@ -346,7 +346,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
# self.as_ois = OptionalInputSection(self.autosave_cb, [self.autosave_label, self.autosave_entry], True)
- self.pdf_param_label = FCLabel('%s' % _("Text to PDF parameters"))
+ self.pdf_param_label = FCLabel('%s' % (self.app.theme_safe_color('orange'), _("Text to PDF parameters")))
self.pdf_param_label.setToolTip(
_("Used when saving text in Code Editor or in FlatCAM Document objects.")
)
diff --git a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py
index 0bea646b..93ba5780 100644
--- a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py
+++ b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py
@@ -292,9 +292,14 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme_settings.contains("dark_canvas"):
+ dark_canvas = theme_settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
+
+ if theme == 'light' and not dark_canvas:
self.app.cursor_color_3D = 'black'
else:
self.app.cursor_color_3D = 'gray'
diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py
index 90090f7b..f5e5059e 100644
--- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py
+++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py
@@ -22,7 +22,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
self.decimals = app.decimals
self.options = app.options
- self.param_lbl = FCLabel('%s' % _("Parameters"))
+ self.param_lbl = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.layout.addWidget(self.param_lbl)
# #############################################################################################################
@@ -35,7 +35,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
par_frame.setLayout(grid0)
# Theme selection
- self.appearance_label = FCLabel('%s:' % _('Theme'))
+ self.appearance_label = FCLabel('%s' % _('Theme'))
self.appearance_label.setToolTip(
_("Select a theme for the application.\n"
"It will theme the plot area.")
@@ -52,8 +52,16 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
"Dark: Dark mode")
)
- grid0.addWidget(self.appearance_label, 0, 0)
- grid0.addWidget(self.appearance_radio, 0, 1)
+ # Dark Canvas
+ self.dark_canvas_cb = FCCheckBox('%s' % _('Always use dark canvas'))
+ self.dark_canvas_cb.setToolTip(
+ _("Check this box to always use Dark canvas\n"
+ "even if Light theme is selected.")
+ )
+
+ grid0.addWidget(self.appearance_label, 0, 0, 1, 2)
+ grid0.addWidget(self.appearance_radio, 1, 0, 1, 3)
+ grid0.addWidget(self.dark_canvas_cb, 2, 0, 1, 3)
# self.theme_button = FCButton(_("Apply Theme"))
# self.theme_button.setToolTip(
@@ -143,7 +151,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Grid1 Frame
# #############################################################################################################
- self.color_lbl = FCLabel('%s' % _("Colors"))
+ self.color_lbl = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Colors")))
self.layout.addWidget(self.color_lbl)
color_frame = FCFrame()
@@ -296,6 +304,11 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.proj_color_dis_l_label, 32, 0)
grid1.addWidget(self.proj_color_dis_light_entry, 32, 1)
+ separator_line = QtWidgets.QFrame()
+ separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
+ separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
+ grid1.addWidget(separator_line, 33, 0, 1, 2)
+
# Dark Theme
self.proj_settings_d_label = FCLabel('%s - %s' % (_('Project Items Color'), _("Dark")))
grid1.addWidget(self.proj_settings_d_label, 34, 0, 1, 2)
diff --git a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py
index e5f8809b..4d358863 100644
--- a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py
+++ b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py
@@ -24,7 +24,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Advanced Options Frame
# #############################################################################################################
- self.geo_label = FCLabel('%s' % _('Advanced Options'))
+ self.geo_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _('Advanced Options')))
self.geo_label.setToolTip(
_("A list of advanced parameters.\n"
"Those parameters are available only for\n"
diff --git a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py
index 304712a8..6286b087 100644
--- a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py
+++ b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py
@@ -24,7 +24,7 @@ class GeometryEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(
_("A list of Editor parameters.")
)
diff --git a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py
index e3899c6a..c6c1a26c 100644
--- a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py
+++ b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py
@@ -23,7 +23,7 @@ class GeometryExpPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Export Frame
# #############################################################################################################
- self.export_options_label = FCLabel('%s' % _("Export Options"))
+ self.export_options_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Export Options")))
self.export_options_label.setToolTip(
_("The parameters set here are used in the file exported\n"
"when using the File -> Export -> Export DXF menu entry.")
diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py
index 6e41374b..9b026173 100644
--- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py
+++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py
@@ -26,7 +26,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Plot Frame
# #############################################################################################################
- self.plot_options_label = FCLabel('%s' % _("Plot Options"))
+ self.plot_options_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Plot Options")))
self.layout.addWidget(self.plot_options_label)
plot_frame = FCFrame()
@@ -69,7 +69,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Optimization Frame
# #############################################################################################################
- self.opt_label = FCLabel('%s' % _("Path Optimization"))
+ self.opt_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Path Optimization")))
self.layout.addWidget(self.opt_label)
opt_frame = FCFrame()
@@ -119,7 +119,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Fuse Frame
# #############################################################################################################
- self.join_geo_label = FCLabel('%s' % _('Join Option'))
+ self.join_geo_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Join Option')))
self.layout.addWidget(self.join_geo_label)
fuse_frame = FCFrame()
@@ -138,7 +138,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Object Color Frame
# #############################################################################################################
- self.gerber_color_label = FCLabel('%s' % _('Object Color'))
+ self.gerber_color_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Object Color')))
self.layout.addWidget(self.gerber_color_label)
obj_frame = FCFrame()
diff --git a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py
index 0c35abae..923dcc35 100644
--- a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py
+++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py
@@ -25,7 +25,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.cncjob_label = FCLabel('%s' % _("Parameters"))
+ self.cncjob_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.layout.addWidget(self.cncjob_label)
param_frame = FCFrame()
diff --git a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py
index 2b098cf7..0d7aef27 100644
--- a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py
+++ b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py
@@ -26,7 +26,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI):
# Gerber Editor Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("A list of Gerber Editor parameters.")
)
@@ -118,7 +118,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Linear Pad Array Frame
# #############################################################################################################
- self.grb_array_linear_label = FCLabel('%s' % _('Linear Pad Array'))
+ self.grb_array_linear_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Linear Pad Array')))
self.layout.addWidget(self.grb_array_linear_label)
lin_frame = FCFrame()
@@ -172,7 +172,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Circular Pad Array Frame
# #############################################################################################################
- self.grb_array_circ_label = FCLabel('%s' % _('Circular Pad Array'))
+ self.grb_array_circ_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Circular Pad Array')))
self.layout.addWidget(self.grb_array_circ_label)
circ_frame = FCFrame()
@@ -212,7 +212,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Buffer Frame
# #############################################################################################################
- self.grb_array_tools_b_label = FCLabel('%s' % _('Buffer Tool'))
+ self.grb_array_tools_b_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Buffer Tool')))
self.layout.addWidget(self.grb_array_tools_b_label)
buff_frame = FCFrame()
@@ -237,7 +237,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Scale Frame
# #############################################################################################################
- self.grb_array_tools_s_label = FCLabel('%s' % _('Scale Tool'))
+ self.grb_array_tools_s_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Scale Tool')))
self.layout.addWidget(self.grb_array_tools_s_label)
scale_frame = FCFrame()
@@ -262,7 +262,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Mark Area Frame
# #############################################################################################################
- self.grb_array_tools_ma_label = FCLabel('%s' % _('Mark Area Tool'))
+ self.grb_array_tools_ma_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Mark Area Tool')))
self.layout.addWidget(self.grb_array_tools_ma_label)
ma_frame = FCFrame()
diff --git a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py
index 1f098fb7..2f495654 100644
--- a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py
+++ b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py
@@ -25,7 +25,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
self.options = app.options
# ## Plot options
- self.plot_options_label = FCLabel('%s' % _("Plot Options"))
+ self.plot_options_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Plot Options")))
self.layout.addWidget(self.plot_options_label)
# #############################################################################################################
@@ -77,7 +77,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Default format for Gerber
- self.gerber_default_label = FCLabel('%s' % _('Default Values'))
+ self.gerber_default_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Default Values')))
self.gerber_default_label.setToolTip(
_("Those values will be used as fallback values\n"
"in case that they are not found in the Gerber file.")
@@ -134,7 +134,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _('Parameters')))
self.layout.addWidget(self.param_label)
par_frame = FCFrame()
@@ -173,7 +173,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
# Layers Frame
# #############################################################################################################
# Layers label
- self.layers_label = FCLabel('%s' % _('Layers'))
+ self.layers_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Layers')))
self.layout.addWidget(self.layers_label)
layers_frame = FCFrame()
@@ -220,7 +220,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
# Object Frame
# #############################################################################################################
# Gerber Object Color
- self.gerber_color_label = FCLabel('%s' % _('Object Color'))
+ self.gerber_color_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Object Color')))
self.layout.addWidget(self.gerber_color_label)
obj_frame = FCFrame()
diff --git a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py
index d20f8fd1..ed359a96 100644
--- a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py
+++ b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py
@@ -25,7 +25,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Non-copper Regions Frame
# #############################################################################################################
- self.clearcopper_label = FCLabel('%s' % _("Non-copper regions"))
+ self.clearcopper_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Non-copper regions")))
self.clearcopper_label.setToolTip(
_("Create polygons covering the\n"
"areas without copper on the PCB.\n"
@@ -68,7 +68,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Bounding Box Frame
# #############################################################################################################
- self.boundingbox_label = FCLabel('%s' % _('Bounding Box'))
+ self.boundingbox_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Bounding Box')))
self.layout.addWidget(self.boundingbox_label)
bb_frame = FCFrame()
diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py
index 153feffe..4edabd96 100644
--- a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py
@@ -25,7 +25,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("A tool to generate a Copper Thieving that can be added\n"
"to a selected Gerber file.")
@@ -259,7 +259,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Robber Bar Parameters Frame
# #############################################################################################################
- self.robber_bar_label = FCLabel('%s' % _('Robber Bar Parameters'))
+ self.robber_bar_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Robber Bar Parameters')))
self.robber_bar_label.setToolTip(
_("Parameters used for the robber bar.\n"
"Robber bar = copper border to help in pattern hole plating.")
@@ -302,7 +302,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# RPattern Plating Mask Parameters Frame
# #############################################################################################################
- self.patern_mask_label = FCLabel('%s' % _('Pattern Plating Mask'))
+ self.patern_mask_label = FCLabel('%s' % (self.app.theme_safe_color('purple'), _('Pattern Plating Mask')))
self.patern_mask_label.setToolTip(
_("Generate a mask for pattern plating.")
)
diff --git a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py
index a95b3c20..7fece0cf 100644
--- a/appGUI/preferences/tools/Tools2CalPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py
@@ -25,7 +25,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
@@ -110,7 +110,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Tool change Frame
# #############################################################################################################
- tc_lbl = FCLabel('%s' % _("Tool change"))
+ tc_lbl = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Tool change")))
self.layout.addWidget(tc_lbl)
tc_frame = FCFrame()
diff --git a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py
index 921bb918..7fa36824 100644
--- a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py
@@ -24,7 +24,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.padt_label = FCLabel('%s' % _("Processed Pads Type"))
+ self.padt_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Processed Pads Type")))
self.padt_label.setToolTip(
_("The type of pads shape to be processed.\n"
"If the PCB has many SMD pads with rectangular pads,\n"
@@ -101,7 +101,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
],
orientation='vertical',
compact=True)
- self.method_label = FCLabel('%s:' % _("Method"))
+ self.method_label = FCLabel('%s:' % (self.app.theme_safe_color('green'), _("Method")))
self.method_label.setToolTip(
_("The method for processing pads. Can be:\n"
"- Fixed Diameter -> all holes will have a set size\n"
@@ -119,7 +119,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Fixed Diameter Frame
# #############################################################################################################
- self.fixed_label = FCLabel('%s' % _("Fixed Diameter"))
+ self.fixed_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Fixed Diameter")))
self.layout.addWidget(self.fixed_label)
fix_frame = FCFrame()
@@ -144,7 +144,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Annular ring Frame
# #############################################################################################################
- self.ring_label = FCLabel('%s' % _("Fixed Annular Ring"))
+ self.ring_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Fixed Annular Ring")))
self.ring_label.setToolTip(
_("The size of annular ring.\n"
"The copper sliver between the hole exterior\n"
@@ -226,7 +226,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Proportional Diameter Frame
# #############################################################################################################
- self.prop_label = FCLabel('%s' % _("Proportional Diameter"))
+ self.prop_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Proportional Diameter")))
self.layout.addWidget(self.prop_label)
prop_frame = FCFrame()
@@ -253,7 +253,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Extract Soldermask Frame
# #############################################################################################################
- self.extract_sm_label = FCLabel('%s' % _("Extract Soldermask"))
+ self.extract_sm_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _("Extract Soldermask")))
self.extract_sm_label.setToolTip(
_("Extract soldermask from a given Gerber file."))
self.layout.addWidget(self.extract_sm_label)
@@ -281,7 +281,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Extract CutOut Frame
# #############################################################################################################
- self.extract_cut_label = FCLabel('%s' % _("Extract Cutout"))
+ self.extract_cut_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Extract Cutout")))
self.extract_cut_label.setToolTip(
_("Extract a cutout from a given Gerber file."))
self.layout.addWidget(self.extract_cut_label)
diff --git a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py
index 0b514a4f..a36b1f24 100644
--- a/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py
@@ -24,7 +24,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
@@ -117,7 +117,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Selection Frame
# #############################################################################################################
- self.sel_label = FCLabel('%s' % _("Selection"))
+ self.sel_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Selection")))
self.layout.addWidget(self.sel_label)
s_frame = FCFrame()
diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py
index c0d7f548..f0f6982f 100644
--- a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py
@@ -24,7 +24,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.sublabel = FCLabel('%s' % _("Parameters"))
+ self.sublabel = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.sublabel.setToolTip(
_("A tool to invert Gerber geometry from positive to negative\n"
"and in revers.")
@@ -54,7 +54,7 @@ class Tools2InvertPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Line Join Frame
# #############################################################################################################
- self.join_label = FCLabel('%s' % _("Lines Join Style"))
+ self.join_label = FCLabel('%s' % (self.app.theme_safe_color('tomato'), _("Lines Join Style")))
self.join_label.setToolTip(
_("The way that the lines in the object outline will be joined.\n"
"Can be:\n"
diff --git a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py
index f6e053de..18959d2c 100644
--- a/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py
@@ -24,7 +24,7 @@ class Tools2OptimalPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.optlabel = FCLabel('%s' % _("Parameters"))
+ self.optlabel = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.optlabel.setToolTip(
_("A tool to find the minimum distance between\n"
"every two Gerber geometric elements")
diff --git a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py
index 7bc30944..f07ffd68 100644
--- a/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py
@@ -24,7 +24,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Processed Pads Frame
# #############################################################################################################
- self.padt_label = FCLabel('%s' % _("Processed Pads Type"))
+ self.padt_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Processed Pads Type")))
self.padt_label.setToolTip(
_("The type of pads shape to be processed.\n"
"If the PCB has many SMD pads with rectangular pads,\n"
@@ -102,7 +102,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
],
orientation='vertical',
compact=True)
- self.hole_size_label = FCLabel('%s:' % _("Method"))
+ self.hole_size_label = FCLabel('%s:' % (self.app.theme_safe_color('green'), _("Method")))
self.hole_size_label.setToolTip(
_("The punch hole source can be:\n"
"- Excellon Object-> the Excellon object drills center will serve as reference.\n"
@@ -116,7 +116,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Fixed Diameter Frame
# #############################################################################################################
- self.fixed_label = FCLabel('%s' % _("Fixed Diameter"))
+ self.fixed_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Fixed Diameter")))
self.layout.addWidget(self.fixed_label)
fix_frame = FCFrame()
@@ -141,7 +141,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Annular ring Frame
# #############################################################################################################
- self.ring_label = FCLabel('%s' % _("Fixed Annular Ring"))
+ self.ring_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Fixed Annular Ring")))
self.ring_label.setToolTip(
_("The size of annular ring.\n"
"The copper sliver between the hole exterior\n"
@@ -223,7 +223,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Proportional Diameter Frame
# #############################################################################################################
- self.prop_label = FCLabel('%s' % _("Proportional Diameter"))
+ self.prop_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Proportional Diameter")))
self.layout.addWidget(self.prop_label)
prop_frame = FCFrame()
diff --git a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py
index 22683b53..23f529ac 100644
--- a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py
@@ -24,7 +24,7 @@ class Tools2QRCodePrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.qrlabel = FCLabel('%s' % _("Parameters"))
+ self.qrlabel = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.qrlabel.setToolTip(
_("A tool to create a QRCode that can be inserted\n"
"into a selected Gerber file, or it can be exported as a file.")
diff --git a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py
index 73b42877..fbdf5de2 100644
--- a/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py
@@ -28,7 +28,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Rules Frame
# #############################################################################################################
- rules_copper_label = FCLabel('%s %s' % (_("Copper"), _("Rules")))
+ rules_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('darkorange'), _("Copper"), _("Rules")))
self.layout.addWidget(rules_copper_label)
copper_frame = FCFrame()
@@ -127,7 +127,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Silk Frame
# #############################################################################################################
- silk_copper_label = FCLabel('%s %s' % (_("Silk"), _("Rules")))
+ silk_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('teal'), _("Silk"), _("Rules")))
self.layout.addWidget(silk_copper_label)
silk_frame = FCFrame()
@@ -205,7 +205,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Soldermask Frame
# #############################################################################################################
- sm_copper_label = FCLabel('%s %s' % (_("Soldermask"), _("Rules")))
+ sm_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('magenta'), _("Soldermask"), _("Rules")))
self.layout.addWidget(sm_copper_label)
solder_frame = FCFrame()
@@ -240,7 +240,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Holes Frame
# #############################################################################################################
- holes_copper_label = FCLabel('%s %s' % (_("Holes"), _("Rules")))
+ holes_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('brown'), _("Holes"), _("Rules")))
self.layout.addWidget(holes_copper_label)
holes_frame = FCFrame()
diff --git a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py
index 53bce357..8a767118 100644
--- a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py
+++ b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py
@@ -22,7 +22,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
self.options = app.options
# ## Board cuttout
- self.dblsided_label = FCLabel('%s' % _("PCB Alignment"))
+ self.dblsided_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("PCB Alignment")))
self.dblsided_label.setToolTip(
_("A tool to help in creating a double sided\n"
"PCB using alignment holes.")
@@ -89,7 +89,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
# Mirror Frame
# #############################################################################################################
# ### Tools ## ##
- self.mirror_label = FCLabel('%s' % _("Mirror Operation"))
+ self.mirror_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Mirror Operation")))
self.layout.addWidget(self.mirror_label)
mirror_frame = FCFrame()
diff --git a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py
index ddeeb6e9..a2d0e375 100644
--- a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py
@@ -24,7 +24,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# V-Shape Tool Frame
# #############################################################################################################
- self.vshape_tool_label = FCLabel('%s' % _("V-Shape Tool Calculator"))
+ self.vshape_tool_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("V-Shape Tool Calculator")))
self.vshape_tool_label.setToolTip(
_("Calculate the tool diameter for a given V-shape tool,\n"
"having the tip diameter, tip angle and\n"
@@ -83,7 +83,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Electroplating Frame
# #############################################################################################################
- self.plate_title_label = FCLabel('%s' % _("ElectroPlating Calculator"))
+ self.plate_title_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("ElectroPlating Calculator")))
self.plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
"using a method like graphite ink or calcium hypophosphite ink or palladium chloride.")
diff --git a/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py
index 54006c8d..1b7b0af8 100644
--- a/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py
@@ -23,7 +23,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.options = app.options
# ## Board cutout
- self.board_cutout_label = FCLabel('%s' % _("Parameters"))
+ self.board_cutout_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
"the PCB and separate it from\n"
@@ -134,7 +134,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
param_grid.addWidget(marginlabel, 10, 0)
param_grid.addWidget(self.cutout_margin_entry, 10, 1)
- self.gaps_label = FCLabel('%s' % _("Gaps"))
+ self.gaps_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Gaps")))
self.layout.addWidget(self.gaps_label)
# #############################################################################################################
# Gaps Frame
@@ -260,7 +260,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
gaps_grid.addWidget(self.big_cursor_cb, 18, 0, 1, 2)
# Cut by Drilling Title
- self.title_drillcut_label = FCLabel('%s' % _('Cut by Drilling'))
+ self.title_drillcut_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Cut by Drilling')))
self.title_drillcut_label.setToolTip(_("Create a series of drill holes following a geometry line."))
self.layout.addWidget(self.title_drillcut_label)
diff --git a/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py b/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py
index d79a4914..291db4af 100644
--- a/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsDrillPrefGroupUI.py
@@ -25,7 +25,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.drill_label = FCLabel('%s' % _("Parameters"))
+ self.drill_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.drill_label.setToolTip(
_("Create CNCJob with toolpaths for drilling or milling holes.")
)
@@ -226,7 +226,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Drill Slots Frame
# #############################################################################################################
- self.dslots_label = FCLabel('%s' % _('Drilling Slots'))
+ self.dslots_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Drilling Slots')))
self.layout.addWidget(self.dslots_label)
ds_frame = FCFrame()
@@ -272,7 +272,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Advanced Options Frame
# #############################################################################################################
- self.exc_label = FCLabel('%s' % _('Advanced Options'))
+ self.exc_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _('Advanced Options')))
self.exc_label.setToolTip(
_("A list of advanced parameters.")
)
@@ -417,7 +417,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Area Exclusion Frame
# #############################################################################################################
- self.area_exc_label = FCLabel('%s' % _('Area Exclusion'))
+ self.area_exc_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Area Exclusion')))
self.area_exc_label.setToolTip(
_("Area exclusion parameters.")
)
diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py
index d6b3b6ff..e1d440ec 100644
--- a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py
@@ -25,7 +25,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Adjustments Frame
# #############################################################################################################
- self.film_adj_label = FCLabel('%s' % _("Adjustments"))
+ self.film_adj_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Adjustments")))
self.film_adj_label.setToolTip(
_("Compensate print distortions.")
)
@@ -44,11 +44,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
_("A value greater than 1 will compact the film\n"
"while a value less than 1 will jolt it.")
)
- self.film_scale_cb.setStyleSheet(
- """
- QCheckBox {font-weight: bold; color: black}
- """
- )
adj_grid.addWidget(self.film_scale_cb, 2, 0, 1, 2)
# SCALE FRAME
@@ -109,11 +104,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
_("Positive values will skew to the right\n"
"while negative values will skew to the left.")
)
- self.film_skew_cb.setStyleSheet(
- """
- QCheckBox {font-weight: bold; color: black}
- """
- )
adj_grid.addWidget(self.film_skew_cb, 8, 0, 1, 2)
# SKEW FRAME
@@ -171,11 +161,6 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
self.film_mirror_cb.setToolTip(
_("Mirror the film geometry on the selected axis or on both.")
)
- self.film_mirror_cb.setStyleSheet(
- """
- QCheckBox {font-weight: bold; color: black}
- """
- )
adj_grid.addWidget(self.film_mirror_cb, 12, 0, 1, 2)
self.film_mirror_axis = RadioSet([{'label': _('X'), 'value': 'x'},
@@ -195,7 +180,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.film_label = FCLabel('%s' % _("Parameters"))
+ self.film_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.film_label.setToolTip(
_("Create a PCB film from a Gerber or Geometry object.\n"
"The file is saved in SVG format.")
diff --git a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py
index 7224a785..7dbe63cb 100644
--- a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py
@@ -22,7 +22,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.options = app.options
# ## Clear non-copper regions
- self.iso_label = FCLabel('%s' % _("Parameters"))
+ self.iso_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.iso_label.setToolTip(
_("Create a Geometry object with\n"
"toolpaths to cut around polygons.")
@@ -135,7 +135,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
# Tool Frame
# #############################################################################################################
# ### Tools ## ##
- self.tools_table_label = FCLabel('%s' % _("Tool Parameters"))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Tool Parameters")))
self.layout.addWidget(self.tools_table_label)
tt_frame = FCFrame()
@@ -245,7 +245,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# General Parameters Frame
# #############################################################################################################
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py
index d0c415db..f1bc4935 100644
--- a/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsLevelPrefGroupUI.py
@@ -22,7 +22,7 @@ class ToolsLevelPrefGroupUI(OptionsGroupUI):
self.options = app.options
# ## Board cuttout
- self.levelling_label = FCLabel('%s' % _("Parameters"))
+ self.levelling_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.levelling_label.setToolTip(
_("Generate CNC Code with auto-levelled paths.")
)
diff --git a/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py b/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py
index 0f4635c1..40ad64bc 100644
--- a/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsMarkersPrefGroupUI.py
@@ -24,7 +24,7 @@ class ToolsMarkersPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
@@ -104,7 +104,7 @@ class ToolsMarkersPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Offset Frame
# #############################################################################################################
- self.offset_title_label = FCLabel('%s' % _('Offset'))
+ self.offset_title_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Offset')))
self.offset_title_label.setToolTip(_("Offset locations from the set reference."))
self.layout.addWidget(self.offset_title_label)
diff --git a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py
index 9470471f..c0c20873 100644
--- a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py
@@ -25,7 +25,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.mill_label = FCLabel('%s' % _("Parameters"))
+ self.mill_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.mill_label.setToolTip(
_("Create CNCJob with toolpaths for milling either Geometry or drill holes.")
)
@@ -289,7 +289,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Advanced Options Frame
# #############################################################################################################
- self.adv_label = FCLabel('%s' % _('Advanced Options'))
+ self.adv_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _('Advanced Options')))
self.adv_label.setToolTip(
_("A list of advanced parameters.")
)
@@ -437,7 +437,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Area Exclusion Frame
# #############################################################################################################
- self.area_exc_label = FCLabel('%s' % _('Area Exclusion'))
+ self.area_exc_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Area Exclusion')))
self.area_exc_label.setToolTip(
_("Area exclusion parameters.")
)
@@ -503,7 +503,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Area Polish Frame
# #############################################################################################################
- self.pol_label = FCLabel('%s' % _('Add Polish'))
+ self.pol_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Add Polish')))
self.pol_label.setToolTip(
_("Will add a Paint section at the end of the GCode.\n"
"A metallic brush will clean the material after milling.")
@@ -562,7 +562,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Excellon Milling Frame
# #############################################################################################################
- self.mille_label = FCLabel('%s' % _('Excellon Milling'))
+ self.mille_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Excellon Milling')))
self.mille_label.setToolTip(
_("Will mill Excellon holes progressively from the center of the hole.")
)
diff --git a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py
index 0d62dbef..9059e9cf 100644
--- a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py
@@ -23,7 +23,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.options = app.options
# ## Clear non-copper regions
- self.clearcopper_label = FCLabel('%s' % _("Parameters"))
+ self.clearcopper_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
"toolpaths to cut all non-copper regions.")
@@ -155,7 +155,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
# Tool Frame
# #############################################################################################################
# ### Tools ## ##
- self.tools_table_label = FCLabel('%s' % _("Tool Parameters"))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Tool Parameters")))
self.layout.addWidget(self.tools_table_label)
tt_frame = FCFrame()
@@ -271,7 +271,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# General Parameters Frame
# #############################################################################################################
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py
index 4f6e2a6f..4e05e5cb 100644
--- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py
@@ -25,7 +25,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
# ------------------------------
# ## Paint area
# ------------------------------
- self.paint_label = FCLabel('%s' % _('Parameters'))
+ self.paint_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.paint_label.setToolTip(
_("Creates tool paths to cover the\n"
"whole area of a polygon.")
@@ -138,7 +138,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
# Tool Frame
# #############################################################################################################
# ### Tools ## ##
- self.tools_table_label = FCLabel('%s' % _("Tool Parameters"))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Tool Parameters")))
self.layout.addWidget(self.tools_table_label)
tt_frame = FCFrame()
@@ -228,7 +228,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# General Parameters Frame
# #############################################################################################################
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py
index 15c7f28e..f3002685 100644
--- a/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py
@@ -24,7 +24,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.panelize_label = FCLabel('%s' % _("Parameters"))
+ self.panelize_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.panelize_label.setToolTip(
_("Create an object that contains an array of (x, y) elements,\n"
"each element is a copy of the source object spaced\n"
diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py
index b42408fd..948850f9 100644
--- a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py
@@ -25,7 +25,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.solderpastelabel = FCLabel('%s' % _("Parameters"))
+ self.solderpastelabel = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.solderpastelabel.setToolTip(
_("A tool to create GCode for dispensing\n"
"solder paste onto a PCB.")
diff --git a/appGUI/preferences/tools/ToolsSubPrefGroupUI.py b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py
index 60185758..9d268013 100644
--- a/appGUI/preferences/tools/ToolsSubPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py
@@ -21,7 +21,7 @@ class ToolsSubPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.sublabel = FCLabel('%s' % _("Parameters"))
+ self.sublabel = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.sublabel.setToolTip(
_("A tool to substract one Gerber or Geometry object\n"
"from another of the same type.")
diff --git a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py
index e0cda26b..476bc7ad 100644
--- a/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py
+++ b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py
@@ -25,7 +25,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# PARAMETERS Frame
# #############################################################################################################
- self.transform_label = FCLabel('%s' % _("Parameters"))
+ self.transform_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.transform_label.setToolTip(
_("Various transformations that can be applied\n"
"on a application object.")
@@ -85,7 +85,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Rotate Frame
# #############################################################################################################
- rotate_title_lbl = FCLabel('%s' % _("Rotate"))
+ rotate_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('tomato'), _("Rotate")))
self.layout.addWidget(rotate_title_lbl)
rot_frame = FCFrame()
@@ -115,7 +115,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
s_t_lay = QtWidgets.QHBoxLayout()
self.layout.addLayout(s_t_lay)
- skew_title_lbl = FCLabel('%s' % _("Skew"))
+ skew_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Skew")))
s_t_lay.addWidget(skew_title_lbl)
s_t_lay.addStretch()
@@ -168,7 +168,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
sc_t_lay = QtWidgets.QHBoxLayout()
self.layout.addLayout(sc_t_lay)
- scale_title_lbl = FCLabel('%s' % _("Scale"))
+ scale_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _("Scale")))
sc_t_lay.addWidget(scale_title_lbl)
sc_t_lay.addStretch()
@@ -214,7 +214,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
# #############################################################################################################
# Offset Frame
# #############################################################################################################
- offset_title_lbl = FCLabel('%s' % _("Offset"))
+ offset_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Offset")))
self.layout.addWidget(offset_title_lbl)
off_frame = FCFrame()
@@ -254,7 +254,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
b_t_lay = QtWidgets.QHBoxLayout()
self.layout.addLayout(b_t_lay)
- buffer_title_lbl = FCLabel('%s' % _("Buffer"))
+ buffer_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Buffer")))
b_t_lay.addWidget(buffer_title_lbl)
b_t_lay.addStretch()
diff --git a/appMain.py b/appMain.py
index 98da0974..61a1a822 100644
--- a/appMain.py
+++ b/appMain.py
@@ -268,6 +268,24 @@ class App(QtCore.QObject):
# used when loading a project and restoring objects
restore_project_objects_sig = pyqtSignal(object, str, bool, bool)
+ # Mapping of colors used for text on Light theme to
+ # similar colors safe for use on Dark theme
+ # 'input_color': (light_color, dark_color),
+ theme_safe_colors = {
+ "blue": "#1F80FF",
+ "brown": "#CC9966",
+ "darkgreen": "#008015",
+ "darkorange": "darkorange",
+ "green": "#00CC22",
+ "indigo": "#9457EB",
+ "magenta": "magenta",
+ "orange": "orange",
+ "purple": "#B284BE",
+ "red": "salmon",
+ "teal": "teal",
+ "tomato": "tomato",
+ }
+
def __init__(self, qapp, user_defaults=True):
"""
Starts the application.
@@ -615,14 +633,14 @@ class App(QtCore.QObject):
# Set global_theme based on appearance
if self.options["global_appearance"] == 'auto':
if darkdetect.isDark():
- theme = 'black'
+ theme = 'dark'
else:
- theme = 'white'
+ theme = 'light'
else:
if self.options["global_appearance"] == 'dark':
- theme = 'black'
+ theme = 'dark'
else:
- theme = 'white'
+ theme = 'light'
self.options["global_theme"] = theme
@@ -634,7 +652,7 @@ class App(QtCore.QObject):
else:
self.decimals = int(self.options['decimals_inch'])
- if self.options["global_theme"] == 'white':
+ if self.options["global_theme"] == 'light':
self.resource_location = 'assets/resources'
self.qapp.setStyleSheet(qdarktheme.load_stylesheet('light'))
else:
@@ -1033,12 +1051,14 @@ class App(QtCore.QObject):
self.FC_dark_blue = '#0000ffbf'
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
+ theme_settings.setValue("appearance", self.options["global_appearance"])
theme_settings.setValue("theme", self.options["global_theme"])
+ theme_settings.setValue("dark_canvas", self.options["global_dark_canvas"])
if self.options["global_cursor_color_enabled"]:
self.cursor_color_3D = self.options["global_cursor_color"]
else:
- if theme == 'white':
+ if theme == 'light' and not self.options["global_dark_canvas"]:
self.cursor_color_3D = 'black'
else:
self.cursor_color_3D = 'gray'
@@ -1891,132 +1911,146 @@ class App(QtCore.QObject):
self.shell = FCShell(app=self, version=self.version)
self.log.debug("TCL was re-instantiated. TCL variables are reset.")
+ # The menu bar theming differs between operating systems
+ # Windows menu theme is controlled by the application
+ # MacOS menu theme is controlled by OS
+ if sys.platform == 'win32':
+ if self.options["global_theme"] == 'light':
+ menu_resource_location = 'assets/resources'
+ else:
+ menu_resource_location = 'assets/resources/dark_resources'
+ else:
+ if darkdetect.isLight():
+ menu_resource_location = 'assets/resources'
+ else:
+ menu_resource_location = 'assets/resources/dark_resources'
+
self.distance_tool = Distance(self)
- self.distance_tool.install(icon=QtGui.QIcon(self.resource_location + '/distance16.png'), pos=self.ui.menuedit,
+ self.distance_tool.install(icon=QtGui.QIcon(menu_resource_location + '/distance16.png'), pos=self.ui.menuedit,
before=self.ui.menuedit_numeric_move,
separator=False)
self.distance_min_tool = ObjectDistance(self)
- self.distance_min_tool.install(icon=QtGui.QIcon(self.resource_location + '/distance_min16.png'),
+ self.distance_min_tool.install(icon=QtGui.QIcon(menu_resource_location + '/distance_min16.png'),
pos=self.ui.menuedit,
before=self.ui.menuedit_numeric_move,
separator=True)
self.dblsidedtool = DblSidedTool(self)
- self.dblsidedtool.install(icon=QtGui.QIcon(self.resource_location + '/doubleside16.png'), separator=False)
+ self.dblsidedtool.install(icon=QtGui.QIcon(menu_resource_location + '/doubleside16.png'), separator=False)
self.cal_exc_tool = ToolCalibration(self)
- self.cal_exc_tool.install(icon=QtGui.QIcon(self.resource_location + '/calibrate_16.png'),
+ self.cal_exc_tool.install(icon=QtGui.QIcon(menu_resource_location + '/calibrate_16.png'),
pos=self.ui.menu_plugins,
before=self.dblsidedtool.menuAction,
separator=False)
self.align_objects_tool = AlignObjects(self)
- self.align_objects_tool.install(icon=QtGui.QIcon(self.resource_location + '/align16.png'), separator=False)
+ self.align_objects_tool.install(icon=QtGui.QIcon(menu_resource_location + '/align16.png'), separator=False)
self.extract_tool = ToolExtract(self)
- self.extract_tool.install(icon=QtGui.QIcon(self.resource_location + '/extract32.png'), separator=True)
+ self.extract_tool.install(icon=QtGui.QIcon(menu_resource_location + '/extract32.png'), separator=True)
self.panelize_tool = Panelize(self)
- self.panelize_tool.install(icon=QtGui.QIcon(self.resource_location + '/panelize16.png'))
+ self.panelize_tool.install(icon=QtGui.QIcon(menu_resource_location + '/panelize16.png'))
self.film_tool = Film(self)
- self.film_tool.install(icon=QtGui.QIcon(self.resource_location + '/film32.png'))
+ self.film_tool.install(icon=QtGui.QIcon(menu_resource_location + '/film32.png'))
self.paste_tool = SolderPaste(self)
- self.paste_tool.install(icon=QtGui.QIcon(self.resource_location + '/solderpastebis32.png'))
+ self.paste_tool.install(icon=QtGui.QIcon(menu_resource_location + '/solderpastebis32.png'))
self.calculator_tool = ToolCalculator(self)
- self.calculator_tool.install(icon=QtGui.QIcon(self.resource_location + '/calculator16.png'), separator=True)
+ self.calculator_tool.install(icon=QtGui.QIcon(menu_resource_location + '/calculator16.png'), separator=True)
self.sub_tool = ToolSub(self)
- self.sub_tool.install(icon=QtGui.QIcon(self.resource_location + '/sub32.png'),
+ self.sub_tool.install(icon=QtGui.QIcon(menu_resource_location + '/sub32.png'),
pos=self.ui.menu_plugins, separator=True)
self.rules_tool = RulesCheck(self)
- self.rules_tool.install(icon=QtGui.QIcon(self.resource_location + '/rules32.png'),
+ self.rules_tool.install(icon=QtGui.QIcon(menu_resource_location + '/rules32.png'),
pos=self.ui.menu_plugins, separator=False)
self.optimal_tool = ToolOptimal(self)
- self.optimal_tool.install(icon=QtGui.QIcon(self.resource_location + '/open_excellon32.png'),
+ self.optimal_tool.install(icon=QtGui.QIcon(menu_resource_location + '/open_excellon32.png'),
pos=self.ui.menu_plugins, separator=True)
self.move_tool = ToolMove(self)
- self.move_tool.install(icon=QtGui.QIcon(self.resource_location + '/move16.png'), pos=self.ui.menuedit,
+ self.move_tool.install(icon=QtGui.QIcon(menu_resource_location + '/move16.png'), pos=self.ui.menuedit,
before=self.ui.menuedit_numeric_move, separator=True)
self.cutout_tool = CutOut(self)
- self.cutout_tool.install(icon=QtGui.QIcon(self.resource_location + '/cut32.png'), pos=self.ui.menu_plugins,
+ self.cutout_tool.install(icon=QtGui.QIcon(menu_resource_location + '/cut32.png'), pos=self.ui.menu_plugins,
before=self.sub_tool.menuAction)
self.ncclear_tool = NonCopperClear(self)
- self.ncclear_tool.install(icon=QtGui.QIcon(self.resource_location + '/ncc32.png'), pos=self.ui.menu_plugins,
+ self.ncclear_tool.install(icon=QtGui.QIcon(menu_resource_location + '/ncc32.png'), pos=self.ui.menu_plugins,
before=self.sub_tool.menuAction, separator=True)
self.paint_tool = ToolPaint(self)
- self.paint_tool.install(icon=QtGui.QIcon(self.resource_location + '/paint20_1.png'), pos=self.ui.menu_plugins,
+ self.paint_tool.install(icon=QtGui.QIcon(menu_resource_location + '/paint20_1.png'), pos=self.ui.menu_plugins,
before=self.sub_tool.menuAction, separator=True)
self.isolation_tool = ToolIsolation(self)
- self.isolation_tool.install(icon=QtGui.QIcon(self.resource_location + '/iso_16.png'), pos=self.ui.menu_plugins,
+ self.isolation_tool.install(icon=QtGui.QIcon(menu_resource_location + '/iso_16.png'), pos=self.ui.menu_plugins,
before=self.sub_tool.menuAction, separator=True)
self.follow_tool = ToolFollow(self)
- self.follow_tool.install(icon=QtGui.QIcon(self.resource_location + '/follow32.png'), pos=self.ui.menu_plugins,
+ self.follow_tool.install(icon=QtGui.QIcon(menu_resource_location + '/follow32.png'), pos=self.ui.menu_plugins,
before=self.sub_tool.menuAction, separator=True)
self.drilling_tool = ToolDrilling(self)
- self.drilling_tool.install(icon=QtGui.QIcon(self.resource_location + '/extract_drill32.png'),
+ self.drilling_tool.install(icon=QtGui.QIcon(menu_resource_location + '/extract_drill32.png'),
pos=self.ui.menu_plugins, before=self.sub_tool.menuAction, separator=True)
self.milling_tool = ToolMilling(self)
- self.milling_tool.install(icon=QtGui.QIcon(self.resource_location + '/milling_tool32.png'),
+ self.milling_tool.install(icon=QtGui.QIcon(menu_resource_location + '/milling_tool32.png'),
pos=self.ui.menu_plugins, before=self.sub_tool.menuAction, separator=True)
self.levelling_tool = ToolLevelling(self)
- self.levelling_tool.install(icon=QtGui.QIcon(self.resource_location + '/level32.png'),
+ self.levelling_tool.install(icon=QtGui.QIcon(menu_resource_location + '/level32.png'),
pos=self.ui.menuoptions_experimental, separator=True)
self.copper_thieving_tool = ToolCopperThieving(self)
- self.copper_thieving_tool.install(icon=QtGui.QIcon(self.resource_location + '/copperfill32.png'),
+ self.copper_thieving_tool.install(icon=QtGui.QIcon(menu_resource_location + '/copperfill32.png'),
pos=self.ui.menu_plugins)
self.fiducial_tool = ToolFiducials(self)
- self.fiducial_tool.install(icon=QtGui.QIcon(self.resource_location + '/fiducials_32.png'),
+ self.fiducial_tool.install(icon=QtGui.QIcon(menu_resource_location + '/fiducials_32.png'),
pos=self.ui.menu_plugins)
self.qrcode_tool = QRCode(self)
- self.qrcode_tool.install(icon=QtGui.QIcon(self.resource_location + '/qrcode32.png'),
+ self.qrcode_tool.install(icon=QtGui.QIcon(menu_resource_location + '/qrcode32.png'),
pos=self.ui.menu_plugins)
self.punch_tool = ToolPunchGerber(self)
- self.punch_tool.install(icon=QtGui.QIcon(self.resource_location + '/punch32.png'), pos=self.ui.menu_plugins)
+ self.punch_tool.install(icon=QtGui.QIcon(menu_resource_location + '/punch32.png'), pos=self.ui.menu_plugins)
self.invert_tool = ToolInvertGerber(self)
- self.invert_tool.install(icon=QtGui.QIcon(self.resource_location + '/invert32.png'), pos=self.ui.menu_plugins)
+ self.invert_tool.install(icon=QtGui.QIcon(menu_resource_location + '/invert32.png'), pos=self.ui.menu_plugins)
self.markers_tool = ToolMarkers(self)
- self.markers_tool.install(icon=QtGui.QIcon(self.resource_location + '/corners_32.png'),
+ self.markers_tool.install(icon=QtGui.QIcon(menu_resource_location + '/corners_32.png'),
pos=self.ui.menu_plugins)
self.etch_tool = ToolEtchCompensation(self)
- self.etch_tool.install(icon=QtGui.QIcon(self.resource_location + '/etch_32.png'), pos=self.ui.menu_plugins)
+ self.etch_tool.install(icon=QtGui.QIcon(menu_resource_location + '/etch_32.png'), pos=self.ui.menu_plugins)
self.transform_tool = ToolTransform(self)
- self.transform_tool.install(icon=QtGui.QIcon(self.resource_location + '/transform.png'),
+ self.transform_tool.install(icon=QtGui.QIcon(menu_resource_location + '/transform.png'),
pos=self.ui.menuoptions, separator=True)
self.report_tool = ObjectReport(self)
- self.report_tool.install(icon=QtGui.QIcon(self.resource_location + '/properties32.png'),
+ self.report_tool.install(icon=QtGui.QIcon(menu_resource_location + '/properties32.png'),
pos=self.ui.menuoptions)
self.pdf_tool = ToolPDF(self)
- self.pdf_tool.install(icon=QtGui.QIcon(self.resource_location + '/pdf32.png'),
+ self.pdf_tool.install(icon=QtGui.QIcon(menu_resource_location + '/pdf32.png'),
pos=self.ui.menufileimport,
separator=True)
try:
self.image_tool = ToolImage(self)
- self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'),
+ self.image_tool.install(icon=QtGui.QIcon(menu_resource_location + '/image32.png'),
pos=self.ui.menufileimport,
separator=True)
except Exception as im_err:
@@ -2024,7 +2058,7 @@ class App(QtCore.QObject):
self.image_tool = lambda x: None
self.pcb_wizard_tool = PcbWizard(self)
- self.pcb_wizard_tool.install(icon=QtGui.QIcon(self.resource_location + '/drill32.png'),
+ self.pcb_wizard_tool.install(icon=QtGui.QIcon(menu_resource_location + '/drill32.png'),
pos=self.ui.menufileimport)
# create a list of plugins references
@@ -3687,7 +3721,7 @@ class App(QtCore.QObject):
line = 1
for i in translators:
self.translator_grid_lay.addWidget(
- FCLabel('%s' % i['language']), line, 0)
+ FCLabel('%s' % (self.app.theme_safe_color('blue'), i['language']), line, 0))
for author in range(len(i['authors'])):
auth_widget = FCLabel('%s' % i['authors'][author][0])
email_widget = FCLabel('%s' % i['authors'][author][1])
@@ -8634,7 +8668,7 @@ class App(QtCore.QObject):
root = d_properties_tw.invisibleRootItem()
font = QtGui.QFont()
font.setBold(True)
- p_color = QtGui.QColor("#000000") if self.options['global_theme'] == 'white' else QtGui.QColor("#FFFFFF")
+ p_color = QtGui.QColor("#000000") if self.options['global_theme'] == 'light' else QtGui.QColor("#FFFFFF")
# main Items categories
general_cat = d_properties_tw.addParent(root, _('General'), expanded=True, color=p_color, font=font)
@@ -9439,6 +9473,23 @@ class App(QtCore.QObject):
return float('%.*f' % (dec_nr, float(val)))
+ def theme_safe_color(self, color):
+ """
+ Some colors do not work well with light or dark backgrounds making them unreadable in the wrong
+ theme. For an approved color value this will return a similar color better suited for the current theme.
+
+ :param color: color to be replaced
+ :return: similar color better suited for dark or light theme
+ """
+
+ if color in self.theme_safe_colors:
+ if self.options['global_theme'] == 'light':
+ return color
+ else:
+ return self.theme_safe_colors[color]
+ else:
+ # Arbitratily selected fail-safe color
+ return 'green'
class ArgsThread(QtCore.QObject):
open_signal = pyqtSignal(list)
diff --git a/appObjects/AppObjectTemplate.py b/appObjects/AppObjectTemplate.py
index 711233f3..1e22e465 100644
--- a/appObjects/AppObjectTemplate.py
+++ b/appObjects/AppObjectTemplate.py
@@ -536,7 +536,7 @@ class FlatCAMObj(QtCore.QObject):
font = QtGui.QFont()
font.setBold(True)
- p_color = QtGui.QColor("#000000") if self.app.options['global_theme'] == 'white' \
+ p_color = QtGui.QColor("#000000") if self.app.options['global_theme'] == 'light' \
else QtGui.QColor("#FFFFFF")
# main Items categories
diff --git a/appObjects/ObjectCollection.py b/appObjects/ObjectCollection.py
index d8fa9660..742aefab 100644
--- a/appObjects/ObjectCollection.py
+++ b/appObjects/ObjectCollection.py
@@ -508,7 +508,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
theme_settings = QtCore.QSettings("Open Source", "FlatCAM")
theme = theme_settings.value('theme', type=str)
- if theme in ['black', 'dark']:
+ if theme == '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:
diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py
index a616403a..eae28d07 100644
--- a/appPlugins/ToolAlignObjects.py
+++ b/appPlugins/ToolAlignObjects.py
@@ -414,7 +414,7 @@ class AlignUI:
# #############################################################################################################
# Moving Object Frame
# #############################################################################################################
- self.aligned_label = FCLabel('%s' % _("MOVING object"))
+ self.aligned_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("MOVING object")))
self.aligned_label.setToolTip(
_("Specify the type of object to be aligned.\n"
"It can be of type: Gerber or Excellon.\n"
@@ -453,7 +453,7 @@ class AlignUI:
# #############################################################################################################
# Destination Object Frame
# #############################################################################################################
- self.aligned_label = FCLabel('%s' % _("DESTINATION object"))
+ self.aligned_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("DESTINATION object")))
self.aligned_label.setToolTip(
_("Specify the type of object to be aligned to.\n"
"It can be of type: Gerber or Excellon.\n"
@@ -492,7 +492,7 @@ class AlignUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.tools_box.addWidget(self.param_label)
par_frame = FCFrame()
diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py
index c2785faa..7ed830aa 100644
--- a/appPlugins/ToolCalculators.py
+++ b/appPlugins/ToolCalculators.py
@@ -526,7 +526,7 @@ class CalcUI:
# #####################
# ## Title of the Units Calculator
- units_label = FCLabel('%s' % self.unitsName)
+ units_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), self.unitsName))
self.layout.addWidget(units_label)
units_frame = FCFrame()
@@ -588,7 +588,7 @@ class CalcUI:
# ################################ V-shape Tool Calculator ####################################################
# #############################################################################################################
# ## Title of the V-shape Tools Calculator
- v_shape_title_label = FCLabel('%s' % self.v_shapeName)
+ v_shape_title_label = FCLabel('%s' % (self.app.theme_safe_color('green'), self.v_shapeName))
self.layout.addWidget(v_shape_title_label)
v_frame = FCFrame()
@@ -662,7 +662,7 @@ class CalcUI:
# ############################## ElectroPlating Tool Calculator ###############################################
# #############################################################################################################
# ## Title of the ElectroPlating Tools Calculator
- tin_title_label = FCLabel('%s' % self.eplateName)
+ tin_title_label = FCLabel('%s' % (self.app.theme_safe_color('purple'), self.eplateName))
tin_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
"using a method like graphite ink or calcium hypophosphite ink or palladium chloride.")
@@ -848,7 +848,7 @@ class CalcUI:
# ############################## Tinning Calculator ###############################################
# #############################################################################################################
# ## Title of the Tinning Calculator
- tin_title_label = FCLabel('%s' % self.tinningName)
+ tin_title_label = FCLabel('%s' % (self.app.theme_safe_color('orange'), self.tinningName))
tin_title_label.setToolTip(
_("Calculator for chemical quantities\n"
"required for tinning PCB's.")
@@ -1011,7 +1011,7 @@ class CalcUI:
grid_tin.addWidget(separator_line, 26, 0, 1, 2)
# Volume
- self.vol_lbl = FCLabel('%s:' % _("Volume"))
+ self.vol_lbl = FCLabel('%s:' % (self.app.theme_safe_color('red'), _("Volume")))
self.vol_lbl.setToolTip(_('Desired volume of tinning solution.'))
self.vol_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.vol_entry.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding,
diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py
index 1aeae019..b0c43951 100644
--- a/appPlugins/ToolCopperThieving.py
+++ b/appPlugins/ToolCopperThieving.py
@@ -1277,7 +1277,7 @@ class ThievingUI:
# #############################################################################################################
# Source Object Frame
# #############################################################################################################
- self.grbobj_label = FCLabel('%s' % _("Source Object"))
+ self.grbobj_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.grbobj_label.setToolTip(_("Gerber Object to which will be added a copper thieving."))
self.tools_box.addWidget(self.grbobj_label)
@@ -1666,7 +1666,7 @@ class ThievingUI:
)
self.tools_box.addWidget(self.patern_mask_label)
- self.sm_obj_label = FCLabel('%s' % _("Source Object"))
+ self.sm_obj_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.sm_obj_label.setToolTip(
_("Gerber Object with the soldermask.\n"
"It will be used as a base for\n"
diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py
index fbcf9cf9..c568755f 100644
--- a/appPlugins/ToolCutOut.py
+++ b/appPlugins/ToolCutOut.py
@@ -2255,7 +2255,7 @@ class CutoutUI:
self.level.setCheckable(True)
self.title_box.addWidget(self.level)
- self.object_label = FCLabel('%s' % _("Source Object"))
+ self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.object_label.setToolTip('%s.' % _("Object to be cutout"))
self.tools_box.addWidget(self.object_label)
@@ -2309,7 +2309,7 @@ class CutoutUI:
obj_grid.addWidget(self.obj_combo, 6, 0, 1, 2)
- self.tool_sel_label = FCLabel('%s' % _('Cutout Tool'))
+ self.tool_sel_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _('Cutout Tool')))
self.tools_box.addWidget(self.tool_sel_label)
# #############################################################################################################
@@ -2367,7 +2367,7 @@ class CutoutUI:
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
# obj_grid.addWidget(separator_line, 18, 0, 1, 2)
- self.param_label = FCLabel('%s' % _("Tool Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Tool Parameters")))
self.tools_box.addWidget(self.param_label)
# #############################################################################################################
@@ -2446,7 +2446,7 @@ class CutoutUI:
param_grid.addWidget(self.margin_label, 6, 0)
param_grid.addWidget(self.margin, 6, 1)
- self.gaps_label = FCLabel('%s' % _("Gaps"))
+ self.gaps_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Gaps")))
self.tools_box.addWidget(self.gaps_label)
# #############################################################################################################
@@ -2694,7 +2694,7 @@ class CutoutUI:
# obj_grid.addWidget(FCLabel(""), 62, 0, 1, 2)
# Cut by Drilling Title
- self.title_drillcut_label = FCLabel('%s' % _('Cut by Drilling'))
+ self.title_drillcut_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Cut by Drilling')))
self.title_drillcut_label.setToolTip(_("Create a series of drill holes following a geometry line."))
self.tools_box.addWidget(self.title_drillcut_label)
diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py
index 220abdbb..8a3b7d26 100644
--- a/appPlugins/ToolDblSided.py
+++ b/appPlugins/ToolDblSided.py
@@ -720,7 +720,7 @@ class DsidedUI:
# #############################################################################################################
# Source Object
# #############################################################################################################
- self.m_objects_label = FCLabel('%s' % _("Source Object"))
+ self.m_objects_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.m_objects_label.setToolTip('%s.' % _("Objects to be mirrored"))
self.tools_box.addWidget(self.m_objects_label)
@@ -753,7 +753,7 @@ class DsidedUI:
# #############################################################################################################
# ########## BOUNDS OPERATION ###########################################################################
# #############################################################################################################
- self.bv_label = FCLabel('%s' % _('Bounds Values'))
+ self.bv_label = FCLabel('%s' % (self.app.theme_safe_color('purple'), _('Bounds Values')))
self.bv_label.setToolTip(
_("Select on canvas the object(s)\n"
"for which to calculate bounds values.")
@@ -854,7 +854,7 @@ class DsidedUI:
# #############################################################################################################
# ########## MIRROR OPERATION ###########################################################################
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Mirror Operation"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Mirror Operation")))
self.param_label.setToolTip('%s.' % _("Parameters for the mirror operation"))
self.tools_box.addWidget(self.param_label)
@@ -1024,7 +1024,7 @@ class DsidedUI:
# ########## ALIGNMENT OPERATION ########################################################################
# #############################################################################################################
# ## Alignment holes
- self.alignment_label = FCLabel('%s' % _('PCB Alignment'))
+ self.alignment_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('PCB Alignment')))
self.alignment_label.setToolTip(
_("Creates an Excellon Object containing the\n"
"specified alignment holes and their mirror\n"
diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py
index 0e0e4e00..b2de43a5 100644
--- a/appPlugins/ToolDistance.py
+++ b/appPlugins/ToolDistance.py
@@ -764,15 +764,20 @@ class Distance(AppTool):
if settings.contains("theme"):
theme = settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
+
+ if settings.contains("dark_canvas"):
+ dark_canvas = settings.value('dark_canvas', type=bool)
+ else:
+ dark_canvas = True
if self.app.use_3d_engine:
- if theme == 'white':
+ if theme == 'light' and not dark_canvas:
color = '#000000FF'
else:
color = '#FFFFFFFF'
else:
- if theme == 'white':
+ if theme == 'light' and not dark_canvas:
color = '#000000'
else:
color = '#FFFFFF'
@@ -817,7 +822,7 @@ class DistanceUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.layout.addWidget(self.param_label)
self.par_frame = FCFrame()
@@ -848,7 +853,7 @@ class DistanceUI:
# #############################################################################################################
# Coordinates Frame
# #############################################################################################################
- self.coords_label = FCLabel('%s' % _('Coordinates'))
+ self.coords_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Coordinates')))
self.layout.addWidget(self.coords_label)
coords_frame = FCFrame()
@@ -891,7 +896,7 @@ class DistanceUI:
# #############################################################################################################
# Coordinates Frame
# #############################################################################################################
- self.res_label = FCLabel('%s' % _('Results'))
+ self.res_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Results')))
self.layout.addWidget(self.res_label)
res_frame = FCFrame()
diff --git a/appPlugins/ToolDrilling.py b/appPlugins/ToolDrilling.py
index b8190f5f..71d4fe61 100644
--- a/appPlugins/ToolDrilling.py
+++ b/appPlugins/ToolDrilling.py
@@ -2400,7 +2400,7 @@ class DrillingUI:
# #############################################################################################################
# Excellon Source Object Frame
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("Excellon object for drilling/milling operation.")
)
@@ -2429,7 +2429,7 @@ class DrillingUI:
# #############################################################################################################
# Excellon Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(_("Tools in the object used for drilling."))
self.tools_box.addWidget(self.tools_table_label)
@@ -2744,7 +2744,7 @@ class DrillingUI:
# COMMON PARAMETERS Frame
# #############################################################################################################
# General Parameters
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appPlugins/ToolEtchCompensation.py b/appPlugins/ToolEtchCompensation.py
index d3c851fd..0171239e 100644
--- a/appPlugins/ToolEtchCompensation.py
+++ b/appPlugins/ToolEtchCompensation.py
@@ -313,7 +313,7 @@ class EtchUI:
# #############################################################################################################
# Source Object Frame
# #############################################################################################################
- self.gerber_label = FCLabel('%s' % _("Source Object"))
+ self.gerber_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.gerber_label.setToolTip(
_("Gerber object that will be compensated.")
)
@@ -331,7 +331,7 @@ class EtchUI:
# #############################################################################################################
# Utilities
# #############################################################################################################
- self.util_label = FCLabel('%s' % _("Utilities"))
+ self.util_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Utilities")))
self.util_label.setToolTip('%s.' % _("Conversion utilities"))
self.tools_box.addWidget(self.util_label)
@@ -389,7 +389,7 @@ class EtchUI:
# #############################################################################################################
# COMMON PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(_("Parameters used for this tool."))
self.tools_box.addWidget(self.param_label)
diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py
index adfa7491..78340a8e 100644
--- a/appPlugins/ToolExtract.py
+++ b/appPlugins/ToolExtract.py
@@ -1011,7 +1011,7 @@ class ExtractUI:
# #############################################################################################################
# Source Object
# #############################################################################################################
- self.grb_label = FCLabel('%s' % _("Source Object"))
+ self.grb_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.grb_label.setToolTip('%s.' % _("Gerber object from which to extract drill holes or soldermask."))
self.tools_box.addWidget(self.grb_label)
@@ -1027,7 +1027,7 @@ class ExtractUI:
# #############################################################################################################
# Processed Pads Frame
# #############################################################################################################
- self.padt_label = FCLabel('%s' % _("Processed Pads Type"))
+ self.padt_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Processed Pads Type")))
self.padt_label.setToolTip(
_("The type of pads shape to be processed.\n"
"If the PCB has many SMD pads with rectangular pads,\n"
@@ -1132,7 +1132,7 @@ class ExtractUI:
# #############################################################################################################
# Extract Drills Frame
# #############################################################################################################
- self.extract_drills_label = FCLabel('%s' % _("Extract Drills"))
+ self.extract_drills_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Extract Drills")))
self.extract_drills_label.setToolTip(
_("Extract an Excellon object from the Gerber pads."))
self.tools_box.addWidget(self.extract_drills_label)
@@ -1337,7 +1337,7 @@ class ExtractUI:
# Extract SolderMask Frame
# #############################################################################################################
# EXTRACT SOLDERMASK
- self.extract_sm_label = FCLabel('%s' % _("Extract Soldermask"))
+ self.extract_sm_label = FCLabel('%s' % (self.app.theme_safe_color('purple'), _("Extract Soldermask")))
self.extract_sm_label.setToolTip(
_("Extract soldermask from a given Gerber file."))
self.tools_box.addWidget(self.extract_sm_label)
@@ -1382,7 +1382,7 @@ class ExtractUI:
# Extract CutOut Frame
# #############################################################################################################
# EXTRACT CUTOUT
- self.extract_cut_label = FCLabel('%s' % _("Extract Cutout"))
+ self.extract_cut_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Extract Cutout")))
self.extract_cut_label.setToolTip(
_("Extract a cutout from a given Gerber file."))
self.tools_box.addWidget(self.extract_cut_label)
diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py
index 8b0b021d..14fada1c 100644
--- a/appPlugins/ToolFiducials.py
+++ b/appPlugins/ToolFiducials.py
@@ -937,7 +937,7 @@ class FidoUI:
# #############################################################################################################
# Gerber Source Object
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("Gerber object for adding fiducials and soldermask openings.")
)
@@ -954,7 +954,7 @@ class FidoUI:
# #############################################################################################################
# Coordinates Table Frame
# #############################################################################################################
- self.points_label = FCLabel('%s' % _('Coordinates'))
+ self.points_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Coordinates')))
self.points_label.setToolTip(
_("A table with the fiducial points coordinates,\n"
"in the format (x, y).")
@@ -1048,7 +1048,7 @@ class FidoUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
@@ -1146,7 +1146,7 @@ class FidoUI:
# #############################################################################################################
# Selection Frame
# #############################################################################################################
- self.sel_label = FCLabel('%s' % _("Selection"))
+ self.sel_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Selection")))
self.tools_box.addWidget(self.sel_label)
self.s_frame = FCFrame()
diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py
index 49bae2e2..ca912f20 100644
--- a/appPlugins/ToolFilm.py
+++ b/appPlugins/ToolFilm.py
@@ -1267,7 +1267,7 @@ class FilmUI:
# #############################################################################################################
# Source Object Frame
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("Excellon object for drilling/milling operation.")
)
@@ -1332,7 +1332,7 @@ class FilmUI:
# #############################################################################################################
# Adjustments Frame
# #############################################################################################################
- self.film_adj_label = FCLabel('%s' % _("Adjustments"))
+ self.film_adj_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Adjustments")))
self.film_adj_label.setToolTip(
_("Compensate print distortions.")
)
@@ -1351,11 +1351,6 @@ class FilmUI:
_("A value greater than 1 will compact the film\n"
"while a value less than 1 will jolt it.")
)
- self.film_scale_cb.setStyleSheet(
- """
- QCheckBox {font-weight: bold; color: black}
- """
- )
adj_grid.addWidget(self.film_scale_cb, 2, 0, 1, 2)
# Scale Type
@@ -1426,11 +1421,6 @@ class FilmUI:
_("Positive values will skew to the right\n"
"while negative values will skew to the left.")
)
- self.film_skew_cb.setStyleSheet(
- """
- QCheckBox {font-weight: bold; color: black}
- """
- )
adj_grid.addWidget(self.film_skew_cb, 14, 0, 1, 2)
# Skew Type
@@ -1501,11 +1491,6 @@ class FilmUI:
self.film_mirror_cb.setToolTip(
_("Mirror the film geometry on the selected axis or on both.")
)
- self.film_mirror_cb.setStyleSheet(
- """
- QCheckBox {font-weight: bold; color: black}
- """
- )
adj_grid.addWidget(self.film_mirror_cb, 26, 0, 1, 2)
self.film_mirror_axis = RadioSet([{'label': _('X'), 'value': 'x'},
@@ -1529,7 +1514,7 @@ class FilmUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.film_param_label = FCLabel('%s' % _("Parameters"))
+ self.film_param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.tools_box.addWidget(self.film_param_label)
par_frame = FCFrame()
@@ -1669,7 +1654,7 @@ class FilmUI:
# #############################################################################################################
# Export Frame
# #############################################################################################################
- self.export_label = FCLabel('%s' % _('Export'))
+ self.export_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Export')))
self.tools_box.addWidget(self.export_label)
exp_frame = FCFrame()
diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py
index 55104bca..7ed75170 100644
--- a/appPlugins/ToolFollow.py
+++ b/appPlugins/ToolFollow.py
@@ -695,7 +695,7 @@ class FollowUI:
# #############################################################################################################
# ################################ The object to be followed ##################################################
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("A Gerber object to be followed.\n"
"Create a Geometry object with a path\n"
@@ -713,7 +713,7 @@ class FollowUI:
# #############################################################################################################
# COMMON PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(_("Parameters that are common for all tools."))
self.tools_box.addWidget(self.param_label)
diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py
index 4a29ba1b..533bff51 100644
--- a/appPlugins/ToolInvertGerber.py
+++ b/appPlugins/ToolInvertGerber.py
@@ -220,7 +220,7 @@ class InvertUI:
# #############################################################################################################
# Source Object Frame
# #############################################################################################################
- self.gerber_label = FCLabel('%s' % _("Source Object"))
+ self.gerber_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.gerber_label.setToolTip(_("Gerber object that will be inverted."))
self.tools_box.addWidget(self.gerber_label)
@@ -241,7 +241,7 @@ class InvertUI:
# #############################################################################################################
# COMMON PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip('%s.' % _("Parameters for this tool"))
self.tools_box.addWidget(self.param_label)
diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py
index 8fc20617..9d7b1e7c 100644
--- a/appPlugins/ToolIsolation.py
+++ b/appPlugins/ToolIsolation.py
@@ -3379,7 +3379,7 @@ class IsoUI:
# #############################################################################################################
# Source Object for Isolation
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(_("Gerber object for isolation routing."))
self.tools_box.addWidget(self.obj_combo_label)
@@ -3402,7 +3402,7 @@ class IsoUI:
# #############################################################################################################
# Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
"will pick the ones used for copper clearing.")
@@ -3758,7 +3758,7 @@ class IsoUI:
# COMMON PARAMETERS
# #############################################################################################################
# General Parameters
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py
index 58f1c5a9..ce308f87 100644
--- a/appPlugins/ToolLevelling.py
+++ b/appPlugins/ToolLevelling.py
@@ -1759,7 +1759,7 @@ class LevelUI:
self.level.setCheckable(True)
self.title_box.addWidget(self.level)
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("CNCJob source object to be levelled.")
)
@@ -1836,7 +1836,7 @@ class LevelUI:
# #############################################################################################################
# ############### Probe GCode Generation ######################################################################
# #############################################################################################################
- self.probe_gc_label = FCLabel('%s' % _("Parameters"))
+ self.probe_gc_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.probe_gc_label.setToolTip(
_("Will create a GCode which will be sent to the controller,\n"
"either through a file or directly, with the intent to get the height map\n"
@@ -1953,7 +1953,7 @@ class LevelUI:
# #############################################################################################################
# Controller Frame
# #############################################################################################################
- self.al_controller_label = FCLabel('%s' % _("Controller"))
+ self.al_controller_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Controller")))
self.al_controller_label.setToolTip(
_("The kind of controller for which to generate\n"
"height map gcode.")
diff --git a/appPlugins/ToolMarkers.py b/appPlugins/ToolMarkers.py
index 82e602ad..6769cdf6 100644
--- a/appPlugins/ToolMarkers.py
+++ b/appPlugins/ToolMarkers.py
@@ -1260,7 +1260,7 @@ class MarkersUI:
# Gerber Source Object
# #############################################################################################################
- self.object_label = FCLabel('%s' % _("Source Object"))
+ self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.object_label.setToolTip(_("The Gerber object to which will be added corner markers."))
self.object_combo = FCComboBox()
@@ -1280,7 +1280,7 @@ class MarkersUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(_("Parameters used for this tool."))
self.tools_box.addWidget(self.param_label)
@@ -1334,7 +1334,7 @@ class MarkersUI:
# #############################################################################################################
# Offset Frame
# #############################################################################################################
- self.offset_title_label = FCLabel('%s' % _('Offset'))
+ self.offset_title_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Offset')))
self.offset_title_label.setToolTip(_("Offset locations from the set reference."))
self.tools_box.addWidget(self.offset_title_label)
@@ -1397,7 +1397,7 @@ class MarkersUI:
# #############################################################################################################
# Locations Frame
# #############################################################################################################
- self.locs_label = FCLabel('%s' % _('Locations'))
+ self.locs_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Locations')))
self.locs_label.setToolTip(_("Locations where to place corner markers."))
self.tools_box.addWidget(self.locs_label)
@@ -1436,7 +1436,7 @@ class MarkersUI:
# #############################################################################################################
# Selection Frame
# #############################################################################################################
- self.mode_label = FCLabel('%s' % _("Selection"))
+ self.mode_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Selection")))
self.tools_box.addWidget(self.mode_label)
self.s_frame = FCFrame()
@@ -1495,7 +1495,7 @@ class MarkersUI:
# Drill in markers Frame
# #############################################################################################################
# Drill is markers
- self.drills_label = FCLabel('%s' % _('Drills in Locations'))
+ self.drills_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Drills in Locations')))
self.tools_box.addWidget(self.drills_label)
self.drill_frame = FCFrame()
@@ -1535,7 +1535,7 @@ class MarkersUI:
# #############################################################################################################
# Check in Locations Frame
# #############################################################################################################
- self.check_label = FCLabel('%s' % _('Check in Locations'))
+ self.check_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _('Check in Locations')))
self.tools_box.addWidget(self.check_label)
# ## Create an Excellon object for checking the positioning
@@ -1558,7 +1558,7 @@ class MarkersUI:
# #############################################################################################################
# Insert Markers Frame
# #############################################################################################################
- self.insert_label = FCLabel('%s' % _('Insert Markers'))
+ self.insert_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _('Insert Markers')))
self.insert_label.setToolTip(
_("Enabled only if markers are available (added to an object).\n"
"Those markers will be inserted in yet another object.")
diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py
index 0ffb8646..bc073a7e 100644
--- a/appPlugins/ToolMilling.py
+++ b/appPlugins/ToolMilling.py
@@ -3944,7 +3944,7 @@ class MillingUI:
# #############################################################################################################
# Source Object for Milling Frame
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("Source object for milling operation.")
)
@@ -3996,7 +3996,7 @@ class MillingUI:
tool_title_grid = GLay(v_spacing=5, h_spacing=3)
self.tools_box.addLayout(tool_title_grid)
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(
_("Tools in the object used for milling.")
)
@@ -4760,7 +4760,7 @@ class MillingUI:
# COMMON PARAMETERS
# #############################################################################################################
# General Parameters
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py
index a6b2e444..9be84109 100644
--- a/appPlugins/ToolNCC.py
+++ b/appPlugins/ToolNCC.py
@@ -4061,7 +4061,7 @@ class NccUI:
# #############################################################################################################
# Source Object for Paint Frame
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("Source object for milling operation.")
)
@@ -4111,7 +4111,7 @@ class NccUI:
# Tool Table Frame
# #############################################################################################################
# ### Tools ## ##
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
"will pick the ones used for copper clearing.")
@@ -4444,7 +4444,7 @@ class NccUI:
# General Parameters Frame
# #############################################################################################################
# General Parameters
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
diff --git a/appPlugins/ToolObjectDistance.py b/appPlugins/ToolObjectDistance.py
index 98446b44..3ef5fbce 100644
--- a/appPlugins/ToolObjectDistance.py
+++ b/appPlugins/ToolObjectDistance.py
@@ -444,7 +444,7 @@ class ObjectDistanceUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
@@ -473,7 +473,7 @@ class ObjectDistanceUI:
# #############################################################################################################
# Coordinates Frame
# #############################################################################################################
- self.coords_label = FCLabel('%s' % _('Coordinates'))
+ self.coords_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Coordinates')))
self.layout.addWidget(self.coords_label)
coords_frame = FCFrame()
@@ -516,7 +516,7 @@ class ObjectDistanceUI:
# #############################################################################################################
# Coordinates Frame
# #############################################################################################################
- self.res_label = FCLabel('%s' % _('Results'))
+ self.res_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Results')))
self.layout.addWidget(self.res_label)
res_frame = FCFrame()
diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py
index 55c9278b..979d2e69 100644
--- a/appPlugins/ToolOptimal.py
+++ b/appPlugins/ToolOptimal.py
@@ -481,7 +481,7 @@ class OptimalUI:
# #############################################################################################################
# Gerber Source Object
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
"Gerber object for which to find the minimum distance between copper features."
)
@@ -508,7 +508,7 @@ class OptimalUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(_("Parameters used for this tool."))
self.layout.addWidget(self.param_label)
@@ -531,7 +531,7 @@ class OptimalUI:
# #############################################################################################################
# Results Frame
# #############################################################################################################
- res_label = FCLabel('%s' % _("Minimum distance"))
+ res_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Minimum distance")))
res_label.setToolTip(_("Display minimum distance between copper features."))
self.layout.addWidget(res_label)
@@ -595,7 +595,7 @@ class OptimalUI:
# #############################################################################################################
# Other Distances
# #############################################################################################################
- self.title_second_res_label = FCLabel('%s' % _("Other distances"))
+ self.title_second_res_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _("Other distances")))
self.title_second_res_label.setToolTip(_("Will display other distances in the Gerber file ordered from\n"
"the minimum to the maximum, not including the absolute minimum."))
self.layout.addWidget(self.title_second_res_label)
diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py
index c8f4e059..88bb71b6 100644
--- a/appPlugins/ToolPaint.py
+++ b/appPlugins/ToolPaint.py
@@ -2946,7 +2946,7 @@ class PaintUI:
# #############################################################################################################
# Source Object for Paint Frame
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip(
_("Source object for milling operation.")
)
@@ -2996,7 +2996,7 @@ class PaintUI:
# Tool Table Frame
# #############################################################################################################
# ### Tools ## ##
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
"will pick the ones used for painting.")
@@ -3243,7 +3243,7 @@ class PaintUI:
# General Parameters Frame
# #############################################################################################################
# General Parameters
- self.gen_param_label = FCLabel('%s' % _("Common Parameters"))
+ self.gen_param_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Common Parameters")))
self.gen_param_label.setToolTip(_("Parameters that are common for all tools."))
self.tools_box.addWidget(self.gen_param_label)
diff --git a/appPlugins/ToolPanelize.py b/appPlugins/ToolPanelize.py
index d83aa42f..5b756c4b 100644
--- a/appPlugins/ToolPanelize.py
+++ b/appPlugins/ToolPanelize.py
@@ -1160,7 +1160,7 @@ class PanelizeUI:
# #############################################################################################################
# Source Object Frame
# #############################################################################################################
- self.object_label = FCLabel('%s' % _("Source Object"))
+ self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.object_label.setToolTip(
_("Specify the type of object to be panelized\n"
"It can be of type: Gerber, Excellon or Geometry.\n"
@@ -1205,7 +1205,7 @@ class PanelizeUI:
# Reference Object Frame
# #############################################################################################################
# Type of box Panel object
- self.box_label = FCLabel('%s' % _("Reference"))
+ self.box_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Reference")))
self.box_label.setToolTip(
_("Choose the reference for panelization:\n"
"- Object = the bounding box of a different object\n"
@@ -1263,7 +1263,7 @@ class PanelizeUI:
# #############################################################################################################
# Panel Data Frame
# #############################################################################################################
- panel_data_label = FCLabel('%s' % _("Panel Data"))
+ panel_data_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Panel Data")))
panel_data_label.setToolTip(
_("This informations will shape the resulting panel.\n"
"The number of rows and columns will set how many\n"
@@ -1331,7 +1331,7 @@ class PanelizeUI:
# #############################################################################################################
# COMMON PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(_("Parameters that are common for all tools."))
self.tools_box.addWidget(self.param_label)
diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py
index 29888ac2..44876fa3 100644
--- a/appPlugins/ToolPunchGerber.py
+++ b/appPlugins/ToolPunchGerber.py
@@ -2027,7 +2027,7 @@ class PunchUI:
# #############################################################################################################
# Source Object Frame
# #############################################################################################################
- self.obj_combo_label = FCLabel('%s' % _("Source Object"))
+ self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.obj_combo_label.setToolTip('%s.' % _("Gerber into which to punch holes"))
self.tools_box.addWidget(self.obj_combo_label)
@@ -2044,7 +2044,7 @@ class PunchUI:
grid0.addWidget(self.gerber_object_combo, 0, 0, 1, 2)
- self.padt_label = FCLabel('%s' % _("Processed Pads Type"))
+ self.padt_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Processed Pads Type")))
self.padt_label.setToolTip(
_("The type of pads shape to be processed.\n"
"If the PCB has many SMD pads with rectangular pads,\n"
@@ -2140,7 +2140,7 @@ class PunchUI:
# #############################################################################################################
# Method Frame
# #############################################################################################################
- self.method_label = FCLabel('%s' % _("Method"))
+ self.method_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Method")))
self.method_label.setToolTip(
_("The punch hole source can be:\n"
"- Excellon Object-> the Excellon object drills center will serve as reference.\n"
@@ -2317,7 +2317,7 @@ class PunchUI:
# Selection Frame
# #############################################################################################################
# Selection
- self.sel_label = FCLabel('%s' % _("Selection"))
+ self.sel_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Selection")))
self.tools_box.addWidget(self.sel_label)
self.s_frame = FCFrame()
diff --git a/appPlugins/ToolQRCode.py b/appPlugins/ToolQRCode.py
index b77b6359..77ed3029 100644
--- a/appPlugins/ToolQRCode.py
+++ b/appPlugins/ToolQRCode.py
@@ -758,7 +758,7 @@ class QRcodeUI:
self.grb_object_combo.is_last = True
self.grb_object_combo.obj_type = "Gerber"
- self.grbobj_label = FCLabel('%s' % _("Source Object"))
+ self.grbobj_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.grbobj_label.setToolTip(
_("Gerber Object to which the QRCode will be added.")
)
@@ -770,7 +770,7 @@ class QRcodeUI:
# QrCode Text Frame
# #############################################################################################################
# Text box
- self.text_label = FCLabel('%s' % _("QRCode Data"))
+ self.text_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("QRCode Data")))
self.text_label.setToolTip(
_("QRCode Data. Alphanumeric text to be encoded in the QRCode.")
)
@@ -798,7 +798,7 @@ class QRcodeUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.qrcode_label = FCLabel('%s' % _('Parameters'))
+ self.qrcode_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.qrcode_label.setToolTip(
_("The parameters used to shape the QRCode.")
)
@@ -910,7 +910,7 @@ class QRcodeUI:
# Export Frame
# #############################################################################################################
# Export QRCode
- self.export_label = FCLabel('%s' % _("Export QRCode"))
+ self.export_label = FCLabel('%s' % (self.app.theme_safe_color('darkgreen'), _("Export QRCode")))
self.export_label.setToolTip(
_("Show a set of controls allowing to export the QRCode\n"
"to a SVG file or an PNG file.")
diff --git a/appPlugins/ToolReport.py b/appPlugins/ToolReport.py
index aef803c8..1e93783e 100644
--- a/appPlugins/ToolReport.py
+++ b/appPlugins/ToolReport.py
@@ -158,7 +158,7 @@ class ObjectReport(AppTool):
font = QtGui.QFont()
font.setBold(True)
- p_color = QtGui.QColor("#000000") if self.app.options['global_theme'] == 'white' \
+ p_color = QtGui.QColor("#000000") if self.app.options['global_theme'] == 'light' \
else QtGui.QColor("#FFFFFF")
# main Items categories
diff --git a/appPlugins/ToolRulesCheck.py b/appPlugins/ToolRulesCheck.py
index 9c7ab559..8267f647 100644
--- a/appPlugins/ToolRulesCheck.py
+++ b/appPlugins/ToolRulesCheck.py
@@ -1182,7 +1182,7 @@ class RulesUI:
# #############################################################################################################
# Select All Frame
# #############################################################################################################
- select_all_label = FCLabel('%s' % _("Select All"))
+ select_all_label = FCLabel('%s' % (self.app.theme_safe_color('CornflowerBlue'), _("Select All")))
self.layout.addWidget(select_all_label)
sel_frame = FCFrame()
@@ -1236,7 +1236,7 @@ class RulesUI:
# #############################################################################################################
# Top Gerber Frame
# #############################################################################################################
- top_label = FCLabel('%s' % _("Top"))
+ top_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Top")))
self.layout.addWidget(top_label)
top_frame = FCFrame()
@@ -1302,7 +1302,7 @@ class RulesUI:
# #############################################################################################################
# Bottom Gerber Frame
# #############################################################################################################
- bottom_label = FCLabel('%s' % _("Bottom"))
+ bottom_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Bottom")))
self.layout.addWidget(bottom_label)
bottom_frame = FCFrame()
@@ -1368,7 +1368,7 @@ class RulesUI:
# #############################################################################################################
# Outline Frame
# #############################################################################################################
- outline_label = FCLabel('%s' % _("Outline"))
+ outline_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Outline")))
self.layout.addWidget(outline_label)
outline_frame = FCFrame()
@@ -1397,7 +1397,7 @@ class RulesUI:
# #############################################################################################################
# Excellon Frame
# #############################################################################################################
- exc_label = FCLabel('%s' % _("Excellon"))
+ exc_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Excellon")))
exc_label.setToolTip(
_("Excellon objects for which to check rules.")
)
@@ -1460,7 +1460,7 @@ class RulesUI:
# #############################################################################################################
# Rules Frame
# #############################################################################################################
- rules_copper_label = FCLabel('%s %s' % (_("Copper"), _("Rules")))
+ rules_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('darkorange'), _("Copper"), _("Rules")))
self.layout.addWidget(rules_copper_label)
copper_frame = FCFrame()
@@ -1570,7 +1570,7 @@ class RulesUI:
# #############################################################################################################
# Silk Frame
# #############################################################################################################
- silk_copper_label = FCLabel('%s %s' % (_("Silk"), _("Rules")))
+ silk_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('teal'), _("Silk"), _("Rules")))
self.layout.addWidget(silk_copper_label)
silk_frame = FCFrame()
@@ -1657,7 +1657,7 @@ class RulesUI:
# #############################################################################################################
# Soldermask Frame
# #############################################################################################################
- sm_copper_label = FCLabel('%s %s' % (_("Soldermask"), _("Rules")))
+ sm_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('magenta'), _("Soldermask"), _("Rules")))
self.layout.addWidget(sm_copper_label)
solder_frame = FCFrame()
@@ -1695,7 +1695,7 @@ class RulesUI:
# #############################################################################################################
# Holes Frame
# #############################################################################################################
- holes_copper_label = FCLabel('%s %s' % (_("Holes"), _("Rules")))
+ holes_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('brown'), _("Holes"), _("Rules")))
self.layout.addWidget(holes_copper_label)
holes_frame = FCFrame()
diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py
index f69953fa..5a8fba09 100644
--- a/appPlugins/ToolSolderPaste.py
+++ b/appPlugins/ToolSolderPaste.py
@@ -1215,7 +1215,7 @@ class SolderUI:
# #############################################################################################################
# Source Object
# #############################################################################################################
- self.object_label = FCLabel('%s' % _("Source Object"))
+ self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object")))
self.object_label.setToolTip(_("Gerber Solderpaste object."))
self.tools_box.addWidget(self.object_label)
@@ -1235,7 +1235,7 @@ class SolderUI:
# #############################################################################################################
# Tool Table Frame
# #############################################################################################################
- self.tools_table_label = FCLabel('%s' % _('Tools Table'))
+ self.tools_table_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Tools Table')))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
"will pick the ones used for dispensing solder paste.")
@@ -1304,7 +1304,7 @@ class SolderUI:
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _('Parameters'))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters')))
self.param_label.setToolTip(
_("Parameters used for this tool.")
)
@@ -1333,7 +1333,7 @@ class SolderUI:
# #############################################################################################################
# Dispense Frame
# #############################################################################################################
- self.disp_lbl = FCLabel('%s' % _('Dispense'))
+ self.disp_lbl = FCLabel('%s' % (self.app.theme_safe_color('tomato'), _('Dispense')))
self.tools_box.addWidget(self.disp_lbl)
disp_frame = FCFrame()
@@ -1384,7 +1384,7 @@ class SolderUI:
# #############################################################################################################
# Toolchange Frame
# #############################################################################################################
- self.toolchnage_lbl = FCLabel('%s' % _("Tool change"))
+ self.toolchnage_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Tool change")))
self.tools_box.addWidget(self.toolchnage_lbl)
tc_frame = FCFrame()
@@ -1419,7 +1419,7 @@ class SolderUI:
# #############################################################################################################
# Feedrate Frame
# #############################################################################################################
- fr_lbl = FCLabel('%s' % _("Feedrate"))
+ fr_lbl = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Feedrate")))
self.tools_box.addWidget(fr_lbl)
fr_frame = FCFrame()
@@ -1472,7 +1472,7 @@ class SolderUI:
# #############################################################################################################
# Spindle Forward Frame
# #############################################################################################################
- sp_fw_lbl = FCLabel('%s' % _("Forward"))
+ sp_fw_lbl = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Forward")))
self.tools_box.addWidget(sp_fw_lbl)
sp_fw_frame = FCFrame()
@@ -1510,7 +1510,7 @@ class SolderUI:
# #############################################################################################################
# Spindle Reverse Frame
# #############################################################################################################
- sp_rev_lbl = FCLabel('%s' % _("Reverse"))
+ sp_rev_lbl = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Reverse")))
self.tools_box.addWidget(sp_rev_lbl)
sp_rev_frame = FCFrame()
@@ -1566,7 +1566,7 @@ class SolderUI:
# #############################################################################################################
# Geometry Frame
# #############################################################################################################
- geo_lbl = FCLabel('%s' % _("Geometry"))
+ geo_lbl = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Geometry")))
self.tools_box.addWidget(geo_lbl)
geo_frame = FCFrame()
@@ -1607,7 +1607,7 @@ class SolderUI:
# #############################################################################################################
# CNCJob Frame
# #############################################################################################################
- cnc_lbl = FCLabel('%s' % _("CNCJob"))
+ cnc_lbl = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("CNCJob")))
self.tools_box.addWidget(cnc_lbl)
cnc_frame = FCFrame()
diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py
index a973a280..f8b91fab 100644
--- a/appPlugins/ToolSub.py
+++ b/appPlugins/ToolSub.py
@@ -807,7 +807,7 @@ class SubUI:
# #############################################################################################################
# COMMON PARAMETERS Frame
# #############################################################################################################
- self.param_label = FCLabel('%s' % _("Parameters"))
+ self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.param_label.setToolTip(_("Parameters that are common for all tools."))
self.tools_box.addWidget(self.param_label)
@@ -827,7 +827,7 @@ class SubUI:
# #############################################################################################################
# Gerber Subtraction Frame
# #############################################################################################################
- self.grb_label = FCLabel('%s' % _("Gerber"))
+ self.grb_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Gerber")))
self.tools_box.addWidget(self.grb_label)
grb_frame = FCFrame()
@@ -892,7 +892,7 @@ class SubUI:
# #############################################################################################################
# Geometry Subtraction Frame
# #############################################################################################################
- self.geo_label = FCLabel('%s' % _("Geometry"))
+ self.geo_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Geometry")))
self.tools_box.addWidget(self.geo_label)
geo_frame = FCFrame()
diff --git a/appPlugins/ToolTransform.py b/appPlugins/ToolTransform.py
index 70402a63..0bf8633f 100644
--- a/appPlugins/ToolTransform.py
+++ b/appPlugins/ToolTransform.py
@@ -590,7 +590,7 @@ class TransformUI:
# #############################################################################################################
# PARAMETERS
# #############################################################################################################
- self.transform_label = FCLabel('%s' % _("Parameters"))
+ self.transform_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters")))
self.layout.addWidget(self.transform_label)
# #############################################################################################################
@@ -671,7 +671,7 @@ class TransformUI:
# #############################################################################################################
# Rotate Frame
# #############################################################################################################
- rotate_title_lbl = FCLabel('%s' % _("Rotate"))
+ rotate_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('tomato'), _("Rotate")))
self.layout.addWidget(rotate_title_lbl)
rot_frame = FCFrame()
@@ -714,7 +714,7 @@ class TransformUI:
s_t_lay = QtWidgets.QHBoxLayout()
self.layout.addLayout(s_t_lay)
- skew_title_lbl = FCLabel('%s' % _("Skew"))
+ skew_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Skew")))
s_t_lay.addWidget(skew_title_lbl)
s_t_lay.addStretch()
@@ -785,7 +785,7 @@ class TransformUI:
sc_t_lay = QtWidgets.QHBoxLayout()
self.layout.addLayout(sc_t_lay)
- scale_title_lbl = FCLabel('%s' % _("Scale"))
+ scale_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _("Scale")))
sc_t_lay.addWidget(scale_title_lbl)
sc_t_lay.addStretch()
@@ -853,7 +853,7 @@ class TransformUI:
# #############################################################################################################
# Mirror Frame
# #############################################################################################################
- flip_title_label = FCLabel('%s' % self.flipName)
+ flip_title_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), self.flipName))
self.layout.addWidget(flip_title_label)
mirror_frame = FCFrame()
@@ -881,7 +881,7 @@ class TransformUI:
# #############################################################################################################
# Offset Frame
# #############################################################################################################
- offset_title_lbl = FCLabel('%s' % _("Offset"))
+ offset_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Offset")))
self.layout.addWidget(offset_title_lbl)
off_frame = FCFrame()
@@ -936,7 +936,7 @@ class TransformUI:
b_t_lay = QtWidgets.QHBoxLayout()
self.layout.addLayout(b_t_lay)
- buffer_title_lbl = FCLabel('%s' % _("Buffer"))
+ buffer_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Buffer")))
b_t_lay.addWidget(buffer_title_lbl)
b_t_lay.addStretch()
diff --git a/appTranslation.py b/appTranslation.py
index 470ccaba..ed0964e9 100644
--- a/appTranslation.py
+++ b/appTranslation.py
@@ -93,12 +93,12 @@ def on_language_apply_click(app, restart=False):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
resource_loc = 'assets/resources'
else:
- resource_loc = 'assets/resources'
+ resource_loc = 'assets/resources/dark_resources'
# do nothing if trying to apply the language that is the current language (already applied).
settings = QSettings("Open Source", "FlatCAM")
@@ -190,12 +190,12 @@ def restart_program(app, ask=None):
if theme_settings.contains("theme"):
theme = theme_settings.value('theme', type=str)
else:
- theme = 'white'
+ theme = 'light'
- if theme == 'white':
+ if theme == 'light':
resource_loc = 'assets/resources'
else:
- resource_loc = 'assets/resources'
+ resource_loc = 'assets/resources/dark_resources'
# try to quit the Socket opened by ArgsThread class
try:
diff --git a/camlib.py b/camlib.py
index 03565efc..ba507532 100644
--- a/camlib.py
+++ b/camlib.py
@@ -7192,7 +7192,7 @@ class CNCjob(Geometry):
return
try:
- if self.app.options['global_theme'] == 'white':
+ if self.app.options['global_theme'] == 'light':
obj.annotation.set(text=text, pos=pos, visible=obj.obj_options['plot'],
font_size=self.app.options["cncjob_annotation_fontsize"],
color=self.app.options["cncjob_annotation_fontcolor"])
diff --git a/defaults.py b/defaults.py
index 9ac91f05..f8f16e25 100644
--- a/defaults.py
+++ b/defaults.py
@@ -113,6 +113,7 @@ class AppDefaults:
# General GUI Preferences
"global_appearance": 'auto',
+ "global_dark_canvas": True,
"global_layout": "compact",
"global_hover_shape": False,
@@ -128,8 +129,8 @@ class AppDefaults:
# Project Items colors
"global_proj_item_color_light": '#000000FF',
"global_proj_item_dis_color_light": '#b7b7cbFF',
- "global_proj_item_color_dark": '#4385C8FF',
- "global_proj_item_dis_color_dark": '#61616CFF',
+ "global_proj_item_color_dark": '#F2F2F2FF',
+ "global_proj_item_dis_color_dark": '#a6a6a6ff',
"global_project_autohide": True,
diff --git a/requirements.txt b/requirements.txt
index 37809140..be98b3e6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -43,4 +43,7 @@ vispy>=0.9.0
pyqtdarktheme
gdal
-rasterio
\ No newline at end of file
+rasterio
+
+# To detect OS dark mode
+darkdetect