From adad500f1548793af76ed51e7883e063e24b6bb9 Mon Sep 17 00:00:00 2001 From: Ali Khalil Date: Mon, 11 Apr 2022 12:13:49 +0300 Subject: [PATCH 01/15] Theme option added to match OS appearance. Sets appearance on application launch. --- appGUI/preferences/PreferencesUIManager.py | 25 +++++++------- .../general/GeneralGUIPrefGroupUI.py | 29 ++++++++-------- appMain.py | 33 ++++++++++++------- appObjects/AppObjectTemplate.py | 2 +- appPlugins/ToolReport.py | 2 +- defaults.py | 3 +- 6 files changed, 49 insertions(+), 45 deletions(-) diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index a5acde02..7c320beb 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -73,8 +73,7 @@ class PreferencesUIManager(QtCore.QObject): "global_tpdf_rmargin": self.ui.general_pref_form.general_app_group.rmargin_entry, # General GUI Preferences - "global_theme": self.ui.general_pref_form.general_gui_group.theme_radio, - "global_gray_icons": self.ui.general_pref_form.general_gui_group.gray_icons_cb, + "global_appearance": self.ui.general_pref_form.general_gui_group.appearance_radio, "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, @@ -1064,20 +1063,20 @@ class PreferencesUIManager(QtCore.QObject): # make sure we update the self.current_defaults dict used to undo changes to self.defaults self.defaults.current_defaults.update(self.defaults) - # deal with theme change - theme_settings = QtCore.QSettings("Open Source", "FlatCAM") - if theme_settings.contains("theme"): - theme = theme_settings.value('theme', type=str) + # deal with appearance change + appearance_settings = QtCore.QSettings("Open Source", "FlatCAM") + if appearance_settings.contains("appearance"): + appearance = appearance_settings.value('appearance', type=str) else: - theme = 'white' + appearance = None should_restart = False - theme_new_val = self.ui.general_pref_form.general_gui_group.theme_radio.get_value() + appearance_new_val = self.ui.general_pref_form.general_gui_group.appearance_radio.get_value() ge = self.defaults["global_graphic_engine"] ge_val = self.ui.general_pref_form.general_app_group.ge_radio.get_value() - if theme_new_val != theme or ge != ge_val: + if appearance_new_val != appearance or ge != ge_val: msgbox = FCMessageBox(parent=self.ui) title = _("Application will restart") txt = _("Are you sure you want to continue?") @@ -1094,16 +1093,16 @@ class PreferencesUIManager(QtCore.QObject): msgbox.exec() response = msgbox.clickedButton() - if theme_new_val != theme: + if appearance_new_val != appearance: if response == bt_yes: - theme_settings.setValue('theme', theme_new_val) + appearance_settings.setValue('appearance', appearance_new_val) # This will write the setting to the platform specific storage. - del theme_settings + del appearance_settings should_restart = True else: - self.ui.general_pref_form.general_gui_group.theme_radio.set_value(theme) + self.ui.general_pref_form.general_gui_group.appearance_radio.set_value(appearance) else: if response == bt_yes: self.defaults["global_graphic_engine"] = ge_val diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index 7278ac01..90090f7b 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -35,28 +35,25 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): par_frame.setLayout(grid0) # Theme selection - self.theme_label = FCLabel('%s:' % _('Theme')) - self.theme_label.setToolTip( + self.appearance_label = FCLabel('%s:' % _('Theme')) + self.appearance_label.setToolTip( _("Select a theme for the application.\n" "It will theme the plot area.") ) - self.theme_radio = RadioSet([ - {"label": _("Light"), "value": "white"}, - {"label": _("Dark"), "value": "black"} + self.appearance_radio = RadioSet([ + {"label": _("OS Dependent"), "value": "auto"}, + {"label": _("Light"), "value": "light"}, + {"label": _("Dark"), "value": "dark"} ], compact=True) - - grid0.addWidget(self.theme_label, 0, 0) - grid0.addWidget(self.theme_radio, 0, 1) - - # Enable Gray Icons - self.gray_icons_cb = FCCheckBox('%s' % _('Use Gray Icons')) - self.gray_icons_cb.setToolTip( - _("Check this box to use a set of icons with\n" - "a lighter (gray) color. To be used when a\n" - "full dark theme is applied.") + self.appearance_radio.setToolTip( + _("OS Dependent: Matches mode from OS\n" + "Light: Light mode\n" + "Dark: Dark mode") ) - grid0.addWidget(self.gray_icons_cb, 2, 0, 1, 3) + + grid0.addWidget(self.appearance_label, 0, 0) + grid0.addWidget(self.appearance_radio, 0, 1) # self.theme_button = FCButton(_("Apply Theme")) # self.theme_button.setToolTip( diff --git a/appMain.py b/appMain.py index 2e65be08..98da0974 100644 --- a/appMain.py +++ b/appMain.py @@ -108,6 +108,8 @@ import gettext import appTranslation as fcTranslate import builtins +import darkdetect + if sys.platform == 'win32': import winreg @@ -610,6 +612,20 @@ class App(QtCore.QObject): # self.preferencesUiManager.show_preferences_gui() + # Set global_theme based on appearance + if self.options["global_appearance"] == 'auto': + if darkdetect.isDark(): + theme = 'black' + else: + theme = 'white' + else: + if self.options["global_appearance"] == 'dark': + theme = 'black' + else: + theme = 'white' + + self.options["global_theme"] = theme + self.app_units = self.options["units"] self.default_units = self.defaults["units"] @@ -618,16 +634,12 @@ class App(QtCore.QObject): else: self.decimals = int(self.options['decimals_inch']) - if self.options["global_gray_icons"] is False: + if self.options["global_theme"] == 'white': self.resource_location = 'assets/resources' + self.qapp.setStyleSheet(qdarktheme.load_stylesheet('light')) else: self.resource_location = 'assets/resources/dark_resources' - - # ############################################################################################################# - # ######################################### DARK THEME ######################################################## - # ############################################################################################################# - if self.options["global_gray_icons"] is True: - qdarksheet.STYLE_SHEET = style_sheet.D_STYLE_SHEET # patching so I can do my own changes to the theme + qdarksheet.STYLE_SHEET = style_sheet.D_STYLE_SHEET self.qapp.setStyleSheet(qdarktheme.load_stylesheet()) # ########################################################################################################### @@ -1021,10 +1033,7 @@ class App(QtCore.QObject): self.FC_dark_blue = '#0000ffbf' theme_settings = QtCore.QSettings("Open Source", "FlatCAM") - if theme_settings.contains("theme"): - theme = theme_settings.value('theme', type=str) - else: - theme = 'white' + theme_settings.setValue("theme", self.options["global_theme"]) if self.options["global_cursor_color_enabled"]: self.cursor_color_3D = self.options["global_cursor_color"] @@ -8625,7 +8634,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_gray_icons'] is False else QtGui.QColor("#FFFFFF") + p_color = QtGui.QColor("#000000") if self.options['global_theme'] == 'white' else QtGui.QColor("#FFFFFF") # main Items categories general_cat = d_properties_tw.addParent(root, _('General'), expanded=True, color=p_color, font=font) diff --git a/appObjects/AppObjectTemplate.py b/appObjects/AppObjectTemplate.py index 192bb636..711233f3 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_gray_icons'] is False \ + p_color = QtGui.QColor("#000000") if self.app.options['global_theme'] == 'white' \ else QtGui.QColor("#FFFFFF") # main Items categories diff --git a/appPlugins/ToolReport.py b/appPlugins/ToolReport.py index c8193269..aef803c8 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_gray_icons'] is False \ + p_color = QtGui.QColor("#000000") if self.app.options['global_theme'] == 'white' \ else QtGui.QColor("#FFFFFF") # main Items categories diff --git a/defaults.py b/defaults.py index 1bf2634e..9ac91f05 100644 --- a/defaults.py +++ b/defaults.py @@ -112,8 +112,7 @@ class AppDefaults: "global_tpdf_rmargin": 20.0, # General GUI Preferences - "global_theme": 'white', - "global_gray_icons": False, + "global_appearance": 'auto', "global_layout": "compact", "global_hover_shape": False, From 5cc869c1fd0893834b059867436ad850b2a389ea Mon Sep 17 00:00:00 2001 From: Ali Khalil Date: Sun, 17 Apr 2022 22:41:02 +0300 Subject: [PATCH 02/15] Application wide updates for dark mode support including dark canvas option and better colors --- .gitignore | 1 + CHANGELOG.md | 5 +- appDatabase.py | 2 +- appGUI/MainGUI.py | 358 +++++++++--------- appGUI/ObjectUI.py | 64 ++-- appGUI/PlotCanvas.py | 20 +- appGUI/PlotCanvas3d.py | 11 +- appGUI/PlotCanvasLegacy.py | 21 +- appGUI/VisPyCanvas.py | 18 +- appGUI/preferences/OptionUI.py | 2 +- appGUI/preferences/PreferencesUIManager.py | 26 +- .../cncjob/CNCJobAdvOptPrefGroupUI.py | 2 +- .../cncjob/CNCJobEditorPrefGroupUI.py | 2 +- .../cncjob/CNCJobGenPrefGroupUI.py | 8 +- .../cncjob/CNCJobOptPrefGroupUI.py | 2 +- appGUI/preferences/cncjob/CNCJobPPGroupUI.py | 2 +- .../excellon/ExcellonAdvOptPrefGroupUI.py | 2 +- .../excellon/ExcellonEditorPrefGroupUI.py | 12 +- .../excellon/ExcellonExpPrefGroupUI.py | 2 +- .../excellon/ExcellonGenPrefGroupUI.py | 10 +- .../excellon/ExcellonOptPrefGroupUI.py | 2 +- .../general/GeneralAPPSetGroupUI.py | 27 +- .../general/GeneralAppPrefGroupUI.py | 14 +- .../general/GeneralAppSettingsGroupUI.py | 9 +- .../general/GeneralGUIPrefGroupUI.py | 23 +- .../geometry/GeometryAdvOptPrefGroupUI.py | 2 +- .../geometry/GeometryEditorPrefGroupUI.py | 2 +- .../geometry/GeometryExpPrefGroupUI.py | 2 +- .../geometry/GeometryGenPrefGroupUI.py | 8 +- .../geometry/GeometryOptPrefGroupUI.py | 2 +- .../gerber/GerberEditorPrefGroupUI.py | 12 +- .../gerber/GerberGenPrefGroupUI.py | 10 +- .../gerber/GerberOptPrefGroupUI.py | 4 +- .../tools/Tools2CThievingPrefGroupUI.py | 6 +- .../preferences/tools/Tools2CalPrefGroupUI.py | 4 +- .../tools/Tools2ExtractPrefGroupUI.py | 14 +- .../tools/Tools2FiducialsPrefGroupUI.py | 4 +- .../tools/Tools2InvertPrefGroupUI.py | 4 +- .../tools/Tools2OptimalPrefGroupUI.py | 2 +- .../tools/Tools2PunchGerberPrefGroupUI.py | 10 +- .../tools/Tools2QRCodePrefGroupUI.py | 2 +- .../tools/Tools2RulesCheckPrefGroupUI.py | 8 +- .../tools/Tools2sidedPrefGroupUI.py | 4 +- .../tools/ToolsCalculatorsPrefGroupUI.py | 4 +- .../tools/ToolsCutoutPrefGroupUI.py | 6 +- .../tools/ToolsDrillPrefGroupUI.py | 8 +- .../preferences/tools/ToolsFilmPrefGroupUI.py | 19 +- .../preferences/tools/ToolsISOPrefGroupUI.py | 6 +- .../tools/ToolsLevelPrefGroupUI.py | 2 +- .../tools/ToolsMarkersPrefGroupUI.py | 4 +- .../preferences/tools/ToolsMillPrefGroupUI.py | 10 +- .../preferences/tools/ToolsNCCPrefGroupUI.py | 6 +- .../tools/ToolsPaintPrefGroupUI.py | 6 +- .../tools/ToolsPanelizePrefGroupUI.py | 2 +- .../tools/ToolsSolderpastePrefGroupUI.py | 2 +- .../preferences/tools/ToolsSubPrefGroupUI.py | 2 +- .../tools/ToolsTransformPrefGroupUI.py | 12 +- appMain.py | 135 +++++-- appObjects/AppObjectTemplate.py | 2 +- appObjects/ObjectCollection.py | 2 +- appPlugins/ToolAlignObjects.py | 6 +- appPlugins/ToolCalculators.py | 10 +- appPlugins/ToolCopperThieving.py | 4 +- appPlugins/ToolCutOut.py | 10 +- appPlugins/ToolDblSided.py | 8 +- appPlugins/ToolDistance.py | 17 +- appPlugins/ToolDrilling.py | 6 +- appPlugins/ToolEtchCompensation.py | 6 +- appPlugins/ToolExtract.py | 10 +- appPlugins/ToolFiducials.py | 8 +- appPlugins/ToolFilm.py | 23 +- appPlugins/ToolFollow.py | 4 +- appPlugins/ToolInvertGerber.py | 4 +- appPlugins/ToolIsolation.py | 6 +- appPlugins/ToolLevelling.py | 6 +- appPlugins/ToolMarkers.py | 16 +- appPlugins/ToolMilling.py | 6 +- appPlugins/ToolNCC.py | 6 +- appPlugins/ToolObjectDistance.py | 6 +- appPlugins/ToolOptimal.py | 8 +- appPlugins/ToolPaint.py | 6 +- appPlugins/ToolPanelize.py | 8 +- appPlugins/ToolPunchGerber.py | 8 +- appPlugins/ToolQRCode.py | 8 +- appPlugins/ToolReport.py | 2 +- appPlugins/ToolRulesCheck.py | 18 +- appPlugins/ToolSolderPaste.py | 20 +- appPlugins/ToolSub.py | 6 +- appPlugins/ToolTransform.py | 14 +- appTranslation.py | 12 +- camlib.py | 2 +- defaults.py | 5 +- requirements.txt | 5 +- 93 files changed, 690 insertions(+), 567 deletions(-) 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 From 84cdc87030617bfe5f91d3a4a598a3489ebce60d Mon Sep 17 00:00:00 2001 From: Ali Khalil Date: Mon, 18 Apr 2022 09:18:17 +0300 Subject: [PATCH 03/15] FCLabel behavior modified to match updated method based on PR discussion --- CHANGELOG.md | 13 +- appDatabase.py | 2 +- appEditors/AppGeoEditor.py | 211 ++++++++++++------ appEditors/geo_plugins/GeoCopyPlugin.py | 201 +++++++++++++++-- .../geo_plugins/GeoTransformationPlugin.py | 2 +- appGUI/GUIElements.py | 31 ++- appGUI/MainGUI.py | 6 +- appGUI/ObjectUI.py | 28 +-- appGUI/preferences/OptionUI.py | 2 +- .../cncjob/CNCJobAdvOptPrefGroupUI.py | 2 +- .../cncjob/CNCJobEditorPrefGroupUI.py | 2 +- .../cncjob/CNCJobGenPrefGroupUI.py | 8 +- .../cncjob/CNCJobOptPrefGroupUI.py | 2 +- appGUI/preferences/cncjob/CNCJobPPGroupUI.py | 2 +- .../excellon/ExcellonAdvOptPrefGroupUI.py | 2 +- .../excellon/ExcellonEditorPrefGroupUI.py | 12 +- .../excellon/ExcellonExpPrefGroupUI.py | 2 +- .../excellon/ExcellonGenPrefGroupUI.py | 10 +- .../excellon/ExcellonOptPrefGroupUI.py | 2 +- .../general/GeneralAPPSetGroupUI.py | 10 +- .../general/GeneralAppPrefGroupUI.py | 14 +- .../general/GeneralGUIPrefGroupUI.py | 4 +- .../geometry/GeometryAdvOptPrefGroupUI.py | 2 +- .../geometry/GeometryEditorPrefGroupUI.py | 2 +- .../geometry/GeometryExpPrefGroupUI.py | 2 +- .../geometry/GeometryGenPrefGroupUI.py | 8 +- .../geometry/GeometryOptPrefGroupUI.py | 2 +- .../gerber/GerberEditorPrefGroupUI.py | 12 +- .../gerber/GerberGenPrefGroupUI.py | 10 +- .../gerber/GerberOptPrefGroupUI.py | 4 +- .../tools/Tools2CThievingPrefGroupUI.py | 6 +- .../preferences/tools/Tools2CalPrefGroupUI.py | 4 +- .../tools/Tools2ExtractPrefGroupUI.py | 14 +- .../tools/Tools2FiducialsPrefGroupUI.py | 4 +- .../tools/Tools2InvertPrefGroupUI.py | 4 +- .../tools/Tools2OptimalPrefGroupUI.py | 2 +- .../tools/Tools2PunchGerberPrefGroupUI.py | 10 +- .../tools/Tools2QRCodePrefGroupUI.py | 2 +- .../tools/Tools2RulesCheckPrefGroupUI.py | 8 +- .../tools/Tools2sidedPrefGroupUI.py | 4 +- .../tools/ToolsCalculatorsPrefGroupUI.py | 4 +- .../tools/ToolsCutoutPrefGroupUI.py | 6 +- .../tools/ToolsDrillPrefGroupUI.py | 8 +- .../preferences/tools/ToolsFilmPrefGroupUI.py | 4 +- .../preferences/tools/ToolsISOPrefGroupUI.py | 6 +- .../tools/ToolsLevelPrefGroupUI.py | 2 +- .../tools/ToolsMarkersPrefGroupUI.py | 4 +- .../preferences/tools/ToolsMillPrefGroupUI.py | 10 +- .../preferences/tools/ToolsNCCPrefGroupUI.py | 6 +- .../tools/ToolsPaintPrefGroupUI.py | 6 +- .../tools/ToolsPanelizePrefGroupUI.py | 10 +- .../tools/ToolsSolderpastePrefGroupUI.py | 2 +- .../preferences/tools/ToolsSubPrefGroupUI.py | 2 +- .../tools/ToolsTransformPrefGroupUI.py | 12 +- appMain.py | 3 +- appPlugins/ToolAlignObjects.py | 6 +- appPlugins/ToolCalculators.py | 12 +- appPlugins/ToolCopperThieving.py | 13 +- appPlugins/ToolCutOut.py | 10 +- appPlugins/ToolDblSided.py | 8 +- appPlugins/ToolDistance.py | 6 +- appPlugins/ToolDrilling.py | 6 +- appPlugins/ToolEtchCompensation.py | 6 +- appPlugins/ToolExtract.py | 10 +- appPlugins/ToolFiducials.py | 8 +- appPlugins/ToolFilm.py | 8 +- appPlugins/ToolFollow.py | 4 +- appPlugins/ToolInvertGerber.py | 4 +- appPlugins/ToolIsolation.py | 6 +- appPlugins/ToolLevelling.py | 6 +- appPlugins/ToolMarkers.py | 16 +- appPlugins/ToolMilling.py | 6 +- appPlugins/ToolNCC.py | 6 +- appPlugins/ToolObjectDistance.py | 6 +- appPlugins/ToolOptimal.py | 8 +- appPlugins/ToolPaint.py | 6 +- appPlugins/ToolPanelize.py | 16 +- appPlugins/ToolPunchGerber.py | 8 +- appPlugins/ToolQRCode.py | 8 +- appPlugins/ToolRulesCheck.py | 18 +- appPlugins/ToolSolderPaste.py | 20 +- appPlugins/ToolSub.py | 6 +- appPlugins/ToolTransform.py | 14 +- 83 files changed, 641 insertions(+), 363 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b6724f5..339cdf50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,15 +7,18 @@ CHANGELOG for FlatCAM Evo beta ================================================= +18.04.2022 + +- in Geometry Editor, in Copy Tool added the 2D copy-as-array feature therefore finishing this editor plugin upgrade +- updated the FCLabel widget +- replaced all the FCLabel widgets that have color HTML with the new FCLabel widget that uses parameters for 'color' and weight +- minor changes + 17.04.2022 - 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 +- in Geometry Editor, Copy Tool, finished the copy-as-array feature except the 2D array type which was not implemented yet 16.04.2022 diff --git a/appDatabase.py b/appDatabase.py index ac37adbd..8f21063a 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -200,7 +200,7 @@ class ToolsDB2UI: self.description_vlay.addStretch() # Tool Name - self.name_label = FCLabel('%s:' % (self.app.theme_safe_color('red'), _('Name'))) + self.name_label = FCLabel(_("Name"), color='red', bold=True) self.name_label.setToolTip( _("Tool name.\n" "This is not used in the app, it's function\n" diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index e1792871..8183c40d 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -1897,10 +1897,14 @@ class FCMove(FCShapeTool): def selection_bbox(self): geo_list = [] for select_shape in self.draw_app.get_selected(): - geometric_data = select_shape.geo + if select_shape: + geometric_data = select_shape.geo + else: + continue try: - for g in geometric_data: - geo_list.append(g) + w_geo = geometric_data.geoms if \ + isinstance(geometric_data, (MultiPolygon, MultiLineString)) else geometric_data + geo_list += [g for g in w_geo] except TypeError: geo_list.append(geometric_data) @@ -2281,82 +2285,157 @@ class FCCopy(FCShapeTool): return self.util_geo def array_util_geometry(self, pos, static=None): - axis = self.copy_tool.ui.axis_radio.get_value() # X, Y or A array_type = self.copy_tool.ui.array_type_radio.get_value() # 'linear', '2D', 'circular' - array_size = int(self.copy_tool.ui.array_size_entry.get_value()) - pitch = float(self.copy_tool.ui.pitch_entry.get_value()) - linear_angle = float(self.copy_tool.ui.linear_angle_spinner.get_value()) if array_type == 'linear': # 'Linear' - if pos[0] is None and pos[1] is None: - dx = self.draw_app.x - dy = self.draw_app.y - else: - dx = pos[0] - dy = pos[1] - - geo_list = [] - self.points = [(dx, dy)] - - for item in range(array_size): - if axis == 'X': - new_pos = ((dx + (pitch * item)), dy) - elif axis == 'Y': - new_pos = (dx, (dy + (pitch * item))) - else: # 'A' - x_adj = pitch * math.cos(math.radians(linear_angle)) - y_adj = pitch * math.sin(math.radians(linear_angle)) - new_pos = ((dx + (x_adj * item)), (dy + (y_adj * item))) - - for g in self.draw_app.get_selected(): - if static is None or static is False: - geo_list.append(translate(g.geo, xoff=new_pos[0], yoff=new_pos[1])) - else: - geo_list.append(g.geo) - - return DrawToolUtilityShape(geo_list) + return self.linear_geo(pos, static) elif array_type == '2D': - pass + return self.dd_geo(pos) elif array_type == 'circular': # 'Circular' - if pos[0] is None and pos[1] is None: - cdx = self.draw_app.x - cdy = self.draw_app.y + return self.circular_geo(pos) + + def linear_geo(self, pos, static): + axis = self.copy_tool.ui.axis_radio.get_value() # X, Y or A + pitch = float(self.copy_tool.ui.pitch_entry.get_value()) + linear_angle = float(self.copy_tool.ui.linear_angle_spinner.get_value()) + array_size = int(self.copy_tool.ui.array_size_entry.get_value()) + + if pos[0] is None and pos[1] is None: + dx = self.draw_app.x + dy = self.draw_app.y + else: + dx = pos[0] + dy = pos[1] + + geo_list = [] + self.points = [(dx, dy)] + + for item in range(array_size): + if axis == 'X': + new_pos = ((dx + (pitch * item)), dy) + elif axis == 'Y': + new_pos = (dx, (dy + (pitch * item))) + else: # 'A' + x_adj = pitch * math.cos(math.radians(linear_angle)) + y_adj = pitch * math.sin(math.radians(linear_angle)) + new_pos = ((dx + (x_adj * item)), (dy + (y_adj * item))) + + for g in self.draw_app.get_selected(): + if static is None or static is False: + geo_list.append(translate(g.geo, xoff=new_pos[0], yoff=new_pos[1])) + else: + geo_list.append(g.geo) + + return DrawToolUtilityShape(geo_list) + + def dd_geo(self, pos): + trans_geo = [] + array_2d_type = self.copy_tool.ui.placement_radio.get_value() + + rows = self.copy_tool.ui.rows.get_value() + columns = self.copy_tool.ui.columns.get_value() + + spacing_rows = self.copy_tool.ui.spacing_rows.get_value() + spacing_columns = self.copy_tool.ui.spacing_columns.get_value() + + off_x = self.copy_tool.ui.offsetx_entry.get_value() + off_y = self.copy_tool.ui.offsety_entry.get_value() + + geo_source = [s.geo for s in self.draw_app.get_selected()] + + def geo_bounds(geo: (BaseGeometry, list)): + minx = np.Inf + miny = np.Inf + maxx = -np.Inf + maxy = -np.Inf + + if type(geo) == list: + for shp in geo: + minx_, miny_, maxx_, maxy_ = geo_bounds(shp) + minx = min(minx, minx_) + miny = min(miny, miny_) + maxx = max(maxx, maxx_) + maxy = max(maxy, maxy_) + return minx, miny, maxx, maxy else: - cdx = pos[0] + self.origin[0] - cdy = pos[1] + self.origin[1] + # it's an object, return its bounds + return geo.bounds - utility_list = [] + xmin, ymin, xmax, ymax = geo_bounds(geo_source) + currentx = pos[0] + currenty = pos[1] + + def translate_recursion(geom): + if type(geom) == list: + geoms = [] + for local_geom in geom: + res_geo = translate_recursion(local_geom) + try: + geoms += res_geo + except TypeError: + geoms.append(res_geo) + return geoms + else: + return translate(geom, xoff=currentx, yoff=currenty) + + for row in range(rows): + currentx = pos[0] + + for col in range(columns): + trans_geo += translate_recursion(geo_source) + if array_2d_type == 's': # 'spacing' + currentx += (xmax - xmin + spacing_columns) + else: # 'offset' + currentx = pos[0] + off_x * (col + 1) # because 'col' starts from 0 we increment by 1 + + if array_2d_type == 's': # 'spacing' + currenty += (ymax - ymin + spacing_rows) + else: # 'offset; + currenty = pos[1] + off_y * (row + 1) # because 'row' starts from 0 we increment by 1 + + return DrawToolUtilityShape(trans_geo) + + def circular_geo(self, pos): + if pos[0] is None and pos[1] is None: + cdx = self.draw_app.x + cdy = self.draw_app.y + else: + cdx = pos[0] + self.origin[0] + cdy = pos[1] + self.origin[1] + + utility_list = [] + + try: + radius = distance((cdx, cdy), self.origin) + except Exception: + radius = 0 + + if radius == 0: + self.draw_app.delete_utility_geometry() + + if len(self.points) >= 1 and radius > 0: try: - radius = distance((cdx, cdy), self.origin) - except Exception: - radius = 0 + if cdx < self.origin[0]: + radius = -radius - if radius == 0: - self.draw_app.delete_utility_geometry() + # draw the temp geometry + initial_angle = math.asin((cdy - self.origin[1]) / radius) + temp_circular_geo = self.circular_util_shape(radius, initial_angle) - if len(self.points) >= 1 and radius > 0: - try: - if cdx < self.origin[0]: - radius = -radius + temp_points = [ + (self.origin[0], self.origin[1]), + (self.origin[0] + pos[0], self.origin[1] + pos[1]) + ] + temp_line = LineString(temp_points) - # draw the temp geometry - initial_angle = math.asin((cdy - self.origin[1]) / radius) - temp_circular_geo = self.circular_util_shape(radius, initial_angle) + for geo_shape in temp_circular_geo: + utility_list.append(geo_shape.geo) + utility_list.append(temp_line) - temp_points = [ - (self.origin[0], self.origin[1]), - (self.origin[0]+pos[0], self.origin[1]+pos[1]) - ] - temp_line = LineString(temp_points) - - for geo_shape in temp_circular_geo: - utility_list.append(geo_shape.geo) - utility_list.append(temp_line) - - return DrawToolUtilityShape(utility_list) - except Exception as e: - log.error("DrillArray.utility_geometry -- circular -> %s" % str(e)) + return DrawToolUtilityShape(utility_list) + except Exception as e: + log.error("DrillArray.utility_geometry -- circular -> %s" % str(e)) def circular_util_shape(self, radius, ini_angle): direction = self.copy_tool.ui.array_dir_radio.get_value() # CW or CCW diff --git a/appEditors/geo_plugins/GeoCopyPlugin.py b/appEditors/geo_plugins/GeoCopyPlugin.py index 1aa1ab9a..fb71cd2f 100644 --- a/appEditors/geo_plugins/GeoCopyPlugin.py +++ b/appEditors/geo_plugins/GeoCopyPlugin.py @@ -82,6 +82,14 @@ class CopyEditorTool(AppTool): self.ui.array_dir_radio.set_value('CW') self.ui.placement_radio.set_value('s') + self.ui.on_placement_radio(self.ui.placement_radio.get_value()) + + self.ui.spacing_rows.set_value(0) + self.ui.spacing_columns.set_value(0) + self.ui.rows.set_value(1) + self.ui.columns.set_value(1) + self.ui.offsetx_entry.set_value(0) + self.ui.offsety_entry.set_value(0) def on_tab_close(self): self.disconnect_signals() @@ -158,10 +166,10 @@ class CopyEditorUI: # Type of Array self.mode_label = FCLabel('%s:' % _("Mode")) self.mode_label.setToolTip( - _("Normal copy or special (array of copies)") + _("Single copy or special (array of copies)") ) self.mode_radio = RadioSet([ - {'label': _('Normal'), 'value': 'n'}, + {'label': _('Single'), 'value': 'n'}, {'label': _('Array'), 'value': 'a'} ]) @@ -185,7 +193,7 @@ class CopyEditorUI: self.array_size_label.setToolTip(_("Specify how many items to be in the array.")) self.array_size_entry = FCSpinner(policy=False) - self.array_size_entry.set_range(1, 10000) + self.array_size_entry.set_range(1, 100000) self.array_grid.addWidget(self.array_size_label, 2, 0) self.array_grid.addWidget(self.array_size_entry, 2, 1) @@ -282,11 +290,11 @@ class CopyEditorUI: self.two_dim_array_frame.setLayout(self.dd_grid) # 2D placement - self.place_label = FCLabel('%s:' % _('Direction')) + self.place_label = FCLabel('%s:' % _('Placement')) self.place_label.setToolTip( _("Placement of array items:\n" - "- 'Spacing' - define space between rows and columns \n" - "- 'Offset' - each row (and column) will be placed at a multiple of a value, from origin") + "'Spacing' - define space between rows and columns \n" + "'Offset' - each row (and column) will be placed at a multiple of a value, from origin") ) self.placement_radio = RadioSet([ @@ -297,6 +305,102 @@ class CopyEditorUI: self.dd_grid.addWidget(self.place_label, 0, 0) self.dd_grid.addWidget(self.placement_radio, 0, 1) + # Rows + self.rows = FCSpinner(callback=self.confirmation_message_int) + self.rows.set_range(0, 10000) + + self.rows_label = FCLabel('%s:' % _("Rows")) + self.rows_label.setToolTip( + _("Number of rows") + ) + self.dd_grid.addWidget(self.rows_label, 2, 0) + self.dd_grid.addWidget(self.rows, 2, 1) + + # Columns + self.columns = FCSpinner(callback=self.confirmation_message_int) + self.columns.set_range(0, 10000) + + self.columns_label = FCLabel('%s:' % _("Columns")) + self.columns_label.setToolTip( + _("Number of columns") + ) + self.dd_grid.addWidget(self.columns_label, 4, 0) + self.dd_grid.addWidget(self.columns, 4, 1) + + # ------------------------------------------------ + # ############## Spacing Frame ################# + # ------------------------------------------------ + self.spacing_frame = QtWidgets.QFrame() + self.spacing_frame.setContentsMargins(0, 0, 0, 0) + self.dd_grid.addWidget(self.spacing_frame, 6, 0, 1, 2) + + self.s_grid = GLay(v_spacing=5, h_spacing=3) + self.s_grid.setContentsMargins(0, 0, 0, 0) + self.spacing_frame.setLayout(self.s_grid) + + # Spacing Rows + self.spacing_rows = FCDoubleSpinner(callback=self.confirmation_message) + self.spacing_rows.set_range(0, 9999) + self.spacing_rows.set_precision(4) + + self.spacing_rows_label = FCLabel('%s:' % _("Spacing rows")) + self.spacing_rows_label.setToolTip( + _("Spacing between rows.\n" + "In current units.") + ) + self.s_grid.addWidget(self.spacing_rows_label, 0, 0) + self.s_grid.addWidget(self.spacing_rows, 0, 1) + + # Spacing Columns + self.spacing_columns = FCDoubleSpinner(callback=self.confirmation_message) + self.spacing_columns.set_range(0, 9999) + self.spacing_columns.set_precision(4) + + self.spacing_columns_label = FCLabel('%s:' % _("Spacing cols")) + self.spacing_columns_label.setToolTip( + _("Spacing between columns.\n" + "In current units.") + ) + self.s_grid.addWidget(self.spacing_columns_label, 2, 0) + self.s_grid.addWidget(self.spacing_columns, 2, 1) + + # ------------------------------------------------ + # ############## Offset Frame ################## + # ------------------------------------------------ + self.offset_frame = QtWidgets.QFrame() + self.offset_frame.setContentsMargins(0, 0, 0, 0) + self.dd_grid.addWidget(self.offset_frame, 8, 0, 1, 2) + + self.o_grid = GLay(v_spacing=5, h_spacing=3) + self.o_grid.setContentsMargins(0, 0, 0, 0) + self.offset_frame.setLayout(self.o_grid) + + # Offset X Value + self.offsetx_label = FCLabel('%s X:' % _("Offset")) + self.offsetx_label.setToolTip( + _("'Offset' - each row (and column) will be placed at a multiple of a value, from origin") + ) + + self.offsetx_entry = FCDoubleSpinner(policy=False) + self.offsetx_entry.set_precision(self.decimals) + self.offsetx_entry.set_range(0.0000, 10000.0000) + + self.o_grid.addWidget(self.offsetx_label, 0, 0) + self.o_grid.addWidget(self.offsetx_entry, 0, 1) + + # Offset Y Value + self.offsety_label = FCLabel('%s Y:' % _("Offset")) + self.offsety_label.setToolTip( + _("'Offset' - each row (and column) will be placed at a multiple of a value, from origin") + ) + + self.offsety_entry = FCDoubleSpinner(policy=False) + self.offsety_entry.set_precision(self.decimals) + self.offsety_entry.set_range(0.0000, 10000.0000) + + self.o_grid.addWidget(self.offsety_label, 2, 0) + self.o_grid.addWidget(self.offsety_entry, 2, 1) + # ############################################################################################################# # ############################ CIRCULAR Array ################################################################# # ############################################################################################################# @@ -339,7 +443,7 @@ class CopyEditorUI: self.layout.addWidget(self.add_button) GLay.set_common_column_size([ - grid0, self.array_grid, self.lin_grid, self.dd_grid, self.circ_grid + grid0, self.array_grid, self.lin_grid, self.dd_grid, self.circ_grid, self.s_grid, self.o_grid ], 0) self.layout.addStretch(1) @@ -348,6 +452,24 @@ class CopyEditorUI: self.mode_radio.activated_custom.connect(self.on_copy_mode) self.array_type_radio.activated_custom.connect(self.on_array_type_radio) self.axis_radio.activated_custom.connect(self.on_linear_angle_radio) + self.placement_radio.activated_custom.connect(self.on_placement_radio) + + def confirmation_message(self, accepted, minval, maxval): + if accepted is False: + self.app.inform[str, bool].emit('[WARNING_NOTCL] %s: [%.*f, %.*f]' % (_("Edited value is out of range"), + self.decimals, + minval, + self.decimals, + maxval), False) + else: + self.app.inform[str, bool].emit('[success] %s' % _("Edited value is within limits."), False) + + def confirmation_message_int(self, accepted, minval, maxval): + if accepted is False: + self.app.inform[str, bool].emit('[WARNING_NOTCL] %s: [%d, %d]' % + (_("Edited value is out of range"), minval, maxval), False) + else: + self.app.inform[str, bool].emit('[success] %s' % _("Edited value is within limits."), False) def on_copy_mode(self, val): if val == 'n': @@ -357,21 +479,58 @@ class CopyEditorUI: self.array_frame.show() def on_array_type_radio(self, val): - if val == 'linear': - self.array_circular_frame.hide() - self.array_linear_frame.show() - self.two_dim_array_frame.hide() - self.app.inform.emit(_("Click to place ...")) - elif val == '2D': + if val == '2D': self.array_circular_frame.hide() self.array_linear_frame.hide() self.two_dim_array_frame.show() + if self.placement_radio.get_value() == 's': + self.spacing_frame.show() + self.offset_frame.hide() + else: + self.spacing_frame.hide() + self.offset_frame.show() + + self.array_size_entry.setDisabled(True) + self.on_rows_cols_value_changed() + + self.rows.valueChanged.connect(self.on_rows_cols_value_changed) + self.columns.valueChanged.connect(self.on_rows_cols_value_changed) + self.app.inform.emit(_("Click to place ...")) else: - self.array_circular_frame.show() - self.array_linear_frame.hide() - self.two_dim_array_frame.hide() - self.app.inform.emit(_("Click on the circular array Center position")) + if val == 'linear': + self.array_circular_frame.hide() + self.array_linear_frame.show() + self.two_dim_array_frame.hide() + self.spacing_frame.hide() + self.offset_frame.hide() + + self.app.inform.emit(_("Click to place ...")) + else: # 'circular' + self.array_circular_frame.show() + self.array_linear_frame.hide() + self.two_dim_array_frame.hide() + self.spacing_frame.hide() + self.offset_frame.hide() + + self.app.inform.emit(_("Click on the circular array Center position")) + + self.array_size_entry.setDisabled(False) + try: + self.rows.valueChanged.disconnect() + except (TypeError, AttributeError): + pass + + try: + self.columns.valueChanged.disconnect() + except (TypeError, AttributeError): + pass + + def on_rows_cols_value_changed(self): + new_size = self.rows.get_value() * self.columns.get_value() + if new_size == 0: + new_size = 1 + self.array_size_entry.set_value(new_size) def on_linear_angle_radio(self, val): if val == 'A': @@ -380,3 +539,11 @@ class CopyEditorUI: else: self.linear_angle_spinner.hide() self.linear_angle_label.hide() + + def on_placement_radio(self, val): + if val == 's': + self.spacing_frame.show() + self.offset_frame.hide() + else: + self.spacing_frame.hide() + self.offset_frame.show() diff --git a/appEditors/geo_plugins/GeoTransformationPlugin.py b/appEditors/geo_plugins/GeoTransformationPlugin.py index bebadce3..7a609183 100644 --- a/appEditors/geo_plugins/GeoTransformationPlugin.py +++ b/appEditors/geo_plugins/GeoTransformationPlugin.py @@ -588,7 +588,7 @@ class TransformEditorTool(AppTool): maxy = max(maxy, maxy_) return minx, miny, maxx, maxy except TypeError: - # it's an object, return it's bounds + # it's an object, return its bounds return lst.bounds() return bounds_rec(shapelist) diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index 1ef72cc8..ebd129cd 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -2970,9 +2970,36 @@ class FCLabel(QtWidgets.QLabel): right_clicked = QtCore.pyqtSignal(bool) middle_clicked = QtCore.pyqtSignal(bool) - def __init__(self, parent=None): + def __init__(self, title=None, color=None, color_callback=None, bold=None, parent=None): + """ + + :param title: the label's text + :type title: str + :param color: text color + :type color: str + :param color_callback: function to alter the color + :type color_callback: function + :param bold: the text weight + :type bold: bool + :param parent: parent of this widget + :type parent: QtWidgets.QWidget | None + """ + super(FCLabel, self).__init__(parent) + if color and color_callback: + color = color_callback(color) + + if isinstance(title, str): + if color and not bold: + self.setText('%s' % (str(color), title)) + elif not color and bold: + self.setText('%s' % title) + elif color and bold: + self.setText('%s' % (str(color), title)) + else: + self.setText(title) + # for the usage of this label as a clickable label, to know that current state self.clicked_state = False self.middle_clicked_state = False @@ -5380,7 +5407,7 @@ class FlatCAMActivityView(QtWidgets.QWidget): self.movie_path = movie self.icon_path = icon - self.icon = FCLabel(self) + self.icon = FCLabel(parent=self) self.icon.setGeometry(0, 0, 16, 12) self.movie = QtGui.QMovie(self.movie_path) diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 090ce4d9..b3175fe1 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -3521,10 +3521,14 @@ class MainGUI(QtWidgets.QMainWindow): self.app.geo_editor.active_tool.rect_tool.length != 0.0 and \ self.app.geo_editor.active_tool.rect_tool.width != 0.0: pass - elif self.app.geo_editor.active_tool.name in ['move', 'copy'] and \ + elif self.app.geo_editor.active_tool.name == 'move' and \ self.app.geo_editor.active_tool.move_tool.length != 0.0 and \ self.app.geo_editor.active_tool.move_tool.width != 0.0: pass + elif self.app.geo_editor.active_tool.name == 'copy' and \ + self.app.geo_editor.active_tool.copy_tool.length != 0.0 and \ + self.app.geo_editor.active_tool.copy_tool.width != 0.0: + pass else: self.app.geo_editor.active_tool.click( self.app.geo_editor.snap(self.app.geo_editor.x, self.app.geo_editor.y)) diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index b499f599..937f2f71 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -89,7 +89,7 @@ class ObjectUI(QtWidgets.QWidget): # ############################################################################################################# # Transformations Frame # ############################################################################################################# - self.transform_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Transformations'))) + self.transform_label = FCLabel(_("Transformations"), color='blue', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _("General Information"))) + self.general_label = FCLabel(_("General Information"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel(_("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Plugins"))) + self.tool_lbl = FCLabel(_("Plugins"), color='indigo', bold=True) self.custom_box.addWidget(self.tool_lbl) plugins_frame = FCFrame() @@ -601,7 +601,7 @@ class ExcellonObjectUI(ObjectUI): parent=parent, app=self.app) - self.general_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("General Information"))) + self.general_label = FCLabel(_("General Information"), color='darkorange', bold=True) 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: ' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s: ' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Plugins"))) + self.tool_lbl = FCLabel('%s' % _("Plugins"), color='indigo', bold=True) self.custom_box.addWidget(self.tool_lbl) plugins_frame = FCFrame() @@ -938,7 +938,7 @@ class GeometryObjectUI(ObjectUI): icon_file=self.resource_loc + '/geometry32.png', parent=parent, app=self.app ) - self.general_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("General Information"))) + self.general_label = FCLabel('%s' % _("General Information"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _('Plugins'))) + self.tools_label = FCLabel('%s' % _("Plugins"), color='indigo', bold=True) self.custom_box.addWidget(self.tools_label) plugins_frame = FCFrame() @@ -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' % (self.app.theme_safe_color('darkorange'), _("General Information"))) + self.general_label = FCLabel('%s' % _("General Information"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Plugins"))) + self.tool_lbl = FCLabel('%s' % _("Plugins"), color='indigo', bold=True) self.custom_box.addWidget(self.tool_lbl) # Levelling Tool - will process the generated GCode using a Height Map generating levelled GCode diff --git a/appGUI/preferences/OptionUI.py b/appGUI/preferences/OptionUI.py index d1cdb4ac..be05ee55 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' % (self.app.theme_safe_color(''), str(self.color), _(self.label_text))) + heading = FCLabel('%s' % _(self.label_text), color=str(self.color), bold=True) heading.setToolTip(_(self.label_tooltip)) return heading diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index 77c67e9c..5b7c675d 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.export_gcode_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 82bb49b6..648d8c02 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("A list of Editor parameters.") ) diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index 370fe2b5..0ce6c68b 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' % (self.app.theme_safe_color('blue'), _("Plot Options"))) + self.plot_options_label = FCLabel('%s' % _("Plot Options"), color='blue', bold=True) self.layout.addWidget(self.plot_options_label) plot_frame = FCFrame() @@ -71,7 +71,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Decimals Frame # ############################################################################################################# - self.layout.addWidget(FCLabel('%s' % (self.app.theme_safe_color('teal'), _("G-code Decimals")))) + self.layout.addWidget(FCLabel('%s' % _("G-code Decimals"), color='teal', bold=True)) dec_frame = FCFrame() self.layout.addWidget(dec_frame) @@ -141,7 +141,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Travel Frame # ############################################################################################################# - self.travel_color_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Travel Line Color'))) + self.travel_color_label = FCLabel('%s' % _("Travel Line Color"), color='green', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Object Color'))) + self.cnc_color_label = FCLabel('%s' % _("Object Color"), color='darkorange', bold=True) 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 2485f9a5..ae52d885 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' % (self.app.theme_safe_color('brown'), _("Export G-Code"))) + self.export_gcode_label = FCLabel('%s' % _("Export G-Code"), color='brown', bold=True) 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 bb6b0b97..dfa1858d 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' % (self.app.theme_safe_color('blue'), _("Compensation"))) + self.comp_gcode_label = FCLabel('%s' % _("Compensation"), color='blue', bold=True) self.comp_gcode_label.setToolTip( _("Compensate CNC bed issues.") ) diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index 26c9f90c..81710146 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' % (self.app.theme_safe_color('indigo'), _('Advanced Options'))) + self.exc_label = FCLabel('%s' % _("Advanced Options"), color='indigo', bold=True) 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 4ebb275a..b324ca02 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Linear Drill Array'))) + self.drill_array_linear_label = FCLabel('%s' % _("Linear Drill Array"), color='brown', bold=True) 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' % (self.app.theme_safe_color('green'), _('Circular Drill Array'))) + self.drill_array_circ_label = FCLabel('%s' % _("Circular Drill Array"), color='green', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Slots'))) + self.drill_array_circ_label = FCLabel('%s' % _("Slots"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Linear Slot Array'))) + self.slot_array_linear_label = FCLabel('%s' % _("Linear Slot Array"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Circular Slot Array'))) + self.slot_array_circ_label = FCLabel('%s' % _("Circular Slot Array"), color='blue', bold=True) 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 70bc620b..7a1b7423 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' % (self.app.theme_safe_color('brown'), _("Export Options"))) + self.export_options_label = FCLabel('%s' % _("Export Options"), color='brown', bold=True) 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 8e7af0b6..019e10ad 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' % (self.app.theme_safe_color('blue'), _("Plot Options"))) + self.plot_options_label = FCLabel('%s' % _("Plot Options"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Excellon Format"))) + self.excellon_format_label = FCLabel('%s' % _("Excellon Format"), color='green', bold=True) 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' % (self.app.theme_safe_color('teal'), _("Path Optimization"))) + self.excellon_general_label = FCLabel('%s' % _("Path Optimization"), color='teal', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Join Option'))) + self.join_geo_label = FCLabel('%s' % _("Join Option"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Object Color'))) + self.gerber_color_label = FCLabel('%s' % _("Object Color"), color='darkorange', bold=True) 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 7cfda2a0..3c0f5fdb 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.cncjob_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 11b30c7a..2fed76d5 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -37,7 +37,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # Grid Settings Frame # ############################################################################################################# # GRID Settings - self.grid_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Grid Settings'))) + self.grid_label = FCLabel('%s' % _("Grid Settings"), color='magenta', bold=True) self.layout.addWidget(self.grid_label) grids_frame = FCFrame() @@ -90,7 +90,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # Workspace Frame # ############################################################################################################# # Workspace - self.workspace_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Workspace Settings'))) + self.workspace_label = FCLabel('%s' % _("Workspace Settings"), color='brown', bold=True) 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' % (self.app.theme_safe_color('green'), _('Font Size'))) + self.font_size_label = FCLabel('%s' % _("Font Size"), color='green', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Axis'))) + self.axis_label = FCLabel('%s' % _("Axis"), color='brown', bold=True) self.layout.addWidget(self.axis_label) ax_frame = FCFrame() @@ -305,7 +305,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # ############################################################################################################# # Mouse Frame # ############################################################################################################# - self.mouse_lbl = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _('Mouse Settings'))) + self.mouse_lbl = FCLabel('%s' % _("Mouse Settings"), color='darkorange', bold=True) self.layout.addWidget(self.mouse_lbl) m_frame = FCFrame() diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index e7238968..ef32a068 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' % (self.app.theme_safe_color('red'), _('Units'))) + self.unitslabel = FCLabel('%s' % _("Units"), color='red', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.par_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.layout.addWidget(self.par_label) # ############################################################################################################# @@ -166,7 +166,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Grid0 Frame # ############################################################################################################# - self.app_level_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Application Level'))) + self.app_level_label = FCLabel('%s' % _("Application Level"), color='red', bold=True) 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' % (self.app.theme_safe_color('DarkCyan'), _('Languages'))) + self.languagelabel = FCLabel('%s' % _("Languages"), color='DarkCyan', bold=True) 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' % (self.app.theme_safe_color('green'), _('Startup Settings'))) + self.startup_label = FCLabel('%s' % _("Startup Settings"), color='green', bold=True) 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' % (self.app.theme_safe_color('purple'), _("Save Settings"))) + self.save_label = FCLabel('%s' % _("Save Settings"), color='purple', bold=True) 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' % (self.app.theme_safe_color('orange'), _("Text to PDF parameters"))) + self.pdf_param_label = FCLabel('%s' % _("Text to PDF parameters"), color='orange', bold=True) self.pdf_param_label.setToolTip( _("Used when saving text in Code Editor or in FlatCAM Document objects.") ) diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index f5e5059e..5652f44b 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_lbl = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.layout.addWidget(self.param_lbl) # ############################################################################################################# @@ -151,7 +151,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Grid1 Frame # ############################################################################################################# - self.color_lbl = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Colors"))) + self.color_lbl = FCLabel('%s' % _("Colors"), color='teal', bold=True) self.layout.addWidget(self.color_lbl) color_frame = FCFrame() diff --git a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py index 4d358863..509d5e43 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' % (self.app.theme_safe_color('indigo'), _('Advanced Options'))) + self.geo_label = FCLabel('%s' % _("Advanced Options"), color='indigo', bold=True) 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 6286b087..4a6e8faa 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("A list of Editor parameters.") ) diff --git a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py index c6c1a26c..f14d8ab1 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' % (self.app.theme_safe_color('brown'), _("Export Options"))) + self.export_options_label = FCLabel('%s' % _("Export Options"), color='brown', bold=True) 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 9b026173..b9f6a4ac 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' % (self.app.theme_safe_color('blue'), _("Plot Options"))) + self.plot_options_label = FCLabel('%s' % _("Plot Options"), color='blue', bold=True) self.layout.addWidget(self.plot_options_label) plot_frame = FCFrame() @@ -69,7 +69,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Optimization Frame # ############################################################################################################# - self.opt_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _("Path Optimization"))) + self.opt_label = FCLabel('%s' % _("Path Optimization"), color='teal', bold=True) self.layout.addWidget(self.opt_label) opt_frame = FCFrame() @@ -119,7 +119,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Fuse Frame # ############################################################################################################# - self.join_geo_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Join Option'))) + self.join_geo_label = FCLabel('%s' % _("Join Option"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Object Color'))) + self.gerber_color_label = FCLabel('%s' % _("Object Color"), color='darkorange', bold=True) 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 923dcc35..151038b9 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.cncjob_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.layout.addWidget(self.cncjob_label) param_frame = FCFrame() diff --git a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py index 0d7aef27..2c1cd70b 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Linear Pad Array'))) + self.grb_array_linear_label = FCLabel('%s' % _("Linear Pad Array"), color='brown', bold=True) 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' % (self.app.theme_safe_color('green'), _('Circular Pad Array'))) + self.grb_array_circ_label = FCLabel('%s' % _("Circular Pad Array"), color='green', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Buffer Tool'))) + self.grb_array_tools_b_label = FCLabel('%s' % _("Buffer Tool"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Scale Tool'))) + self.grb_array_tools_s_label = FCLabel('%s' % _("Scale Tool"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Mark Area Tool'))) + self.grb_array_tools_ma_label = FCLabel('%s' % _("Mark Area Tool"), color='blue', bold=True) 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 2f495654..f2eed361 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' % (self.app.theme_safe_color('blue'), _("Plot Options"))) + self.plot_options_label = FCLabel('%s' % _("Plot Options"), color='blue', bold=True) self.layout.addWidget(self.plot_options_label) # ############################################################################################################# @@ -77,7 +77,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Default format for Gerber - self.gerber_default_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Default Values'))) + self.gerber_default_label = FCLabel('%s' % _("Default Values"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='indigo', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Layers'))) + self.layers_label = FCLabel('%s' % _("Layers"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Object Color'))) + self.gerber_color_label = FCLabel('%s' % _("Object Color"), color='darkorange', bold=True) 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 ed359a96..748b43bc 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' % (self.app.theme_safe_color('blue'), _("Non-copper regions"))) + self.clearcopper_label = FCLabel('%s' % _("Non-copper regions"), color='blue', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Bounding Box'))) + self.boundingbox_label = FCLabel('%s' % _("Bounding Box"), color='brown', bold=True) self.layout.addWidget(self.boundingbox_label) bb_frame = FCFrame() diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index 4edabd96..4c85b0ea 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Robber Bar Parameters'))) + self.robber_bar_label = FCLabel('%s' % _("Robber Bar Parameters"), color='brown', bold=True) 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' % (self.app.theme_safe_color('purple'), _('Pattern Plating Mask'))) + self.patern_mask_label = FCLabel('%s' % _("Pattern Plating Mask"), color='purple', bold=True) 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 7fece0cf..44b2b769 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("Parameters used for this tool.") ) @@ -110,7 +110,7 @@ class Tools2CalPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Tool change Frame # ############################################################################################################# - tc_lbl = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Tool change"))) + tc_lbl = FCLabel('%s' % _("Tool change"), color='brown', bold=True) self.layout.addWidget(tc_lbl) tc_frame = FCFrame() diff --git a/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py b/appGUI/preferences/tools/Tools2ExtractPrefGroupUI.py index 7fa36824..35964f27 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' % (self.app.theme_safe_color('blue'), _("Processed Pads Type"))) + self.padt_label = FCLabel('%s' % _("Processed Pads Type"), color='blue', bold=True) 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:' % (self.app.theme_safe_color('green'), _("Method"))) + self.method_label = FCLabel('%s' % _("Method"), color='green', bold=True) 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' % (self.app.theme_safe_color('teal'), _("Fixed Diameter"))) + self.fixed_label = FCLabel('%s' % _("Fixed Diameter"), color='teal', bold=True) self.layout.addWidget(self.fixed_label) fix_frame = FCFrame() @@ -144,7 +144,7 @@ class Tools2EDrillsPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Annular ring Frame # ############################################################################################################# - self.ring_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Fixed Annular Ring"))) + self.ring_label = FCLabel('%s' % _("Fixed Annular Ring"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Proportional Diameter"))) + self.prop_label = FCLabel('%s' % _("Proportional Diameter"), color='indigo', bold=True) 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' % (self.app.theme_safe_color('magenta'), _("Extract Soldermask"))) + self.extract_sm_label = FCLabel('%s' % _("Extract Soldermask"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('brown'), _("Extract Cutout"))) + self.extract_cut_label = FCLabel('%s' % _("Extract Cutout"), color='brown', bold=True) 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 a36b1f24..c211cbd4 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("Parameters used for this tool.") ) @@ -117,7 +117,7 @@ class Tools2FiducialsPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Selection Frame # ############################################################################################################# - self.sel_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Selection"))) + self.sel_label = FCLabel('%s' % _("Selection"), color='brown', bold=True) self.layout.addWidget(self.sel_label) s_frame = FCFrame() diff --git a/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index f0f6982f..19d2ce24 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.sublabel = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('tomato'), _("Lines Join Style"))) + self.join_label = FCLabel('%s' % _("Lines Join Style"), color='tomato', bold=True) 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 18959d2c..f242de2b 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.optlabel = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 f07ffd68..147495bb 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' % (self.app.theme_safe_color('blue'), _("Processed Pads Type"))) + self.padt_label = FCLabel('%s' % _("Processed Pads Type"), color='blue', bold=True) 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:' % (self.app.theme_safe_color('green'), _("Method"))) + self.hole_size_label = FCLabel('%s' % _("Method"), color='green', bold=True) 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' % (self.app.theme_safe_color('teal'), _("Fixed Diameter"))) + self.fixed_label = FCLabel('%s' % _("Fixed Diameter"), color='teal', bold=True) self.layout.addWidget(self.fixed_label) fix_frame = FCFrame() @@ -141,7 +141,7 @@ class Tools2PunchGerberPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Annular ring Frame # ############################################################################################################# - self.ring_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Fixed Annular Ring"))) + self.ring_label = FCLabel('%s' % _("Fixed Annular Ring"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Proportional Diameter"))) + self.prop_label = FCLabel('%s' % _("Proportional Diameter"), color='indigo', bold=True) self.layout.addWidget(self.prop_label) prop_frame = FCFrame() diff --git a/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py index 23f529ac..ca65c84d 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.qrlabel = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 fbdf5de2..0316ac20 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' % (self.app.theme_safe_color('darkorange'), _("Copper"), _("Rules"))) + rules_copper_label = FCLabel('%s %s' % (_("Copper"), _("Rules")), color='darkorange', bold=True) self.layout.addWidget(rules_copper_label) copper_frame = FCFrame() @@ -127,7 +127,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Silk Frame # ############################################################################################################# - silk_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('teal'), _("Silk"), _("Rules"))) + silk_copper_label = FCLabel('%s %s' % (_("Silk"), _("Rules")), color='teal', bold=True) self.layout.addWidget(silk_copper_label) silk_frame = FCFrame() @@ -205,7 +205,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Soldermask Frame # ############################################################################################################# - sm_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('magenta'), _("Soldermask"), _("Rules"))) + sm_copper_label = FCLabel('%s %s' % (_("Soldermask"), _("Rules")), color='magenta', bold=True) self.layout.addWidget(sm_copper_label) solder_frame = FCFrame() @@ -240,7 +240,7 @@ class Tools2RulesCheckPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Holes Frame # ############################################################################################################# - holes_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('brown'), _("Holes"), _("Rules"))) + holes_copper_label = FCLabel('%s %s' % (_("Holes"), _("Rules")), color='brown', bold=True) self.layout.addWidget(holes_copper_label) holes_frame = FCFrame() diff --git a/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py index 8a767118..19970bc8 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' % (self.app.theme_safe_color('indigo'), _("PCB Alignment"))) + self.dblsided_label = FCLabel('%s' % _("PCB Alignment"), color='indigo', bold=True) 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' % (self.app.theme_safe_color('red'), _("Mirror Operation"))) + self.mirror_label = FCLabel('%s' % _("Mirror Operation"), color='red', bold=True) self.layout.addWidget(self.mirror_label) mirror_frame = FCFrame() diff --git a/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py index a2d0e375..6ee6cde1 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' % (self.app.theme_safe_color('green'), _("V-Shape Tool Calculator"))) + self.vshape_tool_label = FCLabel('%s' % _("V-Shape Tool Calculator"), color='green', bold=True) 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' % (self.app.theme_safe_color('brown'), _("ElectroPlating Calculator"))) + self.plate_title_label = FCLabel('%s' % _("ElectroPlating Calculator"), color='brown', bold=True) 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 1b7b0af8..7fd06432 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.board_cutout_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Gaps"))) + self.gaps_label = FCLabel('%s' % _("Gaps"), color='green', bold=True) 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' % (self.app.theme_safe_color('red'), _('Cut by Drilling'))) + self.title_drillcut_label = FCLabel('%s' % _("Cut by Drilling"), color='red', bold=True) 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 291db4af..8d5e40d5 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.drill_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Drilling Slots'))) + self.dslots_label = FCLabel('%s' % _("Drilling Slots"), color='brown', bold=True) self.layout.addWidget(self.dslots_label) ds_frame = FCFrame() @@ -272,7 +272,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Advanced Options Frame # ############################################################################################################# - self.exc_label = FCLabel('%s' % (self.app.theme_safe_color('teal'), _('Advanced Options'))) + self.exc_label = FCLabel('%s' % _("Advanced Options"), color='teal', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Area Exclusion'))) + self.area_exc_label = FCLabel('%s' % _("Area Exclusion"), color='magenta', bold=True) self.area_exc_label.setToolTip( _("Area exclusion parameters.") ) diff --git a/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index e1d440ec..ef75ae59 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' % (self.app.theme_safe_color('brown'), _("Adjustments"))) + self.film_adj_label = FCLabel('%s' % _("Adjustments"), color='brown', bold=True) self.film_adj_label.setToolTip( _("Compensate print distortions.") ) @@ -180,7 +180,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Parameters Frame # ############################################################################################################# - self.film_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.film_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 7dbe63cb..c0fdd5a4 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.iso_label = FCLabel(_("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Tool Parameters"))) + self.tools_table_label = FCLabel(_("Tool Parameters"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel(_("Common Parameters"), color='indigo', bold=True) 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 f1bc4935..e6d4f2ce 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.levelling_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 40ad64bc..e8e7f181 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("Parameters used for this tool.") ) @@ -104,7 +104,7 @@ class ToolsMarkersPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Offset Frame # ############################################################################################################# - self.offset_title_label = FCLabel('%s' % (self.app.theme_safe_color('magenta'), _('Offset'))) + self.offset_title_label = FCLabel('%s' % _("Offset"), color='magenta', bold=True) 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 c0c20873..65cd74ea 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.mill_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('teal'), _('Advanced Options'))) + self.adv_label = FCLabel('%s' % _("Advanced Options"), color='teal', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Area Exclusion'))) + self.area_exc_label = FCLabel('%s' % _("Area Exclusion"), color='magenta', bold=True) self.area_exc_label.setToolTip( _("Area exclusion parameters.") ) @@ -503,7 +503,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Area Polish Frame # ############################################################################################################# - self.pol_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _('Add Polish'))) + self.pol_label = FCLabel('%s' % _("Add Polish"), color='brown', bold=True) 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' % (self.app.theme_safe_color('darkorange'), _('Excellon Milling'))) + self.mille_label = FCLabel('%s' % _("Excellon Milling"), color='darkorange', bold=True) 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 9059e9cf..b2dddf3f 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.clearcopper_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Tool Parameters"))) + self.tools_table_label = FCLabel('%s' % _("Tool Parameters"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) 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 4e05e5cb..85cbfc0a 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.paint_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Tool Parameters"))) + self.tools_table_label = FCLabel('%s' % _("Tool Parameters"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) 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 f3002685..82532ca4 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.panelize_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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" @@ -46,7 +46,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.spacing_columns_label = FCLabel('%s:' % _("Spacing cols")) self.spacing_columns_label.setToolTip( - _("Spacing between columns of the desired panel.\n" + _("Spacing between columns.\n" "In current units.") ) param_grid.addWidget(self.spacing_columns_label, 0, 0) @@ -60,7 +60,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.spacing_rows_label = FCLabel('%s:' % _("Spacing rows")) self.spacing_rows_label.setToolTip( - _("Spacing between rows of the desired panel.\n" + _("Spacing between rows.\n" "In current units.") ) param_grid.addWidget(self.spacing_rows_label, 2, 0) @@ -73,7 +73,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.columns_label = FCLabel('%s:' % _("Columns")) self.columns_label.setToolTip( - _("Number of columns of the desired panel") + _("Number of columns") ) param_grid.addWidget(self.columns_label, 4, 0) param_grid.addWidget(self.pcolumns, 4, 1) @@ -85,7 +85,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI): self.rows_label = FCLabel('%s:' % _("Rows")) self.rows_label.setToolTip( - _("Number of rows of the desired panel") + _("Number of rows") ) param_grid.addWidget(self.rows_label, 6, 0) param_grid.addWidget(self.prows, 6, 1) diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index 948850f9..0349b352 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.solderpastelabel = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 9d268013..6ae2249e 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.sublabel = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 476bc7ad..ff0a8204 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.transform_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('tomato'), _("Rotate"))) + rotate_title_lbl = FCLabel('%s' % _("Rotate"), color='tomato', bold=True) 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' % (self.app.theme_safe_color('teal'), _("Skew"))) + skew_title_lbl = FCLabel('%s' % _("Skew"), color='teal', bold=True) 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' % (self.app.theme_safe_color('magenta'), _("Scale"))) + scale_title_lbl = FCLabel('%s' % _("Scale"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('green'), _("Offset"))) + offset_title_lbl = FCLabel('%s' % _("Offset"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Buffer"))) + buffer_title_lbl = FCLabel('%s' % _("Buffer"), color='indigo', bold=True) b_t_lay.addWidget(buffer_title_lbl) b_t_lay.addStretch() diff --git a/appMain.py b/appMain.py index 61a1a822..b44f8a25 100644 --- a/appMain.py +++ b/appMain.py @@ -3720,8 +3720,7 @@ class App(QtCore.QObject): line = 1 for i in translators: - self.translator_grid_lay.addWidget( - FCLabel('%s' % (self.app.theme_safe_color('blue'), i['language']), line, 0)) + self.translator_grid_lay.addWidget(FCLabel('%s' % i['language'], color='blue', bold=False), 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]) diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index eae28d07..c8f1bfdb 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -414,7 +414,7 @@ class AlignUI: # ############################################################################################################# # Moving Object Frame # ############################################################################################################# - self.aligned_label = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("MOVING object"))) + self.aligned_label = FCLabel('%s' % _("MOVING object"), color='indigo', bold=True) 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' % (self.app.theme_safe_color('red'), _("DESTINATION object"))) + self.aligned_label = FCLabel('%s' % _("DESTINATION object"), color='red', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.tools_box.addWidget(self.param_label) par_frame = FCFrame() diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py index 7ed830aa..dcd0280a 100644 --- a/appPlugins/ToolCalculators.py +++ b/appPlugins/ToolCalculators.py @@ -526,7 +526,8 @@ class CalcUI: # ##################### # ## Title of the Units Calculator - units_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), self.unitsName)) + units_label = FCLabel('%s' % self.unitsName, color='blue', bold=True) + self.layout.addWidget(units_label) units_frame = FCFrame() @@ -588,7 +589,8 @@ class CalcUI: # ################################ V-shape Tool Calculator #################################################### # ############################################################################################################# # ## Title of the V-shape Tools Calculator - v_shape_title_label = FCLabel('%s' % (self.app.theme_safe_color('green'), self.v_shapeName)) + v_shape_title_label = FCLabel('%s' % self.v_shapeName, color='green', bold=True) + self.layout.addWidget(v_shape_title_label) v_frame = FCFrame() @@ -662,7 +664,7 @@ class CalcUI: # ############################## ElectroPlating Tool Calculator ############################################### # ############################################################################################################# # ## Title of the ElectroPlating Tools Calculator - tin_title_label = FCLabel('%s' % (self.app.theme_safe_color('purple'), self.eplateName)) + tin_title_label = FCLabel('%s' % self.eplateName, color='purple', bold=True) 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 +850,7 @@ class CalcUI: # ############################## Tinning Calculator ############################################### # ############################################################################################################# # ## Title of the Tinning Calculator - tin_title_label = FCLabel('%s' % (self.app.theme_safe_color('orange'), self.tinningName)) + tin_title_label = FCLabel('%s' % self.tinningName, color='orange', bold=True) tin_title_label.setToolTip( _("Calculator for chemical quantities\n" "required for tinning PCB's.") @@ -1011,7 +1013,7 @@ class CalcUI: grid_tin.addWidget(separator_line, 26, 0, 1, 2) # Volume - self.vol_lbl = FCLabel('%s:' % (self.app.theme_safe_color('red'), _("Volume"))) + self.vol_lbl = FCLabel('%s' % _("Volume"), color='red', bold=True) 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 b0c43951..debcf626 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -1277,7 +1277,7 @@ class ThievingUI: # ############################################################################################################# # Source Object Frame # ############################################################################################################# - self.grbobj_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.grbobj_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) self.grbobj_label.setToolTip(_("Gerber Object to which will be added a copper thieving.")) self.tools_box.addWidget(self.grbobj_label) @@ -1296,8 +1296,7 @@ class ThievingUI: # ############################################################################################################# # Thieving Parameters Frame # ############################################################################################################# - self.copper_fill_label = FCLabel('%s %s' % - (_('Thieving'), _("Parameters"))) + self.copper_fill_label = FCLabel('%s %s' % (_("Thieving"), _("Parameters")), color='blue', bold=True) self.copper_fill_label.setToolTip(_("Parameters used for this tool.")) self.tools_box.addWidget(self.copper_fill_label) @@ -1591,8 +1590,7 @@ class ThievingUI: # ############################################################################################################# # ## Robber Bar Parameters # ############################################################################################################# - self.robber_bar_label = FCLabel('%s' % - _('Robber Bar Parameters')) + self.robber_bar_label = FCLabel('%s' % _("Robber Bar Parameters"), color='brown', bold=True) self.robber_bar_label.setToolTip( _("Parameters used for the robber bar.\n" "Robber bar = copper border to help in pattern hole plating.") @@ -1659,14 +1657,13 @@ class ThievingUI: # ############################################################################################################# # Pattern plating Frame # ############################################################################################################# - self.patern_mask_label = FCLabel('%s' % - _('Pattern Plating Mask')) + self.patern_mask_label = FCLabel('%s' % _("Pattern Plating Mask"), color='purple', bold=True) self.patern_mask_label.setToolTip( _("Generate a mask for pattern plating.") ) self.tools_box.addWidget(self.patern_mask_label) - self.sm_obj_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.sm_obj_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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 c568755f..b6dff55a 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.object_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('indigo'), _('Cutout Tool'))) + self.tool_sel_label = FCLabel('%s' % _("Cutout Tool"), color='indigo', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Tool Parameters"))) + self.param_label = FCLabel('%s' % _("Tool Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Gaps"))) + self.gaps_label = FCLabel('%s' % _("Gaps"), color='green', bold=True) 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' % (self.app.theme_safe_color('red'), _('Cut by Drilling'))) + self.title_drillcut_label = FCLabel('%s' % _("Cut by Drilling"), color='red', bold=True) 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 8a3b7d26..a4149570 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -720,7 +720,7 @@ class DsidedUI: # ############################################################################################################# # Source Object # ############################################################################################################# - self.m_objects_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.m_objects_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('purple'), _('Bounds Values'))) + self.bv_label = FCLabel('%s' % _("Bounds Values"), color='purple', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Mirror Operation"))) + self.param_label = FCLabel('%s' % _("Mirror Operation"), color='blue', bold=True) 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' % (self.app.theme_safe_color('brown'), _('PCB Alignment'))) + self.alignment_label = FCLabel('%s' % _("PCB Alignment"), color='brown', bold=True) 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 b2de43a5..6395f4be 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -822,7 +822,7 @@ class DistanceUI: # ############################################################################################################# # Parameters Frame # ############################################################################################################# - self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.layout.addWidget(self.param_label) self.par_frame = FCFrame() @@ -853,7 +853,7 @@ class DistanceUI: # ############################################################################################################# # Coordinates Frame # ############################################################################################################# - self.coords_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Coordinates'))) + self.coords_label = FCLabel('%s' % _("Coordinates"), color='green', bold=True) self.layout.addWidget(self.coords_label) coords_frame = FCFrame() @@ -896,7 +896,7 @@ class DistanceUI: # ############################################################################################################# # Coordinates Frame # ############################################################################################################# - self.res_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Results'))) + self.res_label = FCLabel('%s' % _("Results"), color='red', bold=True) self.layout.addWidget(self.res_label) res_frame = FCFrame() diff --git a/appPlugins/ToolDrilling.py b/appPlugins/ToolDrilling.py index 71d4fe61..be6330d9 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) self.gen_param_label.setToolTip( _("Parameters that are common for all tools.") ) diff --git a/appPlugins/ToolEtchCompensation.py b/appPlugins/ToolEtchCompensation.py index 0171239e..2faea4f0 100644 --- a/appPlugins/ToolEtchCompensation.py +++ b/appPlugins/ToolEtchCompensation.py @@ -313,7 +313,7 @@ class EtchUI: # ############################################################################################################# # Source Object Frame # ############################################################################################################# - self.gerber_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.gerber_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) self.gerber_label.setToolTip( _("Gerber object that will be compensated.") ) @@ -331,7 +331,7 @@ class EtchUI: # ############################################################################################################# # Utilities # ############################################################################################################# - self.util_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Utilities"))) + self.util_label = FCLabel('%s' % _("Utilities"), color='red', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 78340a8e..9585784c 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -1011,7 +1011,7 @@ class ExtractUI: # ############################################################################################################# # Source Object # ############################################################################################################# - self.grb_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.grb_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _("Processed Pads Type"))) + self.padt_label = FCLabel('%s' % _("Processed Pads Type"), color='green', bold=True) 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' % (self.app.theme_safe_color('brown'), _("Extract Drills"))) + self.extract_drills_label = FCLabel('%s' % _("Extract Drills"), color='brown', bold=True) 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' % (self.app.theme_safe_color('purple'), _("Extract Soldermask"))) + self.extract_sm_label = FCLabel('%s' % _("Extract Soldermask"), color='purple', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Extract Cutout"))) + self.extract_cut_label = FCLabel('%s' % _("Extract Cutout"), color='blue', bold=True) 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 14fada1c..2d8767ec 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -937,7 +937,7 @@ class FidoUI: # ############################################################################################################# # Gerber Source Object # ############################################################################################################# - self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Coordinates'))) + self.points_label = FCLabel('%s' % _("Coordinates"), color='green', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("Parameters used for this tool.") ) @@ -1146,7 +1146,7 @@ class FidoUI: # ############################################################################################################# # Selection Frame # ############################################################################################################# - self.sel_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Selection"))) + self.sel_label = FCLabel('%s' % _("Selection"), color='green', bold=True) self.tools_box.addWidget(self.sel_label) self.s_frame = FCFrame() diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index ca912f20..8efffa3f 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -1267,7 +1267,7 @@ class FilmUI: # ############################################################################################################# # Source Object Frame # ############################################################################################################# - self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _("Adjustments"))) + self.film_adj_label = FCLabel('%s' % _("Adjustments"), color='green', bold=True) self.film_adj_label.setToolTip( _("Compensate print distortions.") ) @@ -1514,7 +1514,7 @@ class FilmUI: # ############################################################################################################# # Parameters Frame # ############################################################################################################# - self.film_param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.film_param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.tools_box.addWidget(self.film_param_label) par_frame = FCFrame() @@ -1654,7 +1654,7 @@ class FilmUI: # ############################################################################################################# # Export Frame # ############################################################################################################# - self.export_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Export'))) + self.export_label = FCLabel('%s' % _("Export"), color='red', bold=True) self.tools_box.addWidget(self.export_label) exp_frame = FCFrame() diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py index 7ed75170..1fcde462 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 533bff51..cd6837bf 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -220,7 +220,7 @@ class InvertUI: # ############################################################################################################# # Source Object Frame # ############################################################################################################# - self.gerber_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.gerber_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 9d7b1e7c..8dbc70c5 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) self.gen_param_label.setToolTip( _("Parameters that are common for all tools.") ) diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py index ce308f87..f99f5a3d 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.probe_gc_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('red'), _("Controller"))) + self.al_controller_label = FCLabel('%s' % _("Controller"), color='red', bold=True) 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 6769cdf6..e53b6dcf 100644 --- a/appPlugins/ToolMarkers.py +++ b/appPlugins/ToolMarkers.py @@ -1260,7 +1260,7 @@ class MarkersUI: # Gerber Source Object # ############################################################################################################# - self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.object_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('magenta'), _('Offset'))) + self.offset_title_label = FCLabel('%s' % _("Offset"), color='magenta', bold=True) 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' % (self.app.theme_safe_color('red'), _('Locations'))) + self.locs_label = FCLabel('%s' % _("Locations"), color='red', bold=True) 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' % (self.app.theme_safe_color('green'), _("Selection"))) + self.mode_label = FCLabel('%s' % _("Selection"), color='green', bold=True) 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' % (self.app.theme_safe_color('brown'), _('Drills in Locations'))) + self.drills_label = FCLabel('%s' % _("Drills in Locations"), color='brown', bold=True) 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' % (self.app.theme_safe_color('indigo'), _('Check in Locations'))) + self.check_label = FCLabel('%s' % _("Check in Locations"), color='indigo', bold=True) 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' % (self.app.theme_safe_color('teal'), _('Insert Markers'))) + self.insert_label = FCLabel('%s' % _("Insert Markers"), color='teal', bold=True) 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 bc073a7e..39ae0437 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) self.gen_param_label.setToolTip( _("Parameters that are common for all tools.") ) diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 9be84109..982bba2d 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) self.gen_param_label.setToolTip( _("Parameters that are common for all tools.") ) diff --git a/appPlugins/ToolObjectDistance.py b/appPlugins/ToolObjectDistance.py index 3ef5fbce..3679a534 100644 --- a/appPlugins/ToolObjectDistance.py +++ b/appPlugins/ToolObjectDistance.py @@ -444,7 +444,7 @@ class ObjectDistanceUI: # ############################################################################################################# # Parameters Frame # ############################################################################################################# - self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("Parameters used for this tool.") ) @@ -473,7 +473,7 @@ class ObjectDistanceUI: # ############################################################################################################# # Coordinates Frame # ############################################################################################################# - self.coords_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _('Coordinates'))) + self.coords_label = FCLabel('%s' % _("Coordinates"), color='green', bold=True) self.layout.addWidget(self.coords_label) coords_frame = FCFrame() @@ -516,7 +516,7 @@ class ObjectDistanceUI: # ############################################################################################################# # Coordinates Frame # ############################################################################################################# - self.res_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _('Results'))) + self.res_label = FCLabel('%s' % _("Results"), color='red', bold=True) self.layout.addWidget(self.res_label) res_frame = FCFrame() diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py index 979d2e69..830dea85 100644 --- a/appPlugins/ToolOptimal.py +++ b/appPlugins/ToolOptimal.py @@ -481,7 +481,7 @@ class OptimalUI: # ############################################################################################################# # Gerber Source Object # ############################################################################################################# - self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Minimum distance"))) + res_label = FCLabel('%s' % _("Minimum distance"), color='green', bold=True) 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' % (self.app.theme_safe_color('magenta'), _("Other distances"))) + self.title_second_res_label = FCLabel('%s' % _("Other distances"), color='magenta', bold=True) 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 88bb71b6..620e9d2a 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Common Parameters"))) + self.gen_param_label = FCLabel('%s' % _("Common Parameters"), color='indigo', bold=True) 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 5b756c4b..6bb55144 100644 --- a/appPlugins/ToolPanelize.py +++ b/appPlugins/ToolPanelize.py @@ -1160,7 +1160,7 @@ class PanelizeUI: # ############################################################################################################# # Source Object Frame # ############################################################################################################# - self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.object_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _("Reference"))) + self.box_label = FCLabel('%s' % _("Reference"), color='green', bold=True) 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' % (self.app.theme_safe_color('red'), _("Panel Data"))) + panel_data_label = FCLabel('%s' % _("Panel Data"), color='red', bold=True) panel_data_label.setToolTip( _("This informations will shape the resulting panel.\n" "The number of rows and columns will set how many\n" @@ -1287,7 +1287,7 @@ class PanelizeUI: self.spacing_columns_label = FCLabel('%s:' % _("Spacing cols")) self.spacing_columns_label.setToolTip( - _("Spacing between columns of the desired panel.\n" + _("Spacing between columns.\n" "In current units.") ) grid2.addWidget(self.spacing_columns_label, 0, 0) @@ -1300,7 +1300,7 @@ class PanelizeUI: self.spacing_rows_label = FCLabel('%s:' % _("Spacing rows")) self.spacing_rows_label.setToolTip( - _("Spacing between rows of the desired panel.\n" + _("Spacing between rows.\n" "In current units.") ) grid2.addWidget(self.spacing_rows_label, 2, 0) @@ -1312,7 +1312,7 @@ class PanelizeUI: self.columns_label = FCLabel('%s:' % _("Columns")) self.columns_label.setToolTip( - _("Number of columns of the desired panel") + _("Number of columns") ) grid2.addWidget(self.columns_label, 4, 0) grid2.addWidget(self.columns, 4, 1) @@ -1323,7 +1323,7 @@ class PanelizeUI: self.rows_label = FCLabel('%s:' % _("Rows")) self.rows_label.setToolTip( - _("Number of rows of the desired panel") + _("Number of rows") ) grid2.addWidget(self.rows_label, 6, 0) grid2.addWidget(self.rows, 6, 1) @@ -1331,7 +1331,7 @@ class PanelizeUI: # ############################################################################################################# # COMMON PARAMETERS Frame # ############################################################################################################# - self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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 44876fa3..325bb021 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -2027,7 +2027,7 @@ class PunchUI: # ############################################################################################################# # Source Object Frame # ############################################################################################################# - self.obj_combo_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.obj_combo_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('blue'), _("Processed Pads Type"))) + self.padt_label = FCLabel('%s' % _("Processed Pads Type"), color='blue', bold=True) 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' % (self.app.theme_safe_color('red'), _("Method"))) + self.method_label = FCLabel('%s' % _("Method"), color='red', bold=True) 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' % (self.app.theme_safe_color('green'), _("Selection"))) + self.sel_label = FCLabel('%s' % _("Selection"), color='green', bold=True) self.tools_box.addWidget(self.sel_label) self.s_frame = FCFrame() diff --git a/appPlugins/ToolQRCode.py b/appPlugins/ToolQRCode.py index 77ed3029..867d50dd 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' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.grbobj_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('red'), _("QRCode Data"))) + self.text_label = FCLabel('%s' % _("QRCode Data"), color='red', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.qrcode_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('darkgreen'), _("Export QRCode"))) + self.export_label = FCLabel('%s' % _("Export QRCode"), color='darkgreen', bold=True) 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/ToolRulesCheck.py b/appPlugins/ToolRulesCheck.py index 8267f647..e248824c 100644 --- a/appPlugins/ToolRulesCheck.py +++ b/appPlugins/ToolRulesCheck.py @@ -1182,7 +1182,7 @@ class RulesUI: # ############################################################################################################# # Select All Frame # ############################################################################################################# - select_all_label = FCLabel('%s' % (self.app.theme_safe_color('CornflowerBlue'), _("Select All"))) + select_all_label = FCLabel('%s' % _("Select All"), color='CornflowerBlue', bold=True) self.layout.addWidget(select_all_label) sel_frame = FCFrame() @@ -1236,7 +1236,7 @@ class RulesUI: # ############################################################################################################# # Top Gerber Frame # ############################################################################################################# - top_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Top"))) + top_label = FCLabel('%s' % _("Top"), color='red', bold=True) self.layout.addWidget(top_label) top_frame = FCFrame() @@ -1302,7 +1302,7 @@ class RulesUI: # ############################################################################################################# # Bottom Gerber Frame # ############################################################################################################# - bottom_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Bottom"))) + bottom_label = FCLabel('%s' % _("Bottom"), color='blue', bold=True) self.layout.addWidget(bottom_label) bottom_frame = FCFrame() @@ -1368,7 +1368,7 @@ class RulesUI: # ############################################################################################################# # Outline Frame # ############################################################################################################# - outline_label = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Outline"))) + outline_label = FCLabel('%s' % _("Outline"), color='green', bold=True) self.layout.addWidget(outline_label) outline_frame = FCFrame() @@ -1397,7 +1397,7 @@ class RulesUI: # ############################################################################################################# # Excellon Frame # ############################################################################################################# - exc_label = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("Excellon"))) + exc_label = FCLabel('%s' % _("Excellon"), color='brown', bold=True) exc_label.setToolTip( _("Excellon objects for which to check rules.") ) @@ -1460,7 +1460,7 @@ class RulesUI: # ############################################################################################################# # Rules Frame # ############################################################################################################# - rules_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('darkorange'), _("Copper"), _("Rules"))) + rules_copper_label = FCLabel('%s %s' % (_("Copper"), _("Rules")), color='darkorange', bold=True) self.layout.addWidget(rules_copper_label) copper_frame = FCFrame() @@ -1570,7 +1570,7 @@ class RulesUI: # ############################################################################################################# # Silk Frame # ############################################################################################################# - silk_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('teal'), _("Silk"), _("Rules"))) + silk_copper_label = FCLabel('%s %s' % (_("Silk"), _("Rules")), color='teal', bold=True) self.layout.addWidget(silk_copper_label) silk_frame = FCFrame() @@ -1657,7 +1657,7 @@ class RulesUI: # ############################################################################################################# # Soldermask Frame # ############################################################################################################# - sm_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('magenta'), _("Soldermask"), _("Rules"))) + sm_copper_label = FCLabel('%s %s' % (_("Soldermask"), _("Rules")), color='magenta', bold=True) self.layout.addWidget(sm_copper_label) solder_frame = FCFrame() @@ -1695,7 +1695,7 @@ class RulesUI: # ############################################################################################################# # Holes Frame # ############################################################################################################# - holes_copper_label = FCLabel('%s %s' % (self.app.theme_safe_color('brown'), _("Holes"), _("Rules"))) + holes_copper_label = FCLabel('%s %s' % (_("Holes"), _("Rules")), color='brown', bold=True) self.layout.addWidget(holes_copper_label) holes_frame = FCFrame() diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index 5a8fba09..d95de190 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -1215,7 +1215,7 @@ class SolderUI: # ############################################################################################################# # Source Object # ############################################################################################################# - self.object_label = FCLabel('%s' % (self.app.theme_safe_color('darkorange'), _("Source Object"))) + self.object_label = FCLabel('%s' % _("Source Object"), color='darkorange', bold=True) 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' % (self.app.theme_safe_color('green'), _('Tools Table'))) + self.tools_table_label = FCLabel('%s' % _("Tools Table"), color='green', bold=True) 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' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.param_label.setToolTip( _("Parameters used for this tool.") ) @@ -1333,7 +1333,7 @@ class SolderUI: # ############################################################################################################# # Dispense Frame # ############################################################################################################# - self.disp_lbl = FCLabel('%s' % (self.app.theme_safe_color('tomato'), _('Dispense'))) + self.disp_lbl = FCLabel('%s' % _("Dispense"), color='tomato', bold=True) self.tools_box.addWidget(self.disp_lbl) disp_frame = FCFrame() @@ -1384,7 +1384,7 @@ class SolderUI: # ############################################################################################################# # Toolchange Frame # ############################################################################################################# - self.toolchnage_lbl = FCLabel('%s' % (self.app.theme_safe_color('indigo'), _("Tool change"))) + self.toolchnage_lbl = FCLabel('%s' % _("Tool change"), color='indigo', bold=True) self.tools_box.addWidget(self.toolchnage_lbl) tc_frame = FCFrame() @@ -1419,7 +1419,7 @@ class SolderUI: # ############################################################################################################# # Feedrate Frame # ############################################################################################################# - fr_lbl = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Feedrate"))) + fr_lbl = FCLabel('%s' % _("Feedrate"), color='red', bold=True) self.tools_box.addWidget(fr_lbl) fr_frame = FCFrame() @@ -1472,7 +1472,7 @@ class SolderUI: # ############################################################################################################# # Spindle Forward Frame # ############################################################################################################# - sp_fw_lbl = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Forward"))) + sp_fw_lbl = FCLabel('%s' % _("Forward"), color='blue', bold=True) 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' % (self.app.theme_safe_color('teal'), _("Reverse"))) + sp_rev_lbl = FCLabel('%s' % _("Reverse"), color='teal', bold=True) self.tools_box.addWidget(sp_rev_lbl) sp_rev_frame = FCFrame() @@ -1566,7 +1566,7 @@ class SolderUI: # ############################################################################################################# # Geometry Frame # ############################################################################################################# - geo_lbl = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Geometry"))) + geo_lbl = FCLabel('%s' % _("Geometry"), color='red', bold=True) self.tools_box.addWidget(geo_lbl) geo_frame = FCFrame() @@ -1607,7 +1607,7 @@ class SolderUI: # ############################################################################################################# # CNCJob Frame # ############################################################################################################# - cnc_lbl = FCLabel('%s' % (self.app.theme_safe_color('brown'), _("CNCJob"))) + cnc_lbl = FCLabel('%s' % _("CNCJob"), color='brown', bold=True) self.tools_box.addWidget(cnc_lbl) cnc_frame = FCFrame() diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py index f8b91fab..a6b42da3 100644 --- a/appPlugins/ToolSub.py +++ b/appPlugins/ToolSub.py @@ -807,7 +807,7 @@ class SubUI: # ############################################################################################################# # COMMON PARAMETERS Frame # ############################################################################################################# - self.param_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.param_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) 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' % (self.app.theme_safe_color('green'), _("Gerber"))) + self.grb_label = FCLabel('%s' % _("Gerber"), color='green', bold=True) self.tools_box.addWidget(self.grb_label) grb_frame = FCFrame() @@ -892,7 +892,7 @@ class SubUI: # ############################################################################################################# # Geometry Subtraction Frame # ############################################################################################################# - self.geo_label = FCLabel('%s' % (self.app.theme_safe_color('red'), _("Geometry"))) + self.geo_label = FCLabel('%s' % _("Geometry"), color='red', bold=True) self.tools_box.addWidget(self.geo_label) geo_frame = FCFrame() diff --git a/appPlugins/ToolTransform.py b/appPlugins/ToolTransform.py index 0bf8633f..3a495e0c 100644 --- a/appPlugins/ToolTransform.py +++ b/appPlugins/ToolTransform.py @@ -590,7 +590,7 @@ class TransformUI: # ############################################################################################################# # PARAMETERS # ############################################################################################################# - self.transform_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _("Parameters"))) + self.transform_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.layout.addWidget(self.transform_label) # ############################################################################################################# @@ -671,7 +671,7 @@ class TransformUI: # ############################################################################################################# # Rotate Frame # ############################################################################################################# - rotate_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('tomato'), _("Rotate"))) + rotate_title_lbl = FCLabel('%s' % _("Rotate"), color='tomato', bold=True) 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' % (self.app.theme_safe_color('teal'), _("Skew"))) + skew_title_lbl = FCLabel('%s' % _("Skew"), color='teal', bold=True) 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' % (self.app.theme_safe_color('magenta'), _("Scale"))) + scale_title_lbl = FCLabel('%s' % _("Scale"), color='magenta', bold=True) 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.app.theme_safe_color('brown'), self.flipName)) + flip_title_label = FCLabel('%s' % self.flipName, color='brown', bold=True) self.layout.addWidget(flip_title_label) mirror_frame = FCFrame() @@ -881,7 +881,7 @@ class TransformUI: # ############################################################################################################# # Offset Frame # ############################################################################################################# - offset_title_lbl = FCLabel('%s' % (self.app.theme_safe_color('green'), _("Offset"))) + offset_title_lbl = FCLabel('%s' % _("Offset"), color='green', bold=True) 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' % (self.app.theme_safe_color('indigo'), _("Buffer"))) + buffer_title_lbl = FCLabel('%s' % _("Buffer"), color='indigo', bold=True) b_t_lay.addWidget(buffer_title_lbl) b_t_lay.addStretch() From ce4b43bd369a453f14c3daf58842c15570878de5 Mon Sep 17 00:00:00 2001 From: Ali Khalil Date: Mon, 18 Apr 2022 11:32:33 +0300 Subject: [PATCH 04/15] Menu icons location changes restored and will be addressed in future update with better mechanism. FCLabel calls updated where possible based on new method parameters --- Bookmark.py | 2 +- appDatabase.py | 4 +- appEditors/AppExcEditor.py | 12 +- appEditors/AppGeoEditor.py | 22 +- appEditors/AppGerberEditor.py | 20 +- appEditors/geo_plugins/GeoCirclePlugin.py | 4 +- appEditors/geo_plugins/GeoCopyPlugin.py | 2 +- appEditors/geo_plugins/GeoRectanglePlugin.py | 8 +- .../geo_plugins/GeoSimplificationPlugin.py | 8 +- appGUI/MainGUI.py | 354 +++++++++--------- appGUI/ObjectUI.py | 36 +- .../excellon/ExcellonOptPrefGroupUI.py | 2 +- .../general/GeneralAPPSetGroupUI.py | 2 +- .../general/GeneralAppPrefGroupUI.py | 2 +- .../general/GeneralGUIPrefGroupUI.py | 12 +- .../tools/Tools2CThievingPrefGroupUI.py | 6 +- .../preferences/tools/ToolsISOPrefGroupUI.py | 2 +- .../preferences/tools/ToolsMillPrefGroupUI.py | 2 +- .../preferences/tools/ToolsNCCPrefGroupUI.py | 2 +- .../tools/ToolsPaintPrefGroupUI.py | 2 +- .../tools/ToolsSolderpastePrefGroupUI.py | 4 +- .../utilities/AutoCompletePrefGroupUI.py | 2 +- .../preferences/utilities/FAExcPrefGroupUI.py | 2 +- .../preferences/utilities/FAGcoPrefGroupUI.py | 2 +- .../preferences/utilities/FAGrbPrefGroupUI.py | 2 +- appMain.py | 116 ++---- appPlugins/ToolAlignObjects.py | 2 +- appPlugins/ToolCalibration.py | 18 +- appPlugins/ToolCopperThieving.py | 6 +- appPlugins/ToolDblSided.py | 4 +- appPlugins/ToolDistance.py | 2 +- appPlugins/ToolExtract.py | 6 +- appPlugins/ToolImage.py | 2 +- appPlugins/ToolIsolation.py | 2 +- appPlugins/ToolLevelling.py | 4 +- appPlugins/ToolMilling.py | 2 +- appPlugins/ToolNCC.py | 2 +- appPlugins/ToolObjectDistance.py | 4 +- appPlugins/ToolOptimal.py | 2 +- appPlugins/ToolPaint.py | 4 +- appPlugins/ToolPanelize.py | 2 +- appPlugins/ToolPcbWizard.py | 2 +- appPlugins/ToolPunchGerber.py | 8 +- appPlugins/ToolSolderPaste.py | 2 +- appPlugins/ToolSub.py | 2 +- 45 files changed, 323 insertions(+), 385 deletions(-) diff --git a/Bookmark.py b/Bookmark.py index 796c1105..a3b6629d 100644 --- a/Bookmark.py +++ b/Bookmark.py @@ -75,7 +75,7 @@ class BookmarkManager(QtWidgets.QWidget): new_vlay = QtWidgets.QVBoxLayout() layout.addLayout(new_vlay) - new_title_lbl = FCLabel('%s' % _("New Bookmark")) + new_title_lbl = FCLabel('%s' % _("New Bookmark"), bold=True) new_vlay.addWidget(new_title_lbl) grid0 = GLay(v_spacing=5, h_spacing=3) diff --git a/appDatabase.py b/appDatabase.py index 8f21063a..0d487586 100644 --- a/appDatabase.py +++ b/appDatabase.py @@ -226,7 +226,7 @@ class ToolsDB2UI: self.grid_tool.addWidget(self.dia_entry, 1, 1) # Tool Tolerance - self.tol_label = FCLabel("%s:" % _("Diameter Tolerance")) + self.tol_label = FCLabel('%s:' % _("Diameter Tolerance"), bold=True) self.tol_label.setToolTip( _("Tool tolerance. This tool will be used if the desired tool diameter\n" "is within the tolerance specified here.") @@ -262,7 +262,7 @@ class ToolsDB2UI: self.grid_tool.addWidget(self.tol_max_entry, 6, 1) # Tool Object Type - self.tool_op_label = FCLabel('%s:' % _('Target')) + self.tool_op_label = FCLabel('%s:' % _('Target'), bold=True) self.tool_op_label.setToolTip( _("The kind of Application Tool where this tool is to be used.")) diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index 5d701f71..91bf4cf9 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -4054,7 +4054,7 @@ class AppExcEditorUI: self.name_box.addWidget(self.name_entry) # Tools Drills Table Title - self.tools_table_label = FCLabel("%s" % _('Tools Table')) + self.tools_table_label = FCLabel('%s' % _('Tools Table'), bold=True) self.tools_table_label.setToolTip( _("Tools in this Excellon object\n" "when are used for drilling.") @@ -4091,7 +4091,7 @@ class AppExcEditorUI: self.ui_vertical_lay.addWidget(separator_line) # Add a new Tool - self.addtool_label = FCLabel('%s' % _('Add/Delete Tool')) + self.addtool_label = FCLabel('%s' % _('Add/Delete Tool'), bold=True) self.addtool_label.setToolTip( _("Add/Delete a tool to the tool list\n" "for this Excellon object.") @@ -4157,7 +4157,7 @@ class AppExcEditorUI: self.resize_grid.setContentsMargins(0, 0, 0, 0) self.resize_frame.setLayout(self.resize_grid) - self.drillresize_label = FCLabel('%s' % _("Resize Tool")) + self.drillresize_label = FCLabel('%s' % _("Resize Tool"), bold=True) self.drillresize_label.setToolTip( _("Resize a drill or a selection of drills.") ) @@ -4212,7 +4212,7 @@ class AppExcEditorUI: self.array_frame.setLayout(self.array_grid) # Type of Drill Array - self.drill_array_label = FCLabel('%s' % _("Add Drill Array")) + self.drill_array_label = FCLabel('%s' % _("Add Drill Array"), bold=True) self.drill_array_label.setToolTip( _("Add an array of drills (linear or circular array)") ) @@ -4352,7 +4352,7 @@ class AppExcEditorUI: self.slot_frame.setLayout(self.slot_grid) # Slot Tile Label - self.slot_label = FCLabel('%s' % _("Slot Parameters")) + self.slot_label = FCLabel('%s' % _("Slot Parameters"), bold=True) self.slot_label.setToolTip( _("Parameters for adding a slot (hole with oval shape)\n" "either single or as an part of an array.") @@ -4424,7 +4424,7 @@ class AppExcEditorUI: self.slot_array_frame.setLayout(self.slot_array_grid) # Slot Array Title - self.slot_array_label = FCLabel('%s' % _("Slot Array Parameters")) + self.slot_array_label = FCLabel('%s' % _("Slot Array Parameters"), bold=True) self.slot_array_label.setToolTip( _("Parameters for the array of slots (linear or circular array)") ) diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index 8183c40d..c32d2e89 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -3096,7 +3096,7 @@ class AppGeoEditor(QtCore.QObject): self.tools_box.addLayout(self.grid_d) # Tool diameter - tooldia_lbl = FCLabel('%s:' % _("Tool dia")) + tooldia_lbl = FCLabel('%s' % _("Tool dia"), bold=True) tooldia_lbl.setToolTip( _("Edited tool diameter.") ) @@ -3108,7 +3108,7 @@ class AppGeoEditor(QtCore.QObject): self.grid_d.addWidget(tooldia_lbl, 0, 0) self.grid_d.addWidget(self.tooldia_entry, 0, 1) # Tree Widget Title - tw_label = FCLabel('%s:' % _("Geometry Table")) + tw_label = FCLabel('%s' % _("Geometry Table"), bold=True) tw_label.setToolTip( _("The list of geometry elements inside the edited object.") ) @@ -3148,35 +3148,35 @@ class AppGeoEditor(QtCore.QObject): grid0.addWidget(separator_line, 2, 0, 1, 3) # Parameters Title - param_title = FCLabel('%s:' % _("Parameters")) + param_title = FCLabel('%s' % _("Parameters"), bold=True) param_title.setToolTip( _("Geometry parameters.") ) grid0.addWidget(param_title, 4, 0, 1, 3) # Is Valid - is_valid_lbl = FCLabel('%s:' % _("Is Valid")) + is_valid_lbl = FCLabel('%s' % _("Is Valid"), bold=True) self.is_valid_entry = FCLabel('None') grid0.addWidget(is_valid_lbl, 10, 0) grid0.addWidget(self.is_valid_entry, 10, 1, 1, 2) # Is Empty - is_empty_lbl = FCLabel('%s:' % _("Is Empty")) + is_empty_lbl = FCLabel('%s' % _("Is Empty"), bold=True) self.is_empty_entry = FCLabel('None') grid0.addWidget(is_empty_lbl, 12, 0) grid0.addWidget(self.is_empty_entry, 12, 1, 1, 2) # Is Ring - is_ring_lbl = FCLabel('%s:' % _("Is Ring")) + is_ring_lbl = FCLabel('%s' % _("Is Ring"), bold=True) self.is_ring_entry = FCLabel('None') grid0.addWidget(is_ring_lbl, 14, 0) grid0.addWidget(self.is_ring_entry, 14, 1, 1, 2) # Is CCW - is_ccw_lbl = FCLabel('%s:' % _("Is CCW")) + is_ccw_lbl = FCLabel('%s' % _("Is CCW"), bold=True) self.is_ccw_entry = FCLabel('None') self.change_orientation_btn = FCButton(_("Change")) self.change_orientation_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/orientation32.png')) @@ -3189,14 +3189,14 @@ class AppGeoEditor(QtCore.QObject): grid0.addWidget(self.change_orientation_btn, 16, 2) # Is Simple - is_simple_lbl = FCLabel('%s:' % _("Is Simple")) + is_simple_lbl = FCLabel('%s' % _("Is Simple"), bold=True) self.is_simple_entry = FCLabel('None') grid0.addWidget(is_simple_lbl, 18, 0) grid0.addWidget(self.is_simple_entry, 18, 1, 1, 2) # Length - len_lbl = FCLabel('%s:' % _("Length")) + len_lbl = FCLabel('%s' % _("Length"), bold=True) len_lbl.setToolTip( _("The length of the geometry element.") ) @@ -3207,7 +3207,7 @@ class AppGeoEditor(QtCore.QObject): grid0.addWidget(self.geo_len_entry, 20, 1, 1, 2) # Coordinates - coords_lbl = FCLabel('%s:' % _("Coordinates")) + coords_lbl = FCLabel('%s' % _("Coordinates"), bold=True) coords_lbl.setToolTip( _("The coordinates of the selected geometry element.") ) @@ -3220,7 +3220,7 @@ class AppGeoEditor(QtCore.QObject): grid0.addWidget(self.geo_coords_entry, 24, 0, 1, 3) # Vertex Points Number - vertex_lbl = FCLabel('%s:' % _("Vertex Points")) + vertex_lbl = FCLabel('%s' % _("Vertex Points"), bold=True) vertex_lbl.setToolTip( _("The number of vertex points in the selected geometry element.") ) diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 6613ecc5..90a9cd9e 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -6174,7 +6174,7 @@ class AppGerberEditorUI: # ############################################################################################################# # #################################### Gerber Apertures Table ################################################# # ############################################################################################################# - self.apertures_table_label = FCLabel('%s:' % _('Apertures')) + self.apertures_table_label = FCLabel('%s:' % _('Apertures'), bold=True) self.apertures_table_label.setToolTip( _("Apertures Table for the Gerber Object.") ) @@ -6225,7 +6225,7 @@ class AppGerberEditorUI: self.apertures_box.addLayout(grid1) # Title - apadd_del_lbl = FCLabel('%s:' % _('Add/Delete Aperture')) + apadd_del_lbl = FCLabel('%s:' % _('Add/Delete Aperture'), bold=True) apadd_del_lbl.setToolTip( _("Add/Delete an aperture in the aperture table") ) @@ -6334,7 +6334,7 @@ class AppGerberEditorUI: self.shape_grid.addWidget(separator_line, 2, 0, 1, 3) # Parameters Title - param_title = FCLabel('%s' % _("Parameters")) + param_title = FCLabel('%s' % _("Parameters"), bold=True) param_title.setToolTip( _("Geometry parameters.") ) @@ -6343,7 +6343,7 @@ class AppGerberEditorUI: p_grid = GLay(v_spacing=5, h_spacing=3, c_stretch=[0, 0, 0, 1, 0]) # Is Valid - valid_lbl = FCLabel('%s:' % _("Valid")) + valid_lbl = FCLabel('%s' % _("Valid"), bold=True) valid_lbl.setToolTip( _("Show if the selected polygon is valid.") ) @@ -6352,7 +6352,7 @@ class AppGerberEditorUI: p_grid.addWidget(self.is_valid_entry, 0, 1) # Area - area_lbl = FCLabel('%s:' % _("Area")) + area_lbl = FCLabel('%s' % _("Area"), bold=True) area_lbl.setToolTip( _("Show the area of the selected polygon.") ) @@ -6397,7 +6397,7 @@ class AppGerberEditorUI: self.shape_grid.addWidget(separator_line, 12, 0, 1, 3) # Simplification Title - simplif_lbl = FCLabel('%s:' % _("Simplification")) + simplif_lbl = FCLabel('%s' % _("Simplification"), bold=True) simplif_lbl.setToolTip( _("Simplify a geometry by reducing its vertex points number.") ) @@ -6445,7 +6445,7 @@ class AppGerberEditorUI: self.buffer_tool_frame.hide() # Title - buf_title_lbl = FCLabel('%s:' % _('Buffer Aperture')) + buf_title_lbl = FCLabel('%s:' % _('Buffer Aperture'), bold=True) buf_title_lbl.setToolTip( _("Buffer a aperture in the aperture list") ) @@ -6503,7 +6503,7 @@ class AppGerberEditorUI: self.scale_tool_frame.hide() # Title - scale_title_lbl = FCLabel('%s:' % _('Scale Aperture')) + scale_title_lbl = FCLabel('%s:' % _('Scale Aperture'), bold=True) scale_title_lbl.setToolTip( _("Scale a aperture in the aperture list") ) @@ -6552,7 +6552,7 @@ class AppGerberEditorUI: self.ma_tools_box.addWidget(separator_line) # Title - ma_title_lbl = FCLabel('%s:' % _('Mark polygons')) + ma_title_lbl = FCLabel('%s:' % _('Mark polygons'), bold=True) ma_title_lbl.setToolTip( _("Mark the polygon areas.") ) @@ -6632,7 +6632,7 @@ class AppGerberEditorUI: self.array_box.addLayout(array_grid) # Title - self.padarray_label = FCLabel('%s' % _("Add Pad Array")) + self.padarray_label = FCLabel('%s' % _("Add Pad Array"), bold=True) self.padarray_label.setToolTip( _("Add an array of pads (linear or circular array)") ) diff --git a/appEditors/geo_plugins/GeoCirclePlugin.py b/appEditors/geo_plugins/GeoCirclePlugin.py index 397b2451..5b86414c 100644 --- a/appEditors/geo_plugins/GeoCirclePlugin.py +++ b/appEditors/geo_plugins/GeoCirclePlugin.py @@ -187,7 +187,7 @@ class CircleEditorUI: self.circle_tool_box.addLayout(grid0) # Position - self.pos_lbl = FCLabel('%s' % _("Position")) + self.pos_lbl = FCLabel('%s' % _("Position"), bold=True) grid0.addWidget(self.pos_lbl, 0, 0, 1, 3) # X Pos @@ -246,7 +246,7 @@ class CircleEditorUI: self.layout.addStretch(1) # Note - self.note_lbl = FCLabel('%s' % _("Note")) + self.note_lbl = FCLabel('%s' % _("Note"), bold=True) self.layout.addWidget(self.note_lbl) self.note_description_lbl = FCLabel('%s' % _("Shift + click to select a shape for modification.")) self.layout.addWidget(self.note_description_lbl) diff --git a/appEditors/geo_plugins/GeoCopyPlugin.py b/appEditors/geo_plugins/GeoCopyPlugin.py index fb71cd2f..4cc079cc 100644 --- a/appEditors/geo_plugins/GeoCopyPlugin.py +++ b/appEditors/geo_plugins/GeoCopyPlugin.py @@ -164,7 +164,7 @@ class CopyEditorUI: grid0.addWidget(separator_line, 4, 0, 1, 2) # Type of Array - self.mode_label = FCLabel('%s:' % _("Mode")) + self.mode_label = FCLabel('%s:' % _("Mode"), bold=True) self.mode_label.setToolTip( _("Single copy or special (array of copies)") ) diff --git a/appEditors/geo_plugins/GeoRectanglePlugin.py b/appEditors/geo_plugins/GeoRectanglePlugin.py index 9acc15d6..d76a9aed 100644 --- a/appEditors/geo_plugins/GeoRectanglePlugin.py +++ b/appEditors/geo_plugins/GeoRectanglePlugin.py @@ -220,7 +220,7 @@ class RectangleEditorUI: self.rect_tool_box.addLayout(grid0) # Anchor - self.anchor_lbl = FCLabel('%s:' % _("Anchor")) + self.anchor_lbl = FCLabel('%s:' % _("Anchor"), bold=True) choices = [ {"label": _("T Left"), "value": "tl"}, {"label": _("T Right"), "value": "tr"}, @@ -233,7 +233,7 @@ class RectangleEditorUI: grid0.addWidget(self.anchor_radio, 0, 1) # Position - self.pos_lbl = FCLabel('%s' % _("Position")) + self.pos_lbl = FCLabel('%s' % _("Position"), bold=True) grid0.addWidget(self.pos_lbl, 2, 0, 1, 2) # X Pos @@ -277,7 +277,7 @@ class RectangleEditorUI: grid0.addWidget(self.radius_entry, 10, 1) # Size - self.size_lbl = FCLabel('%s' % _("Size")) + self.size_lbl = FCLabel('%s' % _("Size"), bold=True) grid0.addWidget(self.size_lbl, 12, 0, 1, 2) # Length @@ -300,7 +300,7 @@ class RectangleEditorUI: self.layout.addStretch(1) # Note - self.note_lbl = FCLabel('%s' % _("Note")) + self.note_lbl = FCLabel('%s' % _("Note"), bold=True) self.layout.addWidget(self.note_lbl) self.note_description_lbl = FCLabel('%s' % _("Shift + click to select a shape for modification.")) self.layout.addWidget(self.note_description_lbl) diff --git a/appEditors/geo_plugins/GeoSimplificationPlugin.py b/appEditors/geo_plugins/GeoSimplificationPlugin.py index 7fe9938a..ddeda6cb 100644 --- a/appEditors/geo_plugins/GeoSimplificationPlugin.py +++ b/appEditors/geo_plugins/GeoSimplificationPlugin.py @@ -196,7 +196,7 @@ class SimplificationEditorUI: self.simp_tools_box.addLayout(grid0) # Coordinates - coords_lbl = FCLabel('%s:' % _("Coordinates")) + coords_lbl = FCLabel('%s' % _("Coordinates"), bold=True) coords_lbl.setToolTip( _("The coordinates of the selected geometry element.") ) @@ -209,7 +209,7 @@ class SimplificationEditorUI: grid0.addWidget(self.geo_coords_entry, 24, 0, 1, 3) # Vertex Points Number - vertex_lbl = FCLabel('%s:' % _("Vertex Points")) + vertex_lbl = FCLabel('%s' % _("Vertex Points"), bold=True) vertex_lbl.setToolTip( _("The number of vertex points in the selected geometry element.") ) @@ -225,14 +225,14 @@ class SimplificationEditorUI: grid0.addWidget(separator_line, 28, 0, 1, 3) # Simplification Title - simplif_lbl = FCLabel('%s:' % _("Simplification")) + simplif_lbl = FCLabel('%s' % _("Simplification"), bold=True) simplif_lbl.setToolTip( _("Simplify a geometry by reducing its vertex points number.") ) grid0.addWidget(simplif_lbl, 30, 0, 1, 3) # Simplification Tolerance - simplification_tol_lbl = FCLabel('%s:' % _("Tolerance")) + simplification_tol_lbl = FCLabel('%s' % _("Tolerance"), bold=True) simplification_tol_lbl.setToolTip( _("All points in the simplified object will be\n" "within the tolerance distance of the original geometry.") diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index b3175fe1..71bc92ec 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -62,20 +62,6 @@ 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 # ####################################################################### @@ -88,7 +74,7 @@ class MainGUI(QtWidgets.QMainWindow): self.menu = self.menuBar() self.menu_toggle_nb = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/notebook32.png'), _("Toggle Panel")) + QtGui.QIcon(self.app.resource_location + '/notebook32.png'), _("Toggle Panel")) self.menu_toggle_nb.setToolTip( _("Toggle Panel") ) @@ -104,7 +90,7 @@ class MainGUI(QtWidgets.QMainWindow): self.menufile.setToolTipsVisible(True) # New Project - self.menufilenewproject = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/file16.png'), + self.menufilenewproject = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/file16.png'), '%s...\t%s' % (_('New Project'), _("Ctrl+N")), self) self.menufilenewproject.setToolTip( _("Will create a new, blank project") @@ -112,88 +98,88 @@ class MainGUI(QtWidgets.QMainWindow): self.menufile.addAction(self.menufilenewproject) # New Category (Excellon, Geometry) - self.menufilenew = self.menufile.addMenu(QtGui.QIcon(self.menu_resource_location + '/file16.png'), _('New')) + self.menufilenew = self.menufile.addMenu(QtGui.QIcon(self.app.resource_location + '/file16.png'), _('New')) self.menufilenew.setToolTipsVisible(True) self.menufilenewgeo = self.menufilenew.addAction( - QtGui.QIcon(self.menu_resource_location + '/new_file_geo16.png'), '%s\t%s' % (_('Geometry'), _('N'))) + QtGui.QIcon(self.app.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.menu_resource_location + '/new_file_grb16.png'), '%s\t%s' % (_('Gerber'), _('B'))) + QtGui.QIcon(self.app.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.menu_resource_location + '/new_file_exc16.png'), '%s\t%s' % (_('Excellon'), _('L'))) + QtGui.QIcon(self.app.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.menu_resource_location + '/notes16_1.png'), '%s\t%s' % (_('Document'), _('D'))) + QtGui.QIcon(self.app.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.menu_resource_location + '/folder32_bis.png'), '%s' % _('Open')) + QtGui.QIcon(self.app.resource_location + '/folder32_bis.png'), '%s' % _('Open')) self.menufile_open.setToolTipsVisible(True) # Open Project ... self.menufileopenproject = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/folder16.png'), '%s...\t%s' % (_('Open Project'), _('Ctrl+O')), + QtGui.QIcon(self.app.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.menu_resource_location + '/flatcam_icon24.png'), + self.menufileopengerber = QtGui.QAction(QtGui.QIcon(self.app.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.menu_resource_location + '/open_excellon32.png'), + self.menufileopenexcellon = QtGui.QAction(QtGui.QIcon(self.app.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.menu_resource_location + '/code.png'), '%s...\t%s' % (_('Open G-Code'), ''), self) + QtGui.QIcon(self.app.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.menu_resource_location + '/folder16.png'), '%s...\t%s' % (_('Open Config'), ''), self) + QtGui.QIcon(self.app.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.menu_resource_location + '/recent_files.png'), _("Recent projects")) + QtGui.QIcon(self.app.resource_location + '/recent_files.png'), _("Recent projects")) self.recent = self.menufile.addMenu( - QtGui.QIcon(self.menu_resource_location + '/recent_files.png'), _("Recent files")) + QtGui.QIcon(self.app.resource_location + '/recent_files.png'), _("Recent files")) # SAVE category - self.menufile_save = self.menufile.addMenu(QtGui.QIcon(self.menu_resource_location + '/save_as.png'), _('Save')) + self.menufile_save = self.menufile.addMenu(QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save')) # Save Project self.menufilesaveproject = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/floppy16.png'), '%s...\t%s' % (_('Save Project'), _('Ctrl+S')), + QtGui.QIcon(self.app.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.menu_resource_location + '/floppy16.png'), + self.menufilesaveprojectas = QtGui.QAction(QtGui.QIcon(self.app.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.menu_resource_location + '/floppy16.png'), _('Save Project Copy ...'), self) + # QtGui.QIcon(self.app.resource_location + '/floppy16.png'), _('Save Project Copy ...'), self) # self.menufile_save.addAction(self.menufilesaveprojectcopy) self.menufile_save.addSeparator() @@ -203,18 +189,18 @@ class MainGUI(QtWidgets.QMainWindow): # Scripting self.menufile_scripting = self.menufile.addMenu( - QtGui.QIcon(self.menu_resource_location + '/script16.png'), _('Scripting')) + QtGui.QIcon(self.app.resource_location + '/script16.png'), _('Scripting')) self.menufile_scripting.setToolTipsVisible(True) - self.menufilenewscript = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/script_new16.png'), + self.menufilenewscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/script_new16.png'), '%s...\t%s' % (_('New Script'), ''), self) - self.menufileopenscript = QtGui.QAction(QtGui.QIcon(self.menu_resource_location + '/open_script32.png'), + self.menufileopenscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/open_script32.png'), '%s...\t%s' % (_('Open Script'), ''), self) self.menufileopenscriptexample = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/open_script32.png'), + QtGui.QIcon(self.app.resource_location + '/open_script32.png'), '%s...\t%s' % (_('Open Example'), ''), self) self.menufilerunscript = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/script16.png'), + QtGui.QIcon(self.app.resource_location + '/script16.png'), '%s...\t%s' % (_('Run Script'), _('Shift+S')), self) self.menufilerunscript.setToolTip( _("Will run the opened Tcl Script thus\n" @@ -232,51 +218,51 @@ class MainGUI(QtWidgets.QMainWindow): # Import ... self.menufileimport = self.menufile.addMenu( - QtGui.QIcon(self.menu_resource_location + '/import.png'), _('Import')) + QtGui.QIcon(self.app.resource_location + '/import.png'), _('Import')) self.menufileimportsvg = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/svg16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/svg16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/dxf16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/dxf16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/dxf16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/export.png'), _('Export')) + QtGui.QIcon(self.app.resource_location + '/export.png'), _('Export')) self.menufileexport.setToolTipsVisible(True) self.menufileexportsvg = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/export.png'), + QtGui.QIcon(self.app.resource_location + '/export.png'), '%s...\t%s' % (_('Export SVG'), ''), self) self.menufileexport.addAction(self.menufileexportsvg) self.menufileexportdxf = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/export.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/export_png32.png'), + QtGui.QIcon(self.app.resource_location + '/export_png32.png'), '%s...\t%s' % (_('Export PNG'), ''), self) self.menufileexportpng.setToolTip( _("Will export an image in PNG format,\n" @@ -288,7 +274,7 @@ class MainGUI(QtWidgets.QMainWindow): self.menufileexport.addSeparator() self.menufileexportexcellon = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/drill32.png'), + QtGui.QIcon(self.app.resource_location + '/drill32.png'), '%s...\t%s' % (_('Export Excellon'), ''), self) self.menufileexportexcellon.setToolTip( _("Will export an Excellon Object as Excellon file,\n" @@ -298,7 +284,7 @@ class MainGUI(QtWidgets.QMainWindow): self.menufileexport.addAction(self.menufileexportexcellon) self.menufileexportgerber = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/flatcam_icon32.png'), + QtGui.QIcon(self.app.resource_location + '/flatcam_icon32.png'), '%s...\t%s' % (_('Export Gerber'), ''), self) self.menufileexportgerber.setToolTip( _("Will export an Gerber Object as Gerber file,\n" @@ -311,18 +297,18 @@ class MainGUI(QtWidgets.QMainWindow): self.menufile.addSeparator() self.menufile_backup = self.menufile.addMenu( - QtGui.QIcon(self.menu_resource_location + '/backup24.png'), _('Backup')) + QtGui.QIcon(self.app.resource_location + '/backup24.png'), _('Backup')) # Import Preferences self.menufileimportpref = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/backup_import24.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/backup_export24.png'), + QtGui.QIcon(self.app.resource_location + '/backup_export24.png'), '%s...\t%s' % (_('Export Preferences to file'), ''), self) self.menufile_backup.addAction(self.menufileexportpref) @@ -331,14 +317,14 @@ class MainGUI(QtWidgets.QMainWindow): # Save Defaults self.menufilesavedefaults = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/defaults.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/printer32.png'), + QtGui.QIcon(self.app.resource_location + '/printer32.png'), '%s\t%s' % (_('Print (PDF)'), _('Ctrl+P'))) self.menufile.addAction(self.menufile_print) @@ -347,7 +333,7 @@ class MainGUI(QtWidgets.QMainWindow): # Quit self.menufile_exit = QtGui.QAction( - QtGui.QIcon(self.menu_resource_location + '/power16.png'), + QtGui.QIcon(self.app.resource_location + '/power16.png'), '%s\t%s' % (_('Exit'), ''), self) # exitAction.setShortcut('Ctrl+Q') # exitAction.setStatusTip('Exit application') @@ -360,10 +346,10 @@ class MainGUI(QtWidgets.QMainWindow): # Separator self.menuedit.addSeparator() self.menueditedit = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/edit16.png'), + QtGui.QIcon(self.app.resource_location + '/edit16.png'), '%s\t%s' % (_('Edit Object'), _('E'))) self.menueditok = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/power16.png'), + QtGui.QIcon(self.app.resource_location + '/power16.png'), '%s\t%s' % (_('Exit Editor'), _('Ctrl+S'))) # adjust the initial state of the menu entries related to the editor @@ -374,17 +360,17 @@ class MainGUI(QtWidgets.QMainWindow): # Separator self.menuedit.addSeparator() self.menuedit_convert = self.menuedit.addMenu( - QtGui.QIcon(self.menu_resource_location + '/convert24.png'), _('Conversion')) + QtGui.QIcon(self.app.resource_location + '/convert24.png'), _('Conversion')) self.menuedit_convert_sg2mg = self.menuedit_convert.addAction( - QtGui.QIcon(self.menu_resource_location + '/convert24.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/convert24.png'), + QtGui.QIcon(self.app.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" @@ -393,21 +379,21 @@ class MainGUI(QtWidgets.QMainWindow): # Separator self.menuedit_convert.addSeparator() self.menueditconvert_any2geo = self.menuedit_convert.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy_geo.png'), + QtGui.QIcon(self.app.resource_location + '/copy_geo.png'), '%s\t%s' % (_('Convert Any to Geo'), '')) self.menueditconvert_any2gerber = self.menuedit_convert.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy_geo.png'), + QtGui.QIcon(self.app.resource_location + '/copy_geo.png'), '%s\t%s' % (_('Convert Any to Gerber'), '')) self.menueditconvert_any2excellon = self.menuedit_convert.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy_geo.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/join16.png'), _('Join Objects')) + QtGui.QIcon(self.app.resource_location + '/join16.png'), _('Join Objects')) self.menuedit_join2geo = self.menuedit_join.addAction( - QtGui.QIcon(self.menu_resource_location + '/join16.png'), + QtGui.QIcon(self.app.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" @@ -417,13 +403,13 @@ class MainGUI(QtWidgets.QMainWindow): "into a new combo Geometry object.") ) self.menuedit_join_exc2exc = self.menuedit_join.addAction( - QtGui.QIcon(self.menu_resource_location + '/join16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/join16.png'), + QtGui.QIcon(self.app.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.") @@ -434,50 +420,50 @@ class MainGUI(QtWidgets.QMainWindow): # Separator self.menuedit.addSeparator() self.menueditcopyobject = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy.png'), + QtGui.QIcon(self.app.resource_location + '/copy.png'), '%s\t%s' % (_('Copy'), _('Ctrl+C'))) # Separator self.menuedit.addSeparator() self.menueditdelete = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/trash16.png'), + QtGui.QIcon(self.app.resource_location + '/trash16.png'), '%s\t%s' % (_('Delete'), _('DEL'))) # Separator self.menuedit.addSeparator() self.menuedit_numeric_move = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/move32_bis.png'), + QtGui.QIcon(self.app.resource_location + '/move32_bis.png'), '%s\t%s' % (_('Num Move'), '')) self.menueditorigin = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/origin16.png'), + QtGui.QIcon(self.app.resource_location + '/origin16.png'), '%s\t%s' % (_('Set Origin'), _('O'))) self.menuedit_move2origin = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/origin2_16.png'), + QtGui.QIcon(self.app.resource_location + '/origin2_16.png'), '%s\t%s' % (_('Move to Origin'), _('Shift+O'))) self.menuedit_center_in_origin = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/origin3_32.png'), + QtGui.QIcon(self.app.resource_location + '/origin3_32.png'), '%s\t%s' % (_('Custom Origin'), '')) self.menueditjump = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/jump_to16.png'), + QtGui.QIcon(self.app.resource_location + '/jump_to16.png'), '%s\t%s' % (_('Jump to Location'), _('J'))) self.menueditlocate = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/locate16.png'), + QtGui.QIcon(self.app.resource_location + '/locate16.png'), '%s\t%s' % (_('Locate in Object'), _('Shift+J'))) # Separator self.menuedit.addSeparator() self.menuedittoggleunits = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/toggle_units16.png'), + QtGui.QIcon(self.app.resource_location + '/toggle_units16.png'), '%s\t%s' % (_('Toggle Units'), _('Q'))) self.menueditselectall = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/select_all.png'), + QtGui.QIcon(self.app.resource_location + '/select_all.png'), '%s\t%s' % (_('Select All'), _('Ctrl+A'))) # Separator self.menuedit.addSeparator() self.menueditpreferences = self.menuedit.addAction( - QtGui.QIcon(self.menu_resource_location + '/pref.png'), + QtGui.QIcon(self.app.resource_location + '/pref.png'), '%s\t%s' % (_('Preferences'), _('Shift+P'))) # ############################################################################################################# @@ -486,44 +472,44 @@ class MainGUI(QtWidgets.QMainWindow): self.menuoptions = self.menu.addMenu(_('Options')) self.menuoptions_transform_rotate = self.menuoptions.addAction( - QtGui.QIcon(self.menu_resource_location + '/rotate.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/skewX.png'), + QtGui.QIcon(self.app.resource_location + '/skewX.png'), '%s\t%s' % (_("Skew on X axis"), _('Shift+X'))) self.menuoptions_transform_skewy = self.menuoptions.addAction( - QtGui.QIcon(self.menu_resource_location + '/skewY.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/flipx.png'), + QtGui.QIcon(self.app.resource_location + '/flipx.png'), '%s\t%s' % (_("Flip on X axis"), _('X'))) self.menuoptions_transform_flipy = self.menuoptions.addAction( - QtGui.QIcon(self.menu_resource_location + '/flipy.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/source32.png'), + QtGui.QIcon(self.app.resource_location + '/source32.png'), '%s\t%s' % (_("View source"), _('Alt+S'))) self.menuoptions_tools_db = self.menuoptions.addAction( - QtGui.QIcon(self.menu_resource_location + '/database32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/experiment32.png'), _('Experimental')) + QtGui.QIcon(self.app.resource_location + '/experiment32.png'), _('Experimental')) self.menuoptions_experimental_3D_area = self.menuoptions_experimental.addAction( - QtGui.QIcon(self.menu_resource_location + '/3D_area32.png'), + QtGui.QIcon(self.app.resource_location + '/3D_area32.png'), '%s\t%s' % (_('3D Area'), '')) # Separator self.menuoptions.addSeparator() @@ -533,71 +519,71 @@ class MainGUI(QtWidgets.QMainWindow): # ############################################################################################################# self.menuview = self.menu.addMenu(_('View')) self.menuviewenable = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/replot16.png'), + QtGui.QIcon(self.app.resource_location + '/replot16.png'), '%s\t%s' % (_('Enable all'), _('Alt+1'))) self.menuviewdisableall = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/clear_plot16.png'), + QtGui.QIcon(self.app.resource_location + '/clear_plot16.png'), '%s\t%s' % (_('Disable all'), _('Alt+2'))) self.menuviewenableother = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/replot16.png'), + QtGui.QIcon(self.app.resource_location + '/replot16.png'), '%s\t%s' % (_('Enable non-selected'), _('Alt+3'))) self.menuviewdisableother = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/clear_plot16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/zoom_fit32.png'), + QtGui.QIcon(self.app.resource_location + '/zoom_fit32.png'), '%s\t%s' % (_("Zoom Fit"), _('V'))) self.menuview_zoom_in = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/zoom_in32.png'), + QtGui.QIcon(self.app.resource_location + '/zoom_in32.png'), '%s\t%s' % (_("Zoom In"), _('='))) self.menuview_zoom_out = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/zoom_out32.png'), + QtGui.QIcon(self.app.resource_location + '/zoom_out32.png'), '%s\t%s' % (_("Zoom Out"), _('-'))) self.menuview.addSeparator() # Replot all self.menuview_replot = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/replot32.png'), + QtGui.QIcon(self.app.resource_location + '/replot32.png'), '%s\t%s' % (_("Redraw All"), _('F5'))) self.menuview.addSeparator() self.menuview_toggle_code_editor = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/code_editor32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/fscreen32.png'), + QtGui.QIcon(self.app.resource_location + '/fscreen32.png'), '%s\t%s' % (_("Toggle FullScreen"), _('Alt+F10'))) self.menuview_toggle_parea = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/plot32.png'), + QtGui.QIcon(self.app.resource_location + '/plot32.png'), '%s\t%s' % (_("Toggle Plot Area"), _('Ctrl+F10'))) self.menuview_toggle_notebook = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/notebook32.png'), + QtGui.QIcon(self.app.resource_location + '/notebook32.png'), '%s\t%s' % (_("Toggle Project/Properties/Tool"), _('`'))) self.menuview.addSeparator() self.menuview_toggle_grid = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/grid32.png'), + QtGui.QIcon(self.app.resource_location + '/grid32.png'), '%s\t%s' % (_("Toggle Grid Snap"), _('G'))) self.menuview_toggle_grid_lines = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/grid_lines32.png'), + QtGui.QIcon(self.app.resource_location + '/grid_lines32.png'), '%s\t%s' % (_("Toggle Grid Lines"), _('Shift+G'))) self.menuview_toggle_axis = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/axis32.png'), + QtGui.QIcon(self.app.resource_location + '/axis32.png'), '%s\t%s' % (_("Toggle Axis"), _('Shift+A'))) self.menuview_toggle_workspace = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/workspace24.png'), + QtGui.QIcon(self.app.resource_location + '/workspace24.png'), '%s\t%s' % (_("Toggle Workspace"), _('Shift+W'))) self.menuview_toggle_hud = self.menuview.addAction( - QtGui.QIcon(self.menu_resource_location + '/hud_32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/log32.png'), + QtGui.QIcon(self.app.resource_location + '/log32.png'), '%s\t%s' % (_("Error Log"), '')) # ######################################################################## @@ -606,10 +592,10 @@ class MainGUI(QtWidgets.QMainWindow): self.menuobjects = self.menu.addMenu(_('Objects')) self.menuobjects.addSeparator() self.menuobjects_selall = self.menuobjects.addAction( - QtGui.QIcon(self.menu_resource_location + '/select_all.png'), + QtGui.QIcon(self.app.resource_location + '/select_all.png'), '%s\t%s' % (_('Select All'), '')) self.menuobjects_unselall = self.menuobjects.addAction( - QtGui.QIcon(self.menu_resource_location + '/deselect_all32.png'), + QtGui.QIcon(self.app.resource_location + '/deselect_all32.png'), '%s\t%s' % (_('Deselect All'), '')) # ######################################################################## @@ -618,7 +604,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.menu_resource_location + '/shell16.png'), + QtGui.QIcon(self.app.resource_location + '/shell16.png'), '%s\t%s' % (_('Command Line'), _('S'))) # ######################################################################## @@ -626,49 +612,49 @@ class MainGUI(QtWidgets.QMainWindow): # ######################################################################## self.menuhelp = self.menu.addMenu(_('Help')) self.menuhelp_manual = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/globe16.png'), + QtGui.QIcon(self.app.resource_location + '/globe16.png'), '%s\t%s' % (_('Online Help'), _('F1'))) self.menuhelp_bookmarks = self.menuhelp.addMenu( - QtGui.QIcon(self.menu_resource_location + '/bookmarks16.png'), _('Bookmarks')) + QtGui.QIcon(self.app.resource_location + '/bookmarks16.png'), _('Bookmarks')) self.menuhelp_bookmarks.addSeparator() self.menuhelp_bookmarks_manager = self.menuhelp_bookmarks.addAction( - QtGui.QIcon(self.menu_resource_location + '/bookmarks16.png'), + QtGui.QIcon(self.app.resource_location + '/bookmarks16.png'), '%s\t%s' % (_('Bookmarks Manager'), '')) self.menuhelp.addSeparator() self.menuhelp_report_bug = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/bug16.png'), + QtGui.QIcon(self.app.resource_location + '/bug16.png'), '%s\t%s' % (_('Report a bug'), '')) self.menuhelp.addSeparator() self.menuhelp_exc_spec = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/pdf_link16.png'), + QtGui.QIcon(self.app.resource_location + '/pdf_link16.png'), '%s\t%s' % (_('Excellon Specification'), '')) self.menuhelp_gerber_spec = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/pdf_link16.png'), + QtGui.QIcon(self.app.resource_location + '/pdf_link16.png'), '%s\t%s' % (_('Gerber Specification'), '')) self.menuhelp.addSeparator() self.menuhelp_shortcut_list = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/shortcuts24.png'), + QtGui.QIcon(self.app.resource_location + '/shortcuts24.png'), '%s\t%s' % (_('Shortcuts List'), _('F3'))) self.menuhelp_videohelp = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/youtube32.png'), + QtGui.QIcon(self.app.resource_location + '/youtube32.png'), '%s\t%s' % (_('YouTube Channel'), _('F4'))) self.menuhelp.addSeparator() self.menuhelp_donate = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/paypal32.png'), + QtGui.QIcon(self.app.resource_location + '/paypal32.png'), '%s\t%s' % (_('Donate'), '')) self.menuhelp_readme = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/warning.png'), + QtGui.QIcon(self.app.resource_location + '/warning.png'), '%s\t%s' % (_("How To"), '')) self.menuhelp_about = self.menuhelp.addAction( - QtGui.QIcon(self.menu_resource_location + '/about32.png'), + QtGui.QIcon(self.app.resource_location + '/about32.png'), '%s\t%s' % (_('About'), '')) # ######################################################################## @@ -678,79 +664,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.menu_resource_location + '/circle32.png'), + QtGui.QIcon(self.app.resource_location + '/circle32.png'), '%s\t%s' % (_('Add Circle'), _('O')) ) self.geo_add_arc_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/arc16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/rectangle32.png'), + QtGui.QIcon(self.app.resource_location + '/rectangle32.png'), '%s\t%s' % (_('Add Rectangle'), _('R')) ) self.geo_add_polygon_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/polygon32.png'), + QtGui.QIcon(self.app.resource_location + '/polygon32.png'), '%s\t%s' % (_('Add Polygon'), _('N')) ) self.geo_add_path_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/path32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/text32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/union16.png'), + QtGui.QIcon(self.app.resource_location + '/union16.png'), '%s\t%s' % (_('Polygon Union'), _('U'))) self.geo_intersection_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/intersection16.png'), + QtGui.QIcon(self.app.resource_location + '/intersection16.png'), '%s\t%s' % (_('Polygon Intersection'), _('E'))) self.geo_subtract_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/subtract16.png'), + QtGui.QIcon(self.app.resource_location + '/subtract16.png'), '%s\t%s' % (_('Polygon Subtraction'), _('S')) ) self.geo_subtract_alt_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/subtract16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/cutpath16.png'), + QtGui.QIcon(self.app.resource_location + '/cutpath16.png'), '%s\t%s' % (_('Cut Path'), _('X'))) # self.move_menuitem = self.menu.addAction( - # QtGui.QIcon(self.menu_resource_location + '/move16.png'), "Move Objects 'm'") + # QtGui.QIcon(self.app.resource_location + '/move16.png'), "Move Objects 'm'") self.geo_copy_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy16.png'), + QtGui.QIcon(self.app.resource_location + '/copy16.png'), '%s\t%s' % (_("Copy Geom"), _('C'))) self.geo_delete_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/deleteshape16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/move32.png'), + QtGui.QIcon(self.app.resource_location + '/move32.png'), '%s\t%s' % (_("Move"), _('M'))) self.geo_buffer_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/buffer16.png'), + QtGui.QIcon(self.app.resource_location + '/buffer16.png'), '%s\t%s' % (_("Buffer"), _('B')) ) self.geo_simplification_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/simplify32.png'), + QtGui.QIcon(self.app.resource_location + '/simplify32.png'), '%s\t%s' % (_("Simplification"), '') ) self.geo_paint_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/paint20_1.png'), + QtGui.QIcon(self.app.resource_location + '/paint20_1.png'), '%s\t%s' % (_("Paint"), _('I')) ) self.geo_transform_menuitem = self.geo_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/transform.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/corner32.png'), + QtGui.QIcon(self.app.resource_location + '/corner32.png'), '%s\t%s' % (_("Toggle Corner Snap"), _('K')) ) @@ -761,36 +747,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.menu_resource_location + '/rectangle32.png'), + QtGui.QIcon(self.app.resource_location + '/rectangle32.png'), '%s\t%s' % (_('Add Drill Array'), _('A'))) self.exc_add_drill_menuitem = self.exc_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/plus16.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/slot_array26.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/slot26.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/resize16.png'), + QtGui.QIcon(self.app.resource_location + '/resize16.png'), '%s\t%s' % (_('Resize Drill(S)'), _('R')) ) self.exc_copy_drill_menuitem = self.exc_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy32.png'), + QtGui.QIcon(self.app.resource_location + '/copy32.png'), '%s\t%s' % (_('Copy'), _('C'))) self.exc_delete_drill_menuitem = self.exc_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/deleteshape32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/move32.png'), + QtGui.QIcon(self.app.resource_location + '/move32.png'), '%s\t%s' % (_('Move Drill'), _('M'))) # ######################################################################## @@ -800,55 +786,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.menu_resource_location + '/aperture16.png'), + QtGui.QIcon(self.app.resource_location + '/aperture16.png'), '%s\t%s' % (_('Add Pad'), _('P'))) self.grb_add_pad_array_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/padarray32.png'), + QtGui.QIcon(self.app.resource_location + '/padarray32.png'), '%s\t%s' % (_('Add Pad Array'), _('A'))) self.grb_add_track_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/track32.png'), + QtGui.QIcon(self.app.resource_location + '/track32.png'), '%s\t%s' % (_('Add Track'), _('T'))) self.grb_add_region_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/rectangle32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/poligonize32.png'), + QtGui.QIcon(self.app.resource_location + '/poligonize32.png'), '%s\t%s' % (_("Poligonize"), _('Alt+N'))) self.grb_add_semidisc_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/semidisc32.png'), + QtGui.QIcon(self.app.resource_location + '/semidisc32.png'), '%s\t%s' % (_("Add SemiDisc"), _('E'))) self.grb_add_disc_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/disc32.png'), + QtGui.QIcon(self.app.resource_location + '/disc32.png'), '%s\t%s' % (_("Add Disc"), _('D'))) self.grb_add_buffer_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/buffer16-2.png'), + QtGui.QIcon(self.app.resource_location + '/buffer16-2.png'), '%s\t%s' % (_('Buffer'), _('B'))) self.grb_add_scale_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/scale32.png'), + QtGui.QIcon(self.app.resource_location + '/scale32.png'), '%s\t%s' % (_('Scale'), _('S'))) self.grb_add_markarea_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/markarea32.png'), + QtGui.QIcon(self.app.resource_location + '/markarea32.png'), '%s\t%s' % (_('Mark Area'), _('Alt+A'))) self.grb_add_eraser_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/eraser26.png'), + QtGui.QIcon(self.app.resource_location + '/eraser26.png'), '%s\t%s' % (_('Eraser'), _('Ctrl+E'))) self.grb_transform_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/transform.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/copy32.png'), + QtGui.QIcon(self.app.resource_location + '/copy32.png'), '%s\t%s' % (_('Copy'), _('C'))) self.grb_delete_menuitem = self.grb_editor_menu.addAction( - QtGui.QIcon(self.menu_resource_location + '/deleteshape32.png'), + QtGui.QIcon(self.app.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.menu_resource_location + '/move32.png'), + QtGui.QIcon(self.app.resource_location + '/move32.png'), '%s\t%s' % (_('Move'), _('M'))) self.grb_editor_menu.menuAction().setVisible(False) @@ -866,71 +852,71 @@ class MainGUI(QtWidgets.QMainWindow): self.menuproject = QtWidgets.QMenu() self.menuprojectenable = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/replot32.png'), _('Enable Plot')) + QtGui.QIcon(self.app.resource_location + '/replot32.png'), _('Enable Plot')) self.menuprojectdisable = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/clear_plot32.png'), _('Disable Plot')) + QtGui.QIcon(self.app.resource_location + '/clear_plot32.png'), _('Disable Plot')) self.menuproject.addSeparator() self.menuprojectcolor = self.menuproject.addMenu( - QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Set Color')) + QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Set Color')) self.menuproject_red = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/red32.png'), _('Red')) + QtGui.QIcon(self.app.resource_location + '/red32.png'), _('Red')) self.menuproject_blue = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/blue32.png'), _('Blue')) + QtGui.QIcon(self.app.resource_location + '/blue32.png'), _('Blue')) self.menuproject_yellow = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/yellow32.png'), _('Yellow')) + QtGui.QIcon(self.app.resource_location + '/yellow32.png'), _('Yellow')) self.menuproject_green = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/green32.png'), _('Green')) + QtGui.QIcon(self.app.resource_location + '/green32.png'), _('Green')) self.menuproject_purple = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/violet32.png'), _('Purple')) + QtGui.QIcon(self.app.resource_location + '/violet32.png'), _('Purple')) self.menuproject_brown = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/brown32.png'), _('Brown')) + QtGui.QIcon(self.app.resource_location + '/brown32.png'), _('Brown')) self.menuproject_brown = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/indigo32.png'), _('Indigo')) + QtGui.QIcon(self.app.resource_location + '/indigo32.png'), _('Indigo')) self.menuproject_brown = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/white32.png'), _('White')) + QtGui.QIcon(self.app.resource_location + '/white32.png'), _('White')) self.menuproject_brown = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/black32.png'), _('Black')) + QtGui.QIcon(self.app.resource_location + '/black32.png'), _('Black')) self.menuprojectcolor.addSeparator() self.menuproject_custom = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Custom')) + QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Custom')) self.menuprojectcolor.addSeparator() self.menuproject_custom = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Opacity')) + QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Opacity')) self.menuproject_custom = self.menuprojectcolor.addAction( - QtGui.QIcon(self.menu_resource_location + '/set_color32.png'), _('Default')) + QtGui.QIcon(self.app.resource_location + '/set_color32.png'), _('Default')) self.menuproject.addSeparator() self.menuprojectviewsource = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/source32.png'), _('View Source')) + QtGui.QIcon(self.app.resource_location + '/source32.png'), _('View Source')) self.menuprojectedit = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/edit_ok32.png'), _('Edit')) + QtGui.QIcon(self.app.resource_location + '/edit_ok32.png'), _('Edit')) self.menuprojectcopy = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/copy32.png'), _('Copy')) + QtGui.QIcon(self.app.resource_location + '/copy32.png'), _('Copy')) self.menuprojectdelete = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/delete32.png'), _('Delete')) + QtGui.QIcon(self.app.resource_location + '/delete32.png'), _('Delete')) self.menuprojectsave = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/save_as.png'), _('Save')) + QtGui.QIcon(self.app.resource_location + '/save_as.png'), _('Save')) self.menuproject.addSeparator() self.menuprojectproperties = self.menuproject.addAction( - QtGui.QIcon(self.menu_resource_location + '/properties32.png'), _('Properties')) + QtGui.QIcon(self.app.resource_location + '/properties32.png'), _('Properties')) # ######################################################################## # ####################### Central Widget -> Splitter # ################## diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index 937f2f71..a7b757eb 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -197,7 +197,7 @@ class GerberObjectUI(ObjectUI): plot_grid.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) gen_frame.setLayout(plot_grid) - self.plot_options_label = FCLabel("%s:" % _("Plot Options")) + self.plot_options_label = FCLabel('%s:' % _("Plot Options"), bold=True) plot_grid.addWidget(self.plot_options_label, 0, 0) @@ -219,7 +219,7 @@ class GerberObjectUI(ObjectUI): self.name_hlay = QtWidgets.QHBoxLayout() plot_grid.addLayout(self.name_hlay, 1, 0, 1, 3) - name_label = FCLabel("%s:" % _("Name")) + name_label = FCLabel('%s:' % _("Name"), bold=True) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) self.name_hlay.addWidget(name_label) @@ -482,7 +482,7 @@ class GerberObjectUI(ObjectUI): # Non-Copper Regions Frame # ############################################################################################################# # ## Non-copper regions - self.noncopper_label = FCLabel("%s" % _("Non-copper regions")) + self.noncopper_label = FCLabel('%s' % _("Non-copper regions"), bold=True) self.noncopper_label.setToolTip( _("Create polygons covering the\n" "areas without copper on the PCB.\n" @@ -530,7 +530,7 @@ class GerberObjectUI(ObjectUI): # Bounding Box Frame # ############################################################################################################# # ## Bounding box - self.boundingbox_label = FCLabel('%s' % _('Bounding Box')) + self.boundingbox_label = FCLabel('%s' % _('Bounding Box'), bold=True) self.boundingbox_label.setToolTip( _("Create a geometry surrounding the Gerber object.\n" "Square shape.") @@ -617,7 +617,7 @@ class ExcellonObjectUI(ObjectUI): gen_frame.setLayout(plot_grid) # Plot options - self.plot_options_label = FCLabel("%s: " % _("Plot Options")) + self.plot_options_label = FCLabel('%s: ' % _("Plot Options"), bold=True) # Solid CB self.solid_cb = FCCheckBox(label=_('Solid')) @@ -638,7 +638,7 @@ class ExcellonObjectUI(ObjectUI): # ## Object name self.name_hlay = QtWidgets.QHBoxLayout() - name_label = FCLabel("%s: " % _("Name")) + name_label = FCLabel('%s: ' % _("Name"), bold=True) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) self.name_hlay.addWidget(name_label) @@ -844,7 +844,7 @@ class ExcellonObjectUI(ObjectUI): # ############################################################################################################# # Milling Drill Holes Frame # ############################################################################################################# - self.mill_hole_label = FCLabel('%s' % _('Milling Geometry')) + self.mill_hole_label = FCLabel('%s' % _('Milling Geometry'), bold=True) self.mill_hole_label.setToolTip( _("Create Geometry for milling holes.\n" "Select from the Tools Table above the hole dias to be\n" @@ -953,7 +953,7 @@ class GeometryObjectUI(ObjectUI): plot_grid.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) gen_frame.setLayout(plot_grid) - self.plot_options_label = FCLabel("%s:" % _("Plot Options")) + self.plot_options_label = FCLabel('%s:' % _("Plot Options"), bold=True) self.plot_options_label.setMinimumWidth(90) plot_grid.addWidget(self.plot_options_label, 0, 0) @@ -970,7 +970,7 @@ class GeometryObjectUI(ObjectUI): self.name_hlay = QtWidgets.QHBoxLayout() plot_grid.addLayout(self.name_hlay, 2, 0, 1, 3) - name_label = FCLabel("%s:" % _("Name")) + name_label = FCLabel('%s:' % _("Name"), bold=True) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) self.name_hlay.addWidget(name_label) @@ -1033,7 +1033,7 @@ class GeometryObjectUI(ObjectUI): self.tt_frame.setLayout(tt_grid) # ### Tools #### - self.tools_table_label = FCLabel('%s:' % _('Tools Table')) + self.tools_table_label = FCLabel('%s:' % _('Tools Table'), bold=True) self.tools_table_label.setToolTip( _("Tools in this Geometry object used for cutting.\n" "The 'Offset' entry will set an offset for the cut.\n" @@ -1182,7 +1182,7 @@ class GeometryObjectUI(ObjectUI): # Simplification Frame # ############################################################################################################# # Simplification Title - simplif_lbl = FCLabel('%s:' % _("Simplification")) + simplif_lbl = FCLabel('%s' % _("Simplification"), bold=True) simplif_lbl.setToolTip( _("Simplify a geometry by reducing its vertex points number.") ) @@ -1296,7 +1296,7 @@ class CNCObjectUI(ObjectUI): gen_frame.setLayout(grid0) # Plot Options - self.cncplot_method_label = FCLabel("%s: " % _("Plot Options")) + self.cncplot_method_label = FCLabel('%s: ' % _("Plot Options"), bold=True) self.cncplot_method_label.setToolTip( _( "This selects the kind of geometries on the canvas to plot.\n" @@ -1319,7 +1319,7 @@ class CNCObjectUI(ObjectUI): grid0.addLayout(self.name_hlay, 2, 0, 1, 3) # ## Object name - name_label = FCLabel("%s: " % _("Name")) + name_label = FCLabel('%s: ' % _("Name"), bold=True) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) @@ -1387,7 +1387,7 @@ class CNCObjectUI(ObjectUI): grid_par.addWidget(self.estimated_frame, 4, 0, 1, 3) # Travelled Distance - self.t_distance_label = FCLabel("%s:" % _("Travelled distance")) + self.t_distance_label = FCLabel('%s:' % _("Travelled distance"), bold=True) self.t_distance_label.setToolTip( _("This is the total travelled distance on X-Y plane.\n" "In current units.") @@ -1400,7 +1400,7 @@ class CNCObjectUI(ObjectUI): estimated_grid.addWidget(self.units_label, 0, 2) # Estimated Time - self.t_time_label = FCLabel("%s:" % _("Estimated time")) + self.t_time_label = FCLabel('%s:' % _("Estimated time"), bold=True) self.t_time_label.setToolTip( _("This is the estimated time to do the routing/drilling,\n" "without the time spent in ToolChange events.") @@ -1456,7 +1456,7 @@ class CNCObjectUI(ObjectUI): grid1.addLayout(hlay, 0, 0, 1, 2) # CNC Tools Table for plot - self.cnc_tools_table_label = FCLabel('%s' % _('CNC Tools Table')) + self.cnc_tools_table_label = FCLabel('%s' % _('CNC Tools Table'), bold=True) self.cnc_tools_table_label.setToolTip( _( "Tools in this CNCJob object used for cutting.\n" @@ -1602,7 +1602,7 @@ class ScriptObjectUI(ObjectUI): self.name_hlay = QtWidgets.QHBoxLayout() self.custom_box.addLayout(self.name_hlay) - name_label = FCLabel("%s:" % _("Name")) + name_label = FCLabel('%s:' % _("Name"), bold=True) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) self.name_hlay.addWidget(name_label) @@ -1669,7 +1669,7 @@ class DocumentObjectUI(ObjectUI): self.name_hlay = QtWidgets.QHBoxLayout() self.custom_box.addLayout(self.name_hlay) - name_label = FCLabel("%s:" % _("Name")) + name_label = FCLabel('%s:' % _("Name"), bold=True) self.name_entry = FCEntry() self.name_entry.setFocusPolicy(QtCore.Qt.FocusPolicy.StrongFocus) self.name_hlay.addWidget(name_label) diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 3c0f5fdb..c62b2296 100644 --- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -38,7 +38,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): param_frame.setLayout(param_grid) # ### Milling Holes ## ## - self.mill_hole_label = FCLabel('%s' % _('Mill Holes')) + self.mill_hole_label = FCLabel('%s' % _('Mill Holes'), bold=True) self.mill_hole_label.setToolTip( _("Create Geometry for milling holes.") ) diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index 2fed76d5..e9657a12 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -408,7 +408,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # ############################################################################################################# # Parameters Frame # ############################################################################################################# - self.par_label = FCLabel('%s' % (self.app.theme_safe_color('blue'), _('Parameters'))) + self.par_label = FCLabel('%s' % _("Parameters"), color='blue', bold=True) self.layout.addWidget(self.par_label) par_frame = FCFrame() diff --git a/appGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py index ef32a068..a5346b49 100644 --- a/appGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -89,7 +89,7 @@ class GeneralAppPrefGroupUI(OptionsGroupUI): grid1_frame.setLayout(grid1) # Graphic Engine for FlatCAM - self.ge_label = FCLabel('%s:' % _('Graphic Engine')) + self.ge_label = FCLabel('%s:' % _('Graphic Engine'), bold=True) self.ge_label.setToolTip(_("Choose what graphic engine to use in FlatCAM.\n" "Legacy(2D) -> reduced functionality, slow performance but enhanced compatibility.\n" "OpenGL(3D) -> full functionality, high performance\n" diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index 5652f44b..bec7d99e 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -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'), bold=True) self.appearance_label.setToolTip( _("Select a theme for the application.\n" "It will theme the plot area.") @@ -161,7 +161,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): color_frame.setLayout(grid1) # Plot Selection (left - right) Color - self.sel_lr_label = FCLabel('%s' % _('Left-Right Selection Color')) + self.sel_lr_label = FCLabel('%s' % _('Left-Right Selection Color'), bold=True) grid1.addWidget(self.sel_lr_label, 0, 0, 1, 2) self.sl_color_label = FCLabel('%s:' % _('Outline')) @@ -201,7 +201,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid1.addWidget(separator_line, 8, 0, 1, 2) # Plot Selection (left - right) Color - self.sel_rl_label = FCLabel('%s' % _('Right-Left Selection Color')) + self.sel_rl_label = FCLabel('%s' % _('Right-Left Selection Color'), bold=True) grid1.addWidget(self.sel_rl_label, 10, 0, 1, 2) # Plot Selection (right - left) Line Color @@ -246,7 +246,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # ----------------------- Editor Color ----------------------------- # ------------------------------------------------------------------ - self.editor_color_label = FCLabel('%s' % _('Editor Color')) + self.editor_color_label = FCLabel('%s' % _('Editor Color'), bold=True) grid1.addWidget(self.editor_color_label, 20, 0, 1, 2) # Editor Draw Color @@ -278,7 +278,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # ----------------------- Project Settings ----------------------------- # ------------------------------------------------------------------ # Light Theme - self.proj_settings_l_label = FCLabel('%s - %s' % (_('Project Items Color'), _("Light"))) + self.proj_settings_l_label = FCLabel('%s' % _("Light"), bold=True) grid1.addWidget(self.proj_settings_l_label, 28, 0, 1, 2) # Project Tab items color @@ -310,7 +310,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid1.addWidget(separator_line, 33, 0, 1, 2) # Dark Theme - self.proj_settings_d_label = FCLabel('%s - %s' % (_('Project Items Color'), _("Dark"))) + self.proj_settings_d_label = FCLabel('%s' % _("Dark"), bold=True) grid1.addWidget(self.proj_settings_d_label, 34, 0, 1, 2) # Project Tab items color diff --git a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index 4c85b0ea..c274284d 100644 --- a/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py @@ -142,7 +142,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # DOTS Grid Parameters Frame # ############################################################################################################# - self.dots_label = FCLabel('%s:' % _("Dots Grid Parameters")) + self.dots_label = FCLabel('%s' % _("Dots Grid Parameters"), bold=True) self.layout.addWidget(self.dots_label) dots_frame = FCFrame() @@ -181,7 +181,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Squares Grid Parameters Frame # ############################################################################################################# - self.squares_label = FCLabel('%s:' % _("Squares Grid Parameters")) + self.squares_label = FCLabel('%s' % _("Squares Grid Parameters"), bold=True) self.layout.addWidget(self.squares_label) square_frame = FCFrame() @@ -220,7 +220,7 @@ class Tools2CThievingPrefGroupUI(OptionsGroupUI): # ############################################################################################################# # Lines Grid Parameters Frame # ############################################################################################################# - self.lines_label = FCLabel('%s:' % _("Lines Grid Parameters")) + self.lines_label = FCLabel('%s' % _("Lines Grid Parameters"), bold=True) self.layout.addWidget(self.lines_label) line_frame = FCFrame() diff --git a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py index c0fdd5a4..0a041e38 100644 --- a/appGUI/preferences/tools/ToolsISOPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py @@ -39,7 +39,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI): par_frame.setLayout(par_grid) # Tool Dias - isotdlabel = FCLabel('%s:' % _('Tools Dia')) + isotdlabel = FCLabel('%s:' % _('Tools Dia'), color='green', bold=True) isotdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" diff --git a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py index 65cd74ea..00793fb0 100644 --- a/appGUI/preferences/tools/ToolsMillPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsMillPrefGroupUI.py @@ -38,7 +38,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI): param_frame.setLayout(param_grid) # Tooldia - tdlabel = FCLabel('%s:' % _('Tools Dia')) + tdlabel = FCLabel('%s:' % _('Tools Dia'), color='green', bold=True) tdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" diff --git a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py index b2dddf3f..c547ebb5 100644 --- a/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py @@ -40,7 +40,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI): par_frame.setLayout(par_grid) # Tools Diameters - ncctdlabel = FCLabel('%s:' % _('Tools Dia')) + ncctdlabel = FCLabel('%s:' % _('Tools Dia'), color='green', bold=True) ncctdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" diff --git a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index 85cbfc0a..789de600 100644 --- a/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -42,7 +42,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI): par_frame.setLayout(param_grid) # Tool dia - ptdlabel = FCLabel('%s:' % _('Tools Dia')) + ptdlabel = FCLabel('%s:' % _('Tools Dia'), color='green', bold=True) ptdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index 0349b352..d4a83813 100644 --- a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py @@ -39,7 +39,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): param_frame.setLayout(param_grid) # Nozzle Tool Diameters - nozzletdlabel = FCLabel('%s:' % _('Tools Dia')) + nozzletdlabel = FCLabel('%s:' % _('Tools Dia'), color='green', bold=True) nozzletdlabel.setToolTip( _("Diameters of the tools, separated by comma.\n" "The value of the diameter has to use the dot decimals separator.\n" @@ -51,7 +51,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): param_grid.addWidget(self.nozzle_tool_dia_entry, 0, 1) # New Nozzle Tool Dia - self.addtool_entry_lbl = FCLabel('%s:' % _('New Nozzle Dia')) + self.addtool_entry_lbl = FCLabel('%s:' % _('New Nozzle Dia'), bold=True) self.addtool_entry_lbl.setToolTip( _("Diameter for the new tool to add in the Tool Table") ) diff --git a/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py index ee8f2e88..93139239 100644 --- a/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py +++ b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py @@ -33,7 +33,7 @@ class AutoCompletePrefGroupUI(OptionsGroupUI): hlay0.addWidget(self.del_all_btn) # ## Gerber associations - self.grb_list_label = FCLabel("%s:" % _("Keywords list")) + self.grb_list_label = FCLabel('%s:' % _("Keywords list"), bold=True) self.grb_list_label.setToolTip( _("List of keywords used by\n" "the autocompleter in FlatCAM.\n" diff --git a/appGUI/preferences/utilities/FAExcPrefGroupUI.py b/appGUI/preferences/utilities/FAExcPrefGroupUI.py index 8e3c1c8e..68a6a5f7 100644 --- a/appGUI/preferences/utilities/FAExcPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAExcPrefGroupUI.py @@ -43,7 +43,7 @@ class FAExcPrefGroupUI(OptionsGroupUI): self.vertical_lay.addLayout(hlay0) # # ## Excellon associations - list_label = FCLabel("%s:" % _("Extensions list")) + list_label = FCLabel('%s:' % _("Extensions list"), bold=True) list_label.setToolTip( _("List of file extensions to be\n" "associated with FlatCAM.") diff --git a/appGUI/preferences/utilities/FAGcoPrefGroupUI.py b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py index 84697c77..9df84f31 100644 --- a/appGUI/preferences/utilities/FAGcoPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py @@ -34,7 +34,7 @@ class FAGcoPrefGroupUI(OptionsGroupUI): hlay0.addWidget(self.del_all_btn) # ## G-Code associations - self.gco_list_label = FCLabel("%s:" % _("Extensions list")) + self.gco_list_label = FCLabel('%s:' % _("Extensions list"), bold=True) self.gco_list_label.setToolTip( _("List of file extensions to be\n" "associated with FlatCAM.") diff --git a/appGUI/preferences/utilities/FAGrbPrefGroupUI.py b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py index fe1dbf53..dcec8eca 100644 --- a/appGUI/preferences/utilities/FAGrbPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py @@ -33,7 +33,7 @@ class FAGrbPrefGroupUI(OptionsGroupUI): hlay0.addWidget(self.del_all_btn) # ## Gerber associations - self.grb_list_label = FCLabel("%s:" % _("Extensions list")) + self.grb_list_label = FCLabel('%s:' % _("Extensions list"), bold=True) self.grb_list_label.setToolTip( _("List of file extensions to be\n" "associated with FlatCAM.") diff --git a/appMain.py b/appMain.py index b44f8a25..8632f289 100644 --- a/appMain.py +++ b/appMain.py @@ -268,24 +268,6 @@ 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. @@ -1911,146 +1893,132 @@ 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(menu_resource_location + '/distance16.png'), pos=self.ui.menuedit, + self.distance_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/distance_min16.png'), + self.distance_min_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/doubleside16.png'), separator=False) + self.dblsidedtool.install(icon=QtGui.QIcon(self.resource_location + '/doubleside16.png'), separator=False) self.cal_exc_tool = ToolCalibration(self) - self.cal_exc_tool.install(icon=QtGui.QIcon(menu_resource_location + '/calibrate_16.png'), + self.cal_exc_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/align16.png'), separator=False) + self.align_objects_tool.install(icon=QtGui.QIcon(self.resource_location + '/align16.png'), separator=False) self.extract_tool = ToolExtract(self) - self.extract_tool.install(icon=QtGui.QIcon(menu_resource_location + '/extract32.png'), separator=True) + self.extract_tool.install(icon=QtGui.QIcon(self.resource_location + '/extract32.png'), separator=True) self.panelize_tool = Panelize(self) - self.panelize_tool.install(icon=QtGui.QIcon(menu_resource_location + '/panelize16.png')) + self.panelize_tool.install(icon=QtGui.QIcon(self.resource_location + '/panelize16.png')) self.film_tool = Film(self) - self.film_tool.install(icon=QtGui.QIcon(menu_resource_location + '/film32.png')) + self.film_tool.install(icon=QtGui.QIcon(self.resource_location + '/film32.png')) self.paste_tool = SolderPaste(self) - self.paste_tool.install(icon=QtGui.QIcon(menu_resource_location + '/solderpastebis32.png')) + self.paste_tool.install(icon=QtGui.QIcon(self.resource_location + '/solderpastebis32.png')) self.calculator_tool = ToolCalculator(self) - self.calculator_tool.install(icon=QtGui.QIcon(menu_resource_location + '/calculator16.png'), separator=True) + self.calculator_tool.install(icon=QtGui.QIcon(self.resource_location + '/calculator16.png'), separator=True) self.sub_tool = ToolSub(self) - self.sub_tool.install(icon=QtGui.QIcon(menu_resource_location + '/sub32.png'), + self.sub_tool.install(icon=QtGui.QIcon(self.resource_location + '/sub32.png'), pos=self.ui.menu_plugins, separator=True) self.rules_tool = RulesCheck(self) - self.rules_tool.install(icon=QtGui.QIcon(menu_resource_location + '/rules32.png'), + self.rules_tool.install(icon=QtGui.QIcon(self.resource_location + '/rules32.png'), pos=self.ui.menu_plugins, separator=False) self.optimal_tool = ToolOptimal(self) - self.optimal_tool.install(icon=QtGui.QIcon(menu_resource_location + '/open_excellon32.png'), + self.optimal_tool.install(icon=QtGui.QIcon(self.resource_location + '/open_excellon32.png'), pos=self.ui.menu_plugins, separator=True) self.move_tool = ToolMove(self) - self.move_tool.install(icon=QtGui.QIcon(menu_resource_location + '/move16.png'), pos=self.ui.menuedit, + self.move_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/cut32.png'), pos=self.ui.menu_plugins, + self.cutout_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/ncc32.png'), pos=self.ui.menu_plugins, + self.ncclear_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/paint20_1.png'), pos=self.ui.menu_plugins, + self.paint_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/iso_16.png'), pos=self.ui.menu_plugins, + self.isolation_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/follow32.png'), pos=self.ui.menu_plugins, + self.follow_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/extract_drill32.png'), + self.drilling_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/milling_tool32.png'), + self.milling_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/level32.png'), + self.levelling_tool.install(icon=QtGui.QIcon(self.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(menu_resource_location + '/copperfill32.png'), + self.copper_thieving_tool.install(icon=QtGui.QIcon(self.resource_location + '/copperfill32.png'), pos=self.ui.menu_plugins) self.fiducial_tool = ToolFiducials(self) - self.fiducial_tool.install(icon=QtGui.QIcon(menu_resource_location + '/fiducials_32.png'), + self.fiducial_tool.install(icon=QtGui.QIcon(self.resource_location + '/fiducials_32.png'), pos=self.ui.menu_plugins) self.qrcode_tool = QRCode(self) - self.qrcode_tool.install(icon=QtGui.QIcon(menu_resource_location + '/qrcode32.png'), + self.qrcode_tool.install(icon=QtGui.QIcon(self.resource_location + '/qrcode32.png'), pos=self.ui.menu_plugins) self.punch_tool = ToolPunchGerber(self) - self.punch_tool.install(icon=QtGui.QIcon(menu_resource_location + '/punch32.png'), pos=self.ui.menu_plugins) + self.punch_tool.install(icon=QtGui.QIcon(self.resource_location + '/punch32.png'), pos=self.ui.menu_plugins) self.invert_tool = ToolInvertGerber(self) - self.invert_tool.install(icon=QtGui.QIcon(menu_resource_location + '/invert32.png'), pos=self.ui.menu_plugins) + self.invert_tool.install(icon=QtGui.QIcon(self.resource_location + '/invert32.png'), pos=self.ui.menu_plugins) self.markers_tool = ToolMarkers(self) - self.markers_tool.install(icon=QtGui.QIcon(menu_resource_location + '/corners_32.png'), + self.markers_tool.install(icon=QtGui.QIcon(self.resource_location + '/corners_32.png'), pos=self.ui.menu_plugins) self.etch_tool = ToolEtchCompensation(self) - self.etch_tool.install(icon=QtGui.QIcon(menu_resource_location + '/etch_32.png'), pos=self.ui.menu_plugins) + self.etch_tool.install(icon=QtGui.QIcon(self.resource_location + '/etch_32.png'), pos=self.ui.menu_plugins) self.transform_tool = ToolTransform(self) - self.transform_tool.install(icon=QtGui.QIcon(menu_resource_location + '/transform.png'), + self.transform_tool.install(icon=QtGui.QIcon(self.resource_location + '/transform.png'), pos=self.ui.menuoptions, separator=True) self.report_tool = ObjectReport(self) - self.report_tool.install(icon=QtGui.QIcon(menu_resource_location + '/properties32.png'), + self.report_tool.install(icon=QtGui.QIcon(self.resource_location + '/properties32.png'), pos=self.ui.menuoptions) self.pdf_tool = ToolPDF(self) - self.pdf_tool.install(icon=QtGui.QIcon(menu_resource_location + '/pdf32.png'), + self.pdf_tool.install(icon=QtGui.QIcon(self.resource_location + '/pdf32.png'), pos=self.ui.menufileimport, separator=True) try: self.image_tool = ToolImage(self) - self.image_tool.install(icon=QtGui.QIcon(menu_resource_location + '/image32.png'), + self.image_tool.install(icon=QtGui.QIcon(self.resource_location + '/image32.png'), pos=self.ui.menufileimport, separator=True) except Exception as im_err: @@ -2058,7 +2026,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(menu_resource_location + '/drill32.png'), + self.pcb_wizard_tool.install(icon=QtGui.QIcon(self.resource_location + '/drill32.png'), pos=self.ui.menufileimport) # create a list of plugins references @@ -9472,23 +9440,7 @@ 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/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index c8f1bfdb..d8e95ace 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -503,7 +503,7 @@ class AlignUI: par_frame.setLayout(grid2) # Alignment Type - self.a_type_lbl = FCLabel('%s:' % _("Alignment Type")) + self.a_type_lbl = FCLabel('%s:' % _("Alignment Type"), bold=True) self.a_type_lbl.setToolTip( _("The type of alignment can be:\n" "- Single Point -> it require a single point of sync, the action will be a translation\n" diff --git a/appPlugins/ToolCalibration.py b/appPlugins/ToolCalibration.py index a265562d..a897b58d 100644 --- a/appPlugins/ToolCalibration.py +++ b/appPlugins/ToolCalibration.py @@ -767,7 +767,7 @@ class CalibrationUI: grid_lay = GLay(v_spacing=5, h_spacing=3, c_stretch=[0, 1, 0]) self.layout.addLayout(grid_lay) - self.gcode_title_label = FCLabel('%s:' % _('Parameters')) + self.gcode_title_label = FCLabel('%s:' % _('Parameters'), bold=True) self.gcode_title_label.setToolTip( _("Parameters used when creating the GCode in this tool.") ) @@ -873,7 +873,7 @@ class CalibrationUI: grid_lay.addWidget(FCLabel(''), 9, 0, 1, 3) - step_1 = FCLabel('%s' % _("STEP 1: Acquire Calibration Points")) + step_1 = FCLabel('%s' % _("STEP 1: Acquire Calibration Points"), bold=True) step_1.setToolTip( _("Pick four points by clicking on canvas.\n" "Those four points should be in the four\n" @@ -881,7 +881,7 @@ class CalibrationUI: ) grid_lay.addWidget(step_1, 10, 0, 1, 3) - self.cal_source_lbl = FCLabel("%s:" % _("Source Type")) + self.cal_source_lbl = FCLabel('%s:' % _("Source Type"), bold=True) self.cal_source_lbl.setToolTip(_("The source of calibration points.\n" "It can be:\n" "- Object -> click a hole geo for Excellon or a pad for Gerber\n" @@ -918,7 +918,7 @@ class CalibrationUI: grid_lay.addWidget(self.object_label, 13, 0, 1, 3) grid_lay.addWidget(self.object_combo, 14, 0, 1, 3) - self.points_table_label = FCLabel('%s' % _('Calibration Points')) + self.points_table_label = FCLabel('%s' % _('Calibration Points'), bold=True) self.points_table_label.setToolTip( _("Contain the expected calibration points and the\n" "ones measured.") @@ -1090,7 +1090,7 @@ class CalibrationUI: grid_lay.addWidget(FCLabel(''), 19, 0) # STEP 2 # - step_2 = FCLabel('%s' % _("STEP 2: Verification GCode")) + step_2 = FCLabel('%s' % _("STEP 2: Verification GCode"), bold=True) step_2.setToolTip( _("Generate GCode file to locate and align the PCB by using\n" "the four points acquired above.\n" @@ -1129,7 +1129,7 @@ class CalibrationUI: grid_lay.addWidget(FCLabel(''), 23, 0, 1, 3) # STEP 3 # - step_3 = FCLabel('%s' % _("STEP 3: Adjustments")) + step_3 = FCLabel('%s' % _("STEP 3: Adjustments"), bold=True) step_3.setToolTip( _("Calculate Scale and Skew factors based on the differences (delta)\n" "found when checking the PCB pattern. The differences must be filled\n" @@ -1160,7 +1160,7 @@ class CalibrationUI: grid_lay.addWidget(FCLabel(''), 27, 0, 1, 3) # STEP 4 # - step_4 = FCLabel('%s' % _("STEP 4: Adjusted GCode")) + step_4 = FCLabel('%s' % _("STEP 4: Adjusted GCode"), bold=True) step_4.setToolTip( _("Generate verification GCode file adjusted with\n" "the factors above.") @@ -1241,7 +1241,7 @@ class CalibrationUI: """) grid_lay.addWidget(self.skew_button, 34, 0, 1, 3) - # final_factors_lbl = FCLabel('%s' % _("Final Factors")) + # final_factors_lbl = FCLabel('%s' % _("Final Factors"), bold=True) # final_factors_lbl.setToolTip( # _("Generate verification GCode file adjusted with\n" # "the factors above.") @@ -1323,7 +1323,7 @@ class CalibrationUI: grid_lay.addWidget(FCLabel(''), 44, 0, 1, 3) # STEP 5 # - step_5 = FCLabel('%s' % _("STEP 5: Calibrate FlatCAM Objects")) + step_5 = FCLabel('%s' % _("STEP 5: Calibrate FlatCAM Objects"), bold=True) step_5.setToolTip( _("Adjust the FlatCAM objects\n" "with the factors determined and verified above.") diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index debcf626..9d03c758 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -1449,7 +1449,7 @@ class ThievingUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) dots_grid.addWidget(separator_line, 0, 0, 1, 2) - self.dots_label = FCLabel('%s:' % _("Dots Grid Parameters")) + self.dots_label = FCLabel('%s' % _("Dots Grid Parameters"), bold=True) dots_grid.addWidget(self.dots_label, 2, 0, 1, 2) # Dot diameter # @@ -1495,7 +1495,7 @@ class ThievingUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) squares_grid.addWidget(separator_line, 0, 0, 1, 2) - self.squares_label = FCLabel('%s:' % _("Squares Grid Parameters")) + self.squares_label = FCLabel('%s' % _("Squares Grid Parameters"), bold=True) squares_grid.addWidget(self.squares_label, 2, 0, 1, 2) # Square Size # @@ -1541,7 +1541,7 @@ class ThievingUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) lines_grid.addWidget(separator_line, 0, 0, 1, 2) - self.lines_label = FCLabel('%s:' % _("Lines Grid Parameters")) + self.lines_label = FCLabel('%s' % _("Lines Grid Parameters"), bold=True) lines_grid.addWidget(self.lines_label, 2, 0, 1, 2) # Line Size # diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index a4149570..8643adb6 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -884,7 +884,7 @@ class DsidedUI: grid_mirror.addWidget(separator_line, 3, 0, 1, 3) # ## Reference - self.axloc_label = FCLabel('%s:' % _("Reference")) + self.axloc_label = FCLabel('%s' % _("Reference"), bold=True) self.axloc_label.setToolTip( _("The coordinates used as reference for the mirror operation.\n" "Can be:\n" @@ -980,7 +980,7 @@ class DsidedUI: grid_snap_ref.setContentsMargins(0, 0, 0, 0) self.sr_frame.setLayout(grid_snap_ref) - self.exc_hole_lbl = FCLabel('%s:' % _("Excellon")) + self.exc_hole_lbl = FCLabel('%s' % _("Excellon"), bold=True) self.exc_hole_lbl.setToolTip( _("Object that holds holes that can be picked as reference for mirroring.") ) diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index 6395f4be..e27d3697 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -963,7 +963,7 @@ class DistanceUI: res_grid.addWidget(separator_line, 8, 0, 1, 3) # Distance - self.total_distance_label = FCLabel("%s:" % _('DISTANCE')) + self.total_distance_label = FCLabel('%s:' % _('DISTANCE'), bold=True) self.total_distance_label.setToolTip(_("This is the point to point Euclidian distance.")) self.total_distance_entry = FCEntry() diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index 9585784c..b8e6cbf4 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -1186,7 +1186,7 @@ class ExtractUI: self.ring_box.addLayout(ring_grid) # Annular Ring value - self.ring_label = FCLabel('%s' % _("Fixed Annular Ring")) + self.ring_label = FCLabel('%s' % _("Fixed Annular Ring"), bold=True) self.ring_label.setToolTip( _("The size of annular ring.\n" "The copper sliver between the hole exterior\n" @@ -1271,7 +1271,7 @@ class ExtractUI: self.fix_frame.setLayout(fixed_grid) # Fixed Diameter - self.fixed_label = FCLabel('%s' % _("Fixed Diameter")) + self.fixed_label = FCLabel('%s' % _("Fixed Diameter"), bold=True) fixed_grid.addWidget(self.fixed_label, 2, 0, 1, 2) # Diameter value @@ -1299,7 +1299,7 @@ class ExtractUI: self.prop_frame.setLayout(prop_grid) # Proportional Diameter - self.prop_label = FCLabel('%s' % _("Proportional Diameter")) + self.prop_label = FCLabel('%s' % _("Proportional Diameter"), bold=True) prop_grid.addWidget(self.prop_label, 0, 0, 1, 2) # Diameter value diff --git a/appPlugins/ToolImage.py b/appPlugins/ToolImage.py index 233b353b..18791c24 100644 --- a/appPlugins/ToolImage.py +++ b/appPlugins/ToolImage.py @@ -346,7 +346,7 @@ class ImageUI: # Type of image interpretation self.image_type = RadioSet([{'label': 'B/W', 'value': 'black'}, {'label': 'Color', 'value': 'color'}]) - self.image_type_label = FCLabel("%s:" % _('Image type')) + self.image_type_label = FCLabel('%s:' % _('Image type'), bold=True) self.image_type_label.setToolTip( _("Choose a method for the image interpretation.\n" "B/W means a black & white image. Color means a colored image.") diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index 8dbc70c5..acdc7e0e 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -3470,7 +3470,7 @@ class IsoUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) new_tool_grid.addWidget(separator_line, 0, 0, 1, 3) - self.tool_sel_label = FCLabel('%s' % _('Add from DB')) + self.tool_sel_label = FCLabel('%s' % _('Add from DB'), bold=True) new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 3) # ### Tool Diameter #### diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py index f99f5a3d..c8393041 100644 --- a/appPlugins/ToolLevelling.py +++ b/appPlugins/ToolLevelling.py @@ -1794,7 +1794,7 @@ class LevelUI: grid0 = GLay(v_spacing=5, h_spacing=3) self.al_box.addLayout(grid0) - self.al_title = FCLabel('%s' % _("Probe Points Table")) + self.al_title = FCLabel('%s' % _("Probe Points Table"), bold=True) self.al_title.setToolTip(_("Generate GCode that will obtain the height map")) self.show_al_table = FCCheckBox(_("Show")) @@ -1894,7 +1894,7 @@ class LevelUI: param_grid.addWidget(separator_line, 6, 0, 1, 2) # AUTOLEVELL MODE - al_mode_lbl = FCLabel('%s:' % _("Mode")) + al_mode_lbl = FCLabel('%s' % _("Mode"), bold=True) al_mode_lbl.setToolTip(_("Choose a mode for height map generation.\n" "- Manual: will pick a selection of probe points by clicking on canvas\n" "- Grid: will automatically generate a grid of probe points")) diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index 39ae0437..23f29e7a 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -4184,7 +4184,7 @@ class MillingUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) new_tool_grid.addWidget(separator_line, 0, 0, 1, 2) - self.tool_sel_label = FCLabel('%s' % _("Add from DB")) + self.tool_sel_label = FCLabel('%s' % _("Add from DB"), bold=True) new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 2) self.addtool_entry_lbl = FCLabel('%s:' % _('Tool Dia')) diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index 982bba2d..66f44520 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -4193,7 +4193,7 @@ class NccUI: # ############################################################# # ############### Tool selection ############################## # ############################################################# - self.tool_sel_label = FCLabel('%s' % _('Add from DB')) + self.tool_sel_label = FCLabel('%s' % _('Add from DB'), bold=True) new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 3) # ### Tool Diameter #### diff --git a/appPlugins/ToolObjectDistance.py b/appPlugins/ToolObjectDistance.py index 3679a534..88d17eb4 100644 --- a/appPlugins/ToolObjectDistance.py +++ b/appPlugins/ToolObjectDistance.py @@ -570,7 +570,7 @@ class ObjectDistanceUI: res_grid.addWidget(separator_line, 6, 0, 1, 3) # Total Distance - self.total_distance_label = FCLabel("%s:" % _('DISTANCE')) + self.total_distance_label = FCLabel('%s:' % _('DISTANCE'), bold=True) self.total_distance_label.setToolTip(_("This is the point to point Euclidian distance.")) self.total_distance_entry = FCEntry() @@ -584,7 +584,7 @@ class ObjectDistanceUI: res_grid.addWidget(FCLabel("%s" % self.units), 8, 2) # Half Point - self.half_point_label = FCLabel("%s:" % _('Half Point')) + self.half_point_label = FCLabel('%s:' % _('Half Point'), bold=True) self.half_point_label.setToolTip(_("This is the middle point of the point to point Euclidean distance.")) self.half_point_entry = FCEntry() diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py index 830dea85..60d29a5d 100644 --- a/appPlugins/ToolOptimal.py +++ b/appPlugins/ToolOptimal.py @@ -494,7 +494,7 @@ class OptimalUI: self.gerber_object_combo.is_last = True self.gerber_object_combo.obj_type = "Gerber" - self.gerber_object_label = FCLabel("%s:" % _("GERBER")) + self.gerber_object_label = FCLabel('%s:' % _("GERBER"), bold=True) self.gerber_object_label.setToolTip( "Gerber object for which to find the minimum distance between copper features." ) diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index 620e9d2a..03690b15 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -3041,7 +3041,7 @@ class PaintUI: "L = laser")) # Tool Order - self.order_label = FCLabel('%s:' % _('Tool order')) + self.order_label = FCLabel('%s:' % _('Tool order'), bold=True) self.order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n" "'Default' --> means that the used order is the one in the tool table\n" "'Forward' --> means that the tools will be ordered from small to big\n" @@ -3071,7 +3071,7 @@ class PaintUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) new_tool_grid.addWidget(separator_line, 0, 0, 1, 2) - self.tool_sel_label = FCLabel('%s' % _('Add from DB')) + self.tool_sel_label = FCLabel('%s' % _('Add from DB'), bold=True) new_tool_grid.addWidget(self.tool_sel_label, 2, 0, 1, 2) # ### Tool Diameter #### diff --git a/appPlugins/ToolPanelize.py b/appPlugins/ToolPanelize.py index 6bb55144..158de065 100644 --- a/appPlugins/ToolPanelize.py +++ b/appPlugins/ToolPanelize.py @@ -1344,7 +1344,7 @@ class PanelizeUI: # Type of resulting Panel object self.panel_type_radio = RadioSet([{'label': _('Gerber'), 'value': 'gerber'}, {'label': _('Geo'), 'value': 'geometry'}]) - self.panel_type_label = FCLabel("%s:" % _("Panel Type")) + self.panel_type_label = FCLabel('%s:' % _("Panel Type"), bold=True) self.panel_type_label.setToolTip( _("Choose the type of object for the panel object:\n" "- Gerber\n" diff --git a/appPlugins/ToolPcbWizard.py b/appPlugins/ToolPcbWizard.py index d23cd9f1..0c2cab65 100644 --- a/appPlugins/ToolPcbWizard.py +++ b/appPlugins/ToolPcbWizard.py @@ -484,7 +484,7 @@ class WizardUI: # Units type self.units_radio = RadioSet([{'label': _('Inch'), 'value': 'INCH'}, {'label': _('mm'), 'value': 'METRIC'}]) - self.units_label = FCLabel("%s:" % _('Units')) + self.units_label = FCLabel('%s:' % _('Units'), bold=True) self.units_label.setToolTip( _("The type of units that the coordinates and tool\n" "diameters are using. Can be INCH or MM.") diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index 325bb021..1d04a24f 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -2173,7 +2173,7 @@ class PunchUI: separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) grid1.addWidget(separator_line, 2, 0, 1, 2) - self.exc_label = FCLabel('%s' % _("Excellon")) + self.exc_label = FCLabel('%s' % _("Excellon"), bold=True) self.exc_label.setToolTip( _("Remove the geometry of Excellon from the Gerber to create the holes in pads.") ) @@ -2188,7 +2188,7 @@ class PunchUI: grid1.addWidget(self.exc_combo, 6, 0, 1, 2) # Fixed Dia - self.fixed_label = FCLabel('%s' % _("Fixed Diameter")) + self.fixed_label = FCLabel('%s' % _("Fixed Diameter"), bold=True) grid1.addWidget(self.fixed_label, 8, 0, 1, 2) # Diameter value @@ -2216,7 +2216,7 @@ class PunchUI: self.ring_frame.setLayout(self.ring_box) # Annular Ring value - self.ring_label = FCLabel('%s' % _("Fixed Annular Ring")) + self.ring_label = FCLabel('%s' % _("Fixed Annular Ring"), bold=True) self.ring_label.setToolTip( _("The size of annular ring.\n" "The copper sliver between the hole exterior\n" @@ -2295,7 +2295,7 @@ class PunchUI: # ############################################################################################################# # Proportional value - self.prop_label = FCLabel('%s' % _("Proportional Diameter")) + self.prop_label = FCLabel('%s' % _("Proportional Diameter"), bold=True) grid1.addWidget(self.prop_label, 14, 0, 1, 2) # Diameter value diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index d95de190..58586eed 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -1268,7 +1268,7 @@ class SolderUI: _("Tool Diameter. Its value\n" "is the width of the solder paste dispensed.")) - self.addtool_entry_lbl = FCLabel('%s:' % _('New Tool')) + self.addtool_entry_lbl = FCLabel('%s:' % _('New Tool'), bold=True) self.addtool_entry_lbl.setToolTip( _("Diameter for the new tool to add in the Tool Table") ) diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py index a6b42da3..f16de017 100644 --- a/appPlugins/ToolSub.py +++ b/appPlugins/ToolSub.py @@ -901,7 +901,7 @@ class SubUI: geo_grid = GLay(v_spacing=5, h_spacing=3) geo_frame.setLayout(geo_grid) - self.geo_title = FCLabel("%s" % _("GEOMETRY")) + self.geo_title = FCLabel('%s' % _("GEOMETRY"), bold=True) self.tools_box.addWidget(self.geo_title) # Target Geometry Object From 67a7f8b8a2dffc16d3dba5e7ae90ded67787b642 Mon Sep 17 00:00:00 2001 From: Ali Khalil Date: Mon, 18 Apr 2022 12:52:44 +0300 Subject: [PATCH 05/15] Added theme_safe_colors method code in MainGUI.py --- appGUI/MainGUI.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index afdeae36..b1ec442b 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -54,8 +54,40 @@ class MainGUI(QtWidgets.QMainWindow): final_save = QtCore.pyqtSignal(name='saveBeforeExit') # screenChanged = QtCore.pyqtSignal(QtGui.QScreen, QtGui.QScreen) + # 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 theme_safe_color(self, color): - return 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.app.options['global_theme'] == 'light': + return color + else: + return self.theme_safe_colors[color] + else: + return color # https://www.w3.org/TR/SVG11/types.html#ColorKeywords def __init__(self, app): From 54e1bfd4fb4218723f61618fa9f5af3b83e6a64b Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 18 Apr 2022 21:39:25 +0300 Subject: [PATCH 06/15] - changed some strings --- appEditors/geo_plugins/GeoCopyPlugin.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/appEditors/geo_plugins/GeoCopyPlugin.py b/appEditors/geo_plugins/GeoCopyPlugin.py index fb71cd2f..b10a2955 100644 --- a/appEditors/geo_plugins/GeoCopyPlugin.py +++ b/appEditors/geo_plugins/GeoCopyPlugin.py @@ -461,15 +461,11 @@ class CopyEditorUI: minval, self.decimals, maxval), False) - else: - self.app.inform[str, bool].emit('[success] %s' % _("Edited value is within limits."), False) def confirmation_message_int(self, accepted, minval, maxval): if accepted is False: self.app.inform[str, bool].emit('[WARNING_NOTCL] %s: [%d, %d]' % (_("Edited value is out of range"), minval, maxval), False) - else: - self.app.inform[str, bool].emit('[success] %s' % _("Edited value is within limits."), False) def on_copy_mode(self, val): if val == 'n': @@ -496,7 +492,7 @@ class CopyEditorUI: self.rows.valueChanged.connect(self.on_rows_cols_value_changed) self.columns.valueChanged.connect(self.on_rows_cols_value_changed) - self.app.inform.emit(_("Click to place ...")) + self.app.inform.emit(_("Click on reference location ...")) else: if val == 'linear': self.array_circular_frame.hide() @@ -505,7 +501,7 @@ class CopyEditorUI: self.spacing_frame.hide() self.offset_frame.hide() - self.app.inform.emit(_("Click to place ...")) + self.app.inform.emit(_("Click on reference location ...")) else: # 'circular' self.array_circular_frame.show() self.array_linear_frame.hide() From 00144bafa0371126d5fb30997154895a9c62b567 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 18 Apr 2022 22:22:47 +0300 Subject: [PATCH 07/15] - some changes in the theme selection, added that the default situation is where no theme is applied - some string changes --- CHANGELOG.md | 2 ++ appEditors/geo_plugins/GeoCopyPlugin.py | 4 ++-- appGUI/PlotCanvas.py | 12 ++++++------ appGUI/PlotCanvas3d.py | 6 +++--- appGUI/PlotCanvasLegacy.py | 10 +++++----- appGUI/VisPyCanvas.py | 12 ++++++------ appGUI/preferences/general/GeneralAPPSetGroupUI.py | 6 +++--- .../general/GeneralAppSettingsGroupUI.py | 6 +++--- appGUI/preferences/general/GeneralGUIPrefGroupUI.py | 13 ++++++++----- appMain.py | 12 ++++++++---- appPlugins/ToolDistance.py | 8 ++++---- defaults.py | 5 +++-- 12 files changed, 53 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00fa0320..d97cbc40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ CHANGELOG for FlatCAM Evo beta - replaced all the FCLabel widgets that have color HTML with the new FCLabel widget that uses parameters for 'color' and weight - minor changes - added a way to allow patching FCLabel widget colors for certain cases without having to pass them each instance +- some changes in the theme selection, added that the default situation is where no theme is applied +- some string changes 17.04.2022 diff --git a/appEditors/geo_plugins/GeoCopyPlugin.py b/appEditors/geo_plugins/GeoCopyPlugin.py index 4cc079cc..1100e82f 100644 --- a/appEditors/geo_plugins/GeoCopyPlugin.py +++ b/appEditors/geo_plugins/GeoCopyPlugin.py @@ -496,7 +496,7 @@ class CopyEditorUI: self.rows.valueChanged.connect(self.on_rows_cols_value_changed) self.columns.valueChanged.connect(self.on_rows_cols_value_changed) - self.app.inform.emit(_("Click to place ...")) + self.app.inform.emit(_("Click on reference location ...")) else: if val == 'linear': self.array_circular_frame.hide() @@ -505,7 +505,7 @@ class CopyEditorUI: self.spacing_frame.hide() self.offset_frame.hide() - self.app.inform.emit(_("Click to place ...")) + self.app.inform.emit(_("Click on reference location ...")) else: # 'circular' self.array_circular_frame.show() self.array_linear_frame.hide() diff --git a/appGUI/PlotCanvas.py b/appGUI/PlotCanvas.py index 2ba5003b..0d40cf9f 100644 --- a/appGUI/PlotCanvas.py +++ b/appGUI/PlotCanvas.py @@ -54,14 +54,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or 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') @@ -389,14 +389,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: color = 'dimgray' else: color = '#dededeff' diff --git a/appGUI/PlotCanvas3d.py b/appGUI/PlotCanvas3d.py index 1c3d6e13..748b459c 100644 --- a/appGUI/PlotCanvas3d.py +++ b/appGUI/PlotCanvas3d.py @@ -66,19 +66,19 @@ class PlotCanvas3d(QtCore.QObject, scene.SceneCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False if settings.contains("axis_font_size"): a_fsize = settings.value('axis_font_size', type=int) else: a_fsize = 8 - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: theme_color = Color('#FFFFFF') tick_color = Color('#000000') back_color = str(QPalette().color(QPalette.ColorRole.Window).name()) diff --git a/appGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py index 45d34023..17590476 100644 --- a/appGUI/PlotCanvasLegacy.py +++ b/appGUI/PlotCanvasLegacy.py @@ -86,14 +86,14 @@ class CanvasCache(QtCore.QObject): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: self.axes.set_facecolor('#FFFFFF') else: self.axes.set_facecolor('#000000') @@ -165,7 +165,7 @@ class PlotCanvasLegacy(QtCore.QObject): self.app = app - if self.app.options['global_theme'] == 'light': + if self.app.options['global_theme'] in ['default', 'light']: theme_color = '#FFFFFF' tick_color = '#000000' self.rect_hud_color = '#0000FF10' @@ -457,7 +457,7 @@ class PlotCanvasLegacy(QtCore.QObject): super().__init__() self.p = plotcanvas - units = self.p.app.app_units + # units = self.p.app.app_units # self._text = 'Dx: %s [%s]\nDy: %s [%s]\n\nX: %s [%s]\nY: %s [%s]' % \ # ('0.0000', units, '0.0000', units, '0.0000', units, '0.0000', units) self.on_update_text_hud() diff --git a/appGUI/VisPyCanvas.py b/appGUI/VisPyCanvas.py index 991f3546..35d86aa4 100644 --- a/appGUI/VisPyCanvas.py +++ b/appGUI/VisPyCanvas.py @@ -39,14 +39,14 @@ class VisPyCanvas(scene.SceneCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: theme_color = Color('#FFFFFF') tick_color = Color('#000000') back_color = str(QPalette().color(QPalette.ColorRole.Window).name()) @@ -102,15 +102,15 @@ class VisPyCanvas(scene.SceneCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False self.view = view - if theme == 'light' and not dark_canvas: + if (theme == 'default' or 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/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index 2ec99b73..b7d92edf 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -496,14 +496,14 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): if theme_settings.contains("theme"): theme = theme_settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if theme_settings.contains("dark_canvas"): dark_canvas = theme_settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or 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/GeneralAppSettingsGroupUI.py b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py index 93ba5780..60bbc5fa 100644 --- a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py +++ b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py @@ -292,14 +292,14 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2): if theme_settings.contains("theme"): theme = theme_settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if theme_settings.contains("dark_canvas"): dark_canvas = theme_settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or 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 bec7d99e..e846d1e0 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -42,21 +42,24 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.appearance_radio = RadioSet([ - {"label": _("OS Dependent"), "value": "auto"}, + {"label": _("Default"), "value": "default"}, + {"label": _("Auto"), "value": "auto"}, {"label": _("Light"), "value": "light"}, {"label": _("Dark"), "value": "dark"} ], compact=True) self.appearance_radio.setToolTip( - _("OS Dependent: Matches mode from OS\n" + _("The theme can be:\n" + "Default: Default theme\n" + "Auto: Matches mode from OS\n" "Light: Light mode\n" "Dark: Dark mode") ) # Dark Canvas - self.dark_canvas_cb = FCCheckBox('%s' % _('Always use dark canvas')) + self.dark_canvas_cb = FCCheckBox('%s' % _('Dark Canvas')) self.dark_canvas_cb.setToolTip( - _("Check this box to always use Dark canvas\n" - "even if Light theme is selected.") + _("Check this box to force the use of dark canvas\n" + "even if a dark theme is not selected.") ) grid0.addWidget(self.appearance_label, 0, 0, 1, 2) diff --git a/appMain.py b/appMain.py index 8632f289..aed6b931 100644 --- a/appMain.py +++ b/appMain.py @@ -619,7 +619,9 @@ class App(QtCore.QObject): else: theme = 'light' else: - if self.options["global_appearance"] == 'dark': + if self.options["global_appearance"] == 'default': + theme = 'default' + elif self.options["global_appearance"] == 'dark': theme = 'dark' else: theme = 'light' @@ -634,7 +636,9 @@ class App(QtCore.QObject): else: self.decimals = int(self.options['decimals_inch']) - if self.options["global_theme"] == 'light': + if self.options["global_theme"] == 'default': + self.resource_location = 'assets/resources' + elif self.options["global_theme"] == 'light': self.resource_location = 'assets/resources' self.qapp.setStyleSheet(qdarktheme.load_stylesheet('light')) else: @@ -1040,12 +1044,12 @@ class App(QtCore.QObject): if self.options["global_cursor_color_enabled"]: self.cursor_color_3D = self.options["global_cursor_color"] else: - if theme == 'light' and not self.options["global_dark_canvas"]: + if (theme == 'light' or theme == 'default') and not self.options["global_dark_canvas"]: self.cursor_color_3D = 'black' else: self.cursor_color_3D = 'gray' - # update the options dict with the setting in QSetting + # update the 'options' dict with the setting in QSetting self.options['global_theme'] = theme # ######################## diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index e27d3697..a7f4ec28 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -764,20 +764,20 @@ class Distance(AppTool): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False if self.app.use_3d_engine: - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: color = '#000000FF' else: color = '#FFFFFFFF' else: - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: color = '#000000' else: color = '#FFFFFF' diff --git a/defaults.py b/defaults.py index f8f16e25..2cd38352 100644 --- a/defaults.py +++ b/defaults.py @@ -112,8 +112,9 @@ class AppDefaults: "global_tpdf_rmargin": 20.0, # General GUI Preferences - "global_appearance": 'auto', - "global_dark_canvas": True, + "global_appearance": 'default', + "global_dark_canvas": False, + "global_theme": 'default', "global_layout": "compact", "global_hover_shape": False, From af6315f8910b4462b6a2f52ae0aa37cbe993c7fe Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 19 Apr 2022 00:29:18 +0300 Subject: [PATCH 08/15] - fixed and prettified the 'Light' theme --- CHANGELOG.md | 4 + appGUI/MainGUI.py | 68 +- appGUI/themes/__init__.py | 0 .../dark_style_sheet.py} | 0 appGUI/themes/light_style_sheet.py | 1078 +++++++++++++++++ appMain.py | 6 +- 6 files changed, 1121 insertions(+), 35 deletions(-) create mode 100644 appGUI/themes/__init__.py rename appGUI/{style_sheet.py => themes/dark_style_sheet.py} (100%) create mode 100644 appGUI/themes/light_style_sheet.py diff --git a/CHANGELOG.md b/CHANGELOG.md index d97cbc40..4e8eee44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM Evo beta ================================================= +19.04.2022 + +- fixed and prettified the 'Light' theme + 18.04.2022 - in Geometry Editor, in Copy Tool added the 2D copy-as-array feature therefore finishing this editor plugin upgrade diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index b1ec442b..89f33101 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -174,12 +174,12 @@ class MainGUI(QtWidgets.QMainWindow): # Open Gerber ... self.menufileopengerber = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/flatcam_icon24.png'), - '%s...\t%s' % (_('Open Gerber'), _('Ctrl+G')), self) + '%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'), - '%s...\t%s' % (_('Open Excellon'), _('Ctrl+E')), self) + '%s...\t%s' % (_('Open Excellon'), _('Ctrl+E')), self) self.menufile_open.addAction(self.menufileopenexcellon) # Open G-Code ... @@ -211,7 +211,7 @@ class MainGUI(QtWidgets.QMainWindow): # Save Project As ... self.menufilesaveprojectas = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/floppy16.png'), - '%s...\t%s' % (_('Save Project As'), _('Ctrl+Shift+S')), self) + '%s...\t%s' % (_('Save Project As'), _('Ctrl+Shift+S')), self) self.menufile_save.addAction(self.menufilesaveprojectas) # Save Project Copy ... @@ -230,9 +230,9 @@ class MainGUI(QtWidgets.QMainWindow): self.menufile_scripting.setToolTipsVisible(True) self.menufilenewscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/script_new16.png'), - '%s...\t%s' % (_('New Script'), ''), self) + '%s...\t%s' % (_('New Script'), ''), self) self.menufileopenscript = QtGui.QAction(QtGui.QIcon(self.app.resource_location + '/open_script32.png'), - '%s...\t%s' % (_('Open Script'), ''), self) + '%s...\t%s' % (_('Open Script'), ''), self) self.menufileopenscriptexample = QtGui.QAction( QtGui.QIcon(self.app.resource_location + '/open_script32.png'), '%s...\t%s' % (_('Open Example'), ''), self) @@ -2068,7 +2068,7 @@ class MainGUI(QtWidgets.QMainWindow): self.lock_action.triggered[bool].connect(self.lock_toolbar) self.pref_open_button.clicked.connect(self.on_preferences_open_folder) - self.clear_btn.clicked.connect(self.on_gui_clear) + self.clear_btn.clicked.connect(lambda: self.on_gui_clear()) self.wplace_label.clicked.connect(self.app.on_workspace_toggle) self.fcinfo.clicked.connect(self.toggle_shell_ui) @@ -2387,7 +2387,7 @@ class MainGUI(QtWidgets.QMainWindow): subprocess.Popen(['xdg-open', self.app.data_path]) self.app.inform.emit('[success] %s' % _("FlatCAM Preferences Folder opened.")) - def on_gui_clear(self, signal=None, forced_clear=False): + def on_gui_clear(self, forced_clear=False): """ Will clear the settings that are stored in QSettings. """ @@ -2398,8 +2398,6 @@ class MainGUI(QtWidgets.QMainWindow): del theme_settings - resource_loc = self.app.resource_location - response = None bt_yes = None if forced_clear is False: @@ -3530,27 +3528,27 @@ class MainGUI(QtWidgets.QMainWindow): self.app.geo_editor.select_tool('select') return else: - if self.app.geo_editor.active_tool.name == 'path' and \ - self.app.geo_editor.active_tool.path_tool.length != 0.0: + if self.app.geo_editor.active_tool.name == 'path' \ + and self.app.geo_editor.active_tool.path_tool.length != 0.0: pass - elif self.app.geo_editor.active_tool.name == 'polygon' and \ - self.app.geo_editor.active_tool.polygon_tool.length != 0.0: + elif self.app.geo_editor.active_tool.name == 'polygon' \ + and self.app.geo_editor.active_tool.polygon_tool.length != 0.0: pass - elif self.app.geo_editor.active_tool.name == 'circle' and \ - self.app.geo_editor.active_tool.circle_tool.x != 0.0 and \ - self.app.geo_editor.active_tool.circle_tool.y != 0.0: + elif self.app.geo_editor.active_tool.name == 'circle' \ + and self.app.geo_editor.active_tool.circle_tool.x != 0.0 \ + and self.app.geo_editor.active_tool.circle_tool.y != 0.0: pass - elif self.app.geo_editor.active_tool.name == 'rectangle' and \ - self.app.geo_editor.active_tool.rect_tool.length != 0.0 and \ - self.app.geo_editor.active_tool.rect_tool.width != 0.0: + elif self.app.geo_editor.active_tool.name == 'rectangle' \ + and self.app.geo_editor.active_tool.rect_tool.length != 0.0 \ + and self.app.geo_editor.active_tool.rect_tool.width != 0.0: pass - elif self.app.geo_editor.active_tool.name == 'move' and \ - self.app.geo_editor.active_tool.move_tool.length != 0.0 and \ - self.app.geo_editor.active_tool.move_tool.width != 0.0: + elif self.app.geo_editor.active_tool.name == 'move' \ + and self.app.geo_editor.active_tool.move_tool.length != 0.0 \ + and self.app.geo_editor.active_tool.move_tool.width != 0.0: pass - elif self.app.geo_editor.active_tool.name == 'copy' and \ - self.app.geo_editor.active_tool.copy_tool.length != 0.0 and \ - self.app.geo_editor.active_tool.copy_tool.width != 0.0: + elif self.app.geo_editor.active_tool.name == 'copy' \ + and self.app.geo_editor.active_tool.copy_tool.length != 0.0 \ + and self.app.geo_editor.active_tool.copy_tool.width != 0.0: pass else: self.app.geo_editor.active_tool.click( @@ -3896,8 +3894,9 @@ class MainGUI(QtWidgets.QMainWindow): self.app.inform.emit(_("Click on target point.")) self.app.ui.aperture_copy_btn.setChecked(True) self.app.grb_editor.on_tool_select('copy') - self.app.grb_editor.active_tool.set_origin( - (self.app.grb_editor.snap_x, self.app.grb_editor.snap_y)) + if self.app.grb_editor.active_tool is not None: + self.app.grb_editor.active_tool.set_origin( + (self.app.grb_editor.snap_x, self.app.grb_editor.snap_y)) else: self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected.")) return @@ -3942,8 +3941,9 @@ class MainGUI(QtWidgets.QMainWindow): self.app.inform.emit(_("Click on target point.")) self.app.ui.aperture_move_btn.setChecked(True) self.app.grb_editor.on_tool_select('move') - self.app.grb_editor.active_tool.set_origin( - (self.app.grb_editor.snap_x, self.app.grb_editor.snap_y)) + if self.app.grb_editor.active_tool is not None: + self.app.grb_editor.active_tool.set_origin( + (self.app.grb_editor.snap_x, self.app.grb_editor.snap_y)) else: self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected.")) return @@ -4154,8 +4154,9 @@ class MainGUI(QtWidgets.QMainWindow): self.app.inform.emit(_("Click on target point.")) self.app.ui.copy_drill_btn.setChecked(True) self.app.exc_editor.on_tool_select('drill_copy') - self.app.exc_editor.active_tool.set_origin( - (self.app.exc_editor.snap_x, self.app.exc_editor.snap_y)) + if self.app.exc_editor.active_tool is not None: + self.app.exc_editor.active_tool.set_origin( + (self.app.exc_editor.snap_x, self.app.exc_editor.snap_y)) else: self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected.")) return @@ -4183,8 +4184,9 @@ class MainGUI(QtWidgets.QMainWindow): self.app.inform.emit(_("Click on target location ...")) self.app.ui.move_drill_btn.setChecked(True) self.app.exc_editor.on_tool_select('drill_move') - self.app.exc_editor.active_tool.set_origin( - (self.app.exc_editor.snap_x, self.app.exc_editor.snap_y)) + if self.app.exc_editor.active_tool is not None: + self.app.exc_editor.active_tool.set_origin( + (self.app.exc_editor.snap_x, self.app.exc_editor.snap_y)) else: self.app.inform.emit('[WARNING_NOTCL] %s' % _("Cancelled. Nothing selected.")) return diff --git a/appGUI/themes/__init__.py b/appGUI/themes/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/appGUI/style_sheet.py b/appGUI/themes/dark_style_sheet.py similarity index 100% rename from appGUI/style_sheet.py rename to appGUI/themes/dark_style_sheet.py diff --git a/appGUI/themes/light_style_sheet.py b/appGUI/themes/light_style_sheet.py new file mode 100644 index 00000000..36a5611b --- /dev/null +++ b/appGUI/themes/light_style_sheet.py @@ -0,0 +1,1078 @@ +L_STYLE_SHEET = """ +* { + padding: 0px; + margin: 0px; + border: none; + border-style: none; + border-image: unset; + outline: none; +} +QToolBar * { + margin: 0px; + padding: 0px; +} +QWidget { + background: #f8f9fa; + color: #4d5157; + selection-background-color: #0081db; + selection-color: #f8f9fa; +} +QWidget:disabled { + color: #babdc2; + selection-background-color: #dadce0; + selection-color: #babdc2; +} +QWidget { + backward-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground__rotate-270.svg); + forward-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground__rotate-90.svg); + leftarrow-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground__rotate-270.svg); + rightarrow-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground__rotate-90.svg); + dialog-ok-icon: url(${path}/themes/light/svg/check__icon-foreground.svg); + dialog-cancel-icon: url(${path}/themes/light/svg/close__icon-foreground.svg); + dialog-yes-icon: url(${path}/themes/light/svg/check_circle__icon-foreground.svg); + dialog-no-icon: url(${path}/themes/light/svg/cancel__icon-foreground.svg); + dialog-apply-icon: url(${path}/themes/light/svg/check__icon-foreground.svg); + dialog-reset-icon: url(${path}/themes/light/svg/restart_alt__icon-foreground.svg); + dialog-save-icon: url(${path}/themes/light/svg/save__icon-foreground.svg); + dialog-discard-icon: url(${path}/themes/light/svg/delete__icon-foreground.svg); + dialog-close-icon: url(${path}/themes/light/svg/close__icon-foreground.svg); + dialog-open-icon: url(${path}/themes/light/svg/folder_open__icon-foreground.svg); + dialog-help-icon: url(${path}/themes/light/svg/help__icon-foreground.svg); + filedialog-parent-directory-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground.svg); + filedialog-new-directory-icon: url(${path}/themes/light/svg/create_new_folder__icon-foreground.svg); + titlebar-close-icon: url(${path}/themes/light/svg/close__icon-foreground.svg); + titlebar-normal-icon: url(${path}/themes/light/svg/flip_to_front__icon-foreground.svg); +} +QCommandLinkButton { + qproperty-icon: url(${path}/themes/light/svg/east__highlight.svg); +} +QMainWindow::separator { + width: 2px; + height: 4px; + background: #dadce0; +} +QMainWindow::separator:hover, +QMainWindow::separator:pressed { + background: #0081db; +} +QToolTip { + background: #ffffff; + color: #4d5157; + border: 1px solid #dadce0; +} +QSizeGrip { + width: 0; + height: 0; + image: none; +} +QStatusBar { + background: #dfe1e5; +} +QStatusBar::item { + border: none; +} +QStatusBar QWidget { + background: transparent; + padding: 0px; + border-radius: $radius{0px}; +} +QStatusBar > .QSizeGrip { + padding: 0; +} +QStatusBar QWidget:hover { + background: #d1d4da; +} +QStatusBar QWidget:pressed { + background: #c3c7ce; +} +QStatusBar QWidget:disabled { + background: #edeef0; +} +QStatusBar QWidget:checked { + background: #c3c7ce; +} +QCheckBox, +QRadioButton { + border-top: 2px solid transparent; + border-bottom: 2px solid transparent; +} +QCheckBox:!window, +QRadioButton:!window { + background: transparent; +} +QCheckBox:hover, +QRadioButton:hover { + border-bottom: 2px solid #0081db; +} +QGroupBox { + font-weight: bold; + border: 1px solid #dadce0; + margin-top: 8px; + padding: 2px 1px 1px 1px; + border-radius: $radius{4px}; +} +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: top left; + left: 7px; + margin: 0 2px 0 3px; +} +QGroupBox:flat { + border-color: transparent; +} +QMenuBar { + background: #f8f9fa; + padding: 2px; + border-bottom: 1px solid #dadce0; +} +QMenuBar::item { + background: transparent; + padding: 4px; +} +QMenuBar::item:selected { + padding: 4px; + background: #dadce0; + border-radius: $radius{4px}; +} +QMenuBar::item:pressed { + padding: 4px; + margin-bottom: 0; + padding-bottom: 0; +} +QToolBar { + background: #f8f9fa; + padding: 0px; + font-weight: bold; + spacing: 1px; + margin: 0px; +} +QToolBar::handle:horizontal { + width: 10px; + image: url(${path}/themes/light/svg/drag_indicator_horizontal__icon-foreground.svg); +} +QToolBar::handle:vertical { + height: 20px; + image: url(${path}/themes/light/svg/drag_indicator_horizontal__icon-foreground__rotate-90.svg); +} +QToolBar::separator { + background: #dadce0; +} +QToolBar::separator:horizontal { + width: 2px; + margin: 0 6px; +} +QToolBar::separator:vertical { + height: 2px; + margin: 6px 0; +} +QToolBar > QToolButton { + background: transparent; + padding: 3px; + border-radius: $radius{4px}; +} +QToolBar > QToolButton:hover, +QToolBar > QToolButton::menu-button:hover { + background: #d7d7d7; +} +QToolBar > QToolButton:pressed, +QToolBar > QToolButton::menu-button:pressed { + background: #c4c4c4; +} +QToolBar > QToolButton:checked { + background: #c4c4c4; +} +QToolBar > QToolButton#qt_toolbar_ext_button { + image: url(${path}/themes/light/svg/double_arrow__icon-foreground.svg); + $env_patch{"os": "Windows", "value": "padding: 0; qproperty-icon: unset"}; +} +QToolBar > QToolButton#qt_toolbar_ext_button:disabled { + image: url(${path}/themes/light/svg/double_arrow__icon-foreground-disabled.svg); +} +QToolBar > QWidget { + background: transparent; +} +QMenu { + background: #ffffff; + padding: 8px 0; + border: 1px solid #dadce0; +} +QMenu::separator { + margin: 4px 0; + height: 1px; + background: #dadce0; +} +QMenu::item { + padding: 4px 28px; +} +QMenu::item:selected { + background: #dadce0; +} +QMenu::icon { + padding-left: 10px; + width: 14px; + height: 14px; +} +QMenu::right-arrow { + margin: 2px; + padding-left: 12px; + height: 20px; + width: 20px; + image: url(${path}/themes/light/svg/chevron_right__icon-foreground.svg); +} +QMenu::right-arrow:disabled { + image: url(${path}/themes/light/svg/chevron_right__icon-foreground-disabled.svg); +} +QScrollBar { + background: #edeff2; + $env_patch{"os": "Darwin", "value": "background: transparent"}; + border-radius: $radius{4px}; +} +QScrollBar:horizontal { + height: 14px; + $env_patch{"os": "Darwin", "value": "height: 7px;"}; +} +QScrollBar:vertical { + width: 14px; + $env_patch{"os": "Darwin", "value": "width: 7px;"}; +} +QScrollBar::handle { + background: rgba(155.000, 155.000, 157.000, 0.737); + border-radius: $radius{3px}; +} +QScrollBar::handle:hover { + background: rgba(117.000, 117.000, 119.000, 0.827); +} +QScrollBar::handle:pressed { + background: rgba(96.000, 96.000, 98.000, 0.933); +} +QScrollBar::handle:disabled { + background-color: #d6dbe2; +} +QScrollBar::handle:horizontal { + min-width: 8px; + margin: 4px 14px; + $env_patch{"os": "Darwin", "value": "margin: 0;"}; +} +QScrollBar::handle:horizontal:hover { + margin: 2px 14px; + $env_patch{"os": "Darwin", "value": "margin: 0;"}; +} +QScrollBar::handle:vertical { + min-height: 8px; + margin: 14px 4px; + $env_patch{"os": "Darwin", "value": "margin: 0;"}; +} +QScrollBar::handle:vertical:hover { + margin: 14px 2px; + $env_patch{"os": "Darwin", "value": "margin: 0;"}; +} +QScrollBar::sub-page, QScrollBar::add-page { + background: transparent; +} +QScrollBar::sub-line, +QScrollBar::add-line { + background: transparent; + width: 14px; + height: 14px; + margin: 2px; + subcontrol-origin: margin; + $env_patch{"os": "Darwin", "value": "width: 0; height: 0; margin: 0"}; +} +QScrollBar::sub-line:vertical { + subcontrol-position: top; +} +QScrollBar::add-line:vertical { + subcontrol-position: bottom; +} +QScrollBar::sub-line:horizontal { + subcontrol-position: left; +} +QScrollBar::add-line:horizontal { + subcontrol-position: right; +} +QScrollBar::up-arrow { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle.svg); +} +QScrollBar::right-arrow { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle__rotate-90.svg); +} +QScrollBar::down-arrow { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle__rotate-180.svg); +} +QScrollBar::left-arrow { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle__rotate-270.svg); +} +QScrollBar::up-arrow:hover { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle-pressed.svg); +} +QScrollBar::right-arrow:hover { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle-pressed__rotate-90.svg); +} +QScrollBar::down-arrow:hover { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle-pressed__rotate-180.svg); +} +QScrollBar::left-arrow:hover { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-handle-pressed__rotate-270.svg); +} +QScrollBar::up-arrow:disabled { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-disabled.svg); +} +QScrollBar::right-arrow:disabled { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-disabled__rotate-90.svg); +} +QScrollBar::down-arrow:disabled { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-disabled__rotate-180.svg); +} +QScrollBar::left-arrow:disabled { + image: url(${path}/themes/light/svg/arrow_drop_up__scrollbar-disabled__rotate-270.svg); +} +QProgressBar { + border: 1px solid #dadce0; + text-align: center; + color: #4d5157; + border-radius: $radius{4px}; +} +QProgressBar::chunk { + background: #0081db; + border-radius: $radius{3px}; +} +QProgressBar::chunk:disabled { + background: #dadce0; +} +QPushButton { + color: #0081db; + border: 1px solid #dadce0; + padding: 4px 8px; + border-radius: $radius{4px}; +} +QPushButton:!window { + background: transparent; +} +QPushButton:flat, +QPushButton:default { + border: none; + padding: 5px 9px; +} +QPushButton:default { + color: #f8f9fa; + background: #0081db; +} +QPushButton:hover, +QPushButton:flat:hover { + background: rgba(181.000, 202.000, 244.000, 0.333); +} +QPushButton:pressed, +QPushButton:flat:pressed, +QPushButton:checked:pressed, +QPushButton:flat:checked:pressed { + background: rgba(181.000, 202.000, 244.000, 0.933); +} +QPushButton:checked, +QPushButton:flat:checked { + background: rgba(181.000, 202.000, 244.000, 0.733); +} +QPushButton:default:hover { + background: #3781ea; +} +QPushButton:default:pressed { + background: #6ca1f0; +} +QPushButton:default:disabled { + background: #dadce0; +} +QDialogButtonBox QPushButton { + min-width: 65px; +} +QToolButton { + background: transparent; + padding: 5px; + spacing: 2px; + border-radius: $radius{2px}; +} +QToolButton:hover, +QToolButton::menu-button:hover { + background: rgba(181.000, 202.000, 244.000, 0.333); +} +QToolButton:pressed, +QToolButton:checked:pressed, +QToolButton::menu-button:pressed { + background: rgba(181.000, 202.000, 244.000, 0.933); +} +QToolButton:selected, +QToolButton:checked { + background: rgba(181.000, 202.000, 244.000, 0.733); +} +QToolButton::checked:disabled { + background: #dadce0; +} +QToolButton::menu-indicator { + height: 18px; + width: 18px; + top: 6px; + left: 3px; + image: url(${path}/themes/light/svg/expand_less__icon-foreground__rotate-180.svg); +} +QToolButton::menu-indicator:disabled { + image: url(${path}/themes/light/svg/expand_less__icon-foreground-disabled__rotate-180.svg); +} +QToolButton::menu-arrow { + image: unset; +} +QToolButton::menu-button { + subcontrol-origin: margin; + border: none; + width: 17px; + border-top-right-radius: $radius{4px}; + border-bottom-right-radius: $radius{4px}; + image: url(${path}/themes/light/svg/expand_less__icon-foreground__rotate-180.svg); +} +QToolButton::menu-button:disabled { + image: url(${path}/themes/light/svg/expand_less__icon-foreground-disabled__rotate-180.svg); +} +QToolButton[ +$env_patch{"version": "<6.0.0", "qt": "PySide2", "value": "popupMode=MenuButtonPopup"} +$env_patch{"version": "<6.0.0", "qt": "PyQt5", "value": "popupMode=\\\"1\\\""} +$env_patch{"version": ">=6.0.0", "value": "popupMode=MenuButtonPopup"} +] { + padding-right: 1px; + margin-right: 18px; + border-top-right-radius: $radius{0}; + border-bottom-right-radius: $radius{0}; +} +QComboBox { + border: 1px solid #dadce0; + min-height: 1.5em; + padding: 0 4px; + background: rgba(255.000, 255.000, 255.000, 0.000); + border-radius: $radius{4px}; +} +QComboBox:focus, +QComboBox:open { + border: 1px solid #0081db; +} +QComboBox::drop-down { + border: none; + padding-right: 4px; +} +QComboBox::down-arrow { + image: url(${path}/themes/light/svg/expand_less__icon-foreground__rotate-180.svg); +} +QComboBox::down-arrow:disabled { + image: url(${path}/themes/light/svg/expand_less__icon-foreground-disabled__rotate-180.svg); +} +QComboBox::item:selected { + border: none; + background: #4ca6e5; + color: #4d5157; +} +QComboBox QAbstractItemView { + background: #ffffff; + margin: 0; + border: 1px solid #dadce0; + selection-background-color: #4ca6e5; + selection-color: #4d5157; + padding: 2px; +} +QComboBox QAbstractItemView[ +$env_patch{"version": "<6.0.0", "value": "frameShape=\\\"0\\\""} +$env_patch{"version": ">=6.0.0", "value": "frameShape=NoFrame"} +] { + border-color: #dadce0; +} +QSlider { + padding: 2px 0; +} +QSlider::groove { + border-radius: $radius{2px}; +} +QSlider::groove:horizontal { + height: 4px; +} +QSlider::groove:vertical { + width: 4px; +} +QSlider::sub-page, QSlider::handle { + background: #0081db; +} +QSlider::sub-page:disabled, +QSlider::add-page:disabled, +QSlider::handle:disabled { + background: #dadce0; +} +QSlider::add-page { + background: #abc6f6; +} +QSlider::handle:hover { + background: #3781ea; +} +QSlider::handle:pressed { + background: #6ca1f0; +} +QSlider::handle:horizontal { + width: 16px; + height: 8px; + margin: -6px 0; + border-radius: 8px; +} +QSlider::handle:vertical { + width: 8px; + height: 16px; + margin: 0 -6px; + border-radius: 8px; +} +QTabWidget::pane { + border: 1px solid #dadce0; + border-radius: $radius{4px}; +} +QTabBar { + qproperty-drawBase: 0; +} +QTabBar::close-button:selected { + image: url(${path}/themes/light/svg/close__icon-foreground.svg); +} +QTabBar::close-button:!selected { + image: url(${path}/themes/light/svg/close__tabbar-button-inselected.svg) +} +QTabBar::close-button:disabled { + image: url(${path}/themes/light/svg/close__icon-foreground-disabled.svg); +} +QTabBar::close-button:hover { + background: #93b2ef; + border-radius: $radius{4px}; +} +QTabBar::close-button:hover:!selected { + background: #aec5f4; +} +QTabBar::tab { + padding: 3px; +} +QTabBar::tab:hover { + background: rgba(181.000, 202.000, 244.000, 0.333); +} +QTabBar::tab:selected { + color: #0081db; + background: rgba(181.000, 202.000, 244.000, 0.933); +} +QTabBar::tab:selected:disabled { + background: #dadce0; + color: #babdc2; +} +QTabBar::tab:top { + border-bottom: 2px solid #dadce0; + margin-left: 4px; + border-top-left-radius: $radius{2px}; + border-top-right-radius: $radius{2px}; +} +QTabBar::tab:top:selected { + border-bottom: 2px solid #0081db; +} +QTabBar::tab:top:hover { + border-color: #0081db; +} +QTabBar::tab:top:selected:disabled { + border-color: #dadce0; +} +QTabBar::tab:bottom { + border-top: 2px solid #dadce0; + margin-left: 4px; + border-bottom-left-radius: $radius{2px}; + border-bottom-right-radius: $radius{2px}; +} +QTabBar::tab:bottom:selected { + border-top: 2px solid #0081db; +} +QTabBar::tab:bottom:hover { + border-color: #0081db; +} +QTabBar::tab:bottom:selected:disabled { + border-color: #dadce0; +} +QTabBar::tab:left { + border-right: 2px solid #dadce0; + margin-top: 4px; + border-top-left-radius: $radius{2px}; + border-bottom-left-radius: $radius{2px}; +} +QTabBar::tab:left:selected { + border-right: 2px solid #0081db; +} +QTabBar::tab:left:hover { + border-color: #0081db; +} +QTabBar::tab:left:selected:disabled { + border-color: #dadce0; +} +QTabBar::tab:right { + border-left: 2px solid #dadce0; + margin-top: 4px; + border-top-right-radius: $radius{2px}; + border-bottom-right-radius: $radius{2px}; +} +QTabBar::tab:right:selected { + border-left: 2px solid #0081db; +} +QTabBar::tab:right:hover { + border-color: #0081db; +} +QTabBar::tab:right:selected:disabled { + border-color: #dadce0; +} +QDockWidget { + border: 1px solid #dadce0; + border-radius: $radius{4px}; +} +QDockWidget::title { + padding: 3px; + spacing: 4px; + background: #edeef0; +} +QDockWidget::close-button, +QDockWidget::float-button { + border-radius: $radius{2px}; +} +QDockWidget::close-button:hover, +QDockWidget::float-button:hover { + background: rgba(181.000, 202.000, 244.000, 0.333); +} +QDockWidget::close-button:pressed, +QDockWidget::float-button:pressed { + background: rgba(181.000, 202.000, 244.000, 0.933); +} +QFrame { + border: 1px solid #dadce0; + padding: 1px; + border-radius: $radius{4px}; +} +.QFrame { + padding: 0; +} +QFrame[ +$env_patch{"version": "<6.0.0", "qt": "PySide2", "value": "frameShape=NoFrame"} +$env_patch{"version": "<6.0.0", "qt": "PyQt5", "value": "frameShape=\\\"0\\\""} +$env_patch{"version": ">=6.0.0", "value": "frameShape=NoFrame"} +] { + border-color: transparent; + padding: 0; +} +.QFrame[ +$env_patch{"version": "<6.0.0", "qt": "PySide2", "value": "frameShape=NoFrame"} +$env_patch{"version": "<6.0.0", "qt": "PyQt5", "value": "frameShape=\\\"0\\\""} +$env_patch{"version": ">=6.0.0", "value": "frameShape=NoFrame"} +] { + border: none; +} +QFrame[ +$env_patch{"version": "<6.0.0", "qt": "PySide2", "value": "frameShape=Panel"} +$env_patch{"version": "<6.0.0", "qt": "PyQt5", "value": "frameShape=\\\"2\\\""} +$env_patch{"version": ">=6.0.0", "value": "frameShape=Panel"} +] { + border-color: #ffffff; + background: #ffffff; +} +QFrame[ +$env_patch{"version": "<6.0.0", "qt": "PySide2", "value": "frameShape=HLine"} +$env_patch{"version": "<6.0.0", "qt": "PyQt5", "value": "frameShape=\\\"4\\\""} +$env_patch{"version": ">=6.0.0", "value": "frameShape=HLine"} +] { + max-height: 2px; + border: none; + background: #dadce0; +} +QFrame[ +$env_patch{"version": "<6.0.0", "qt": "PySide2", "value": "frameShape=VLine"} +$env_patch{"version": "<6.0.0", "qt": "PyQt5", "value": "frameShape=\\\"5\\\""} +$env_patch{"version": ">=6.0.0", "value": "frameShape=VLine"} +] { + max-width: 2px; + border: none; + background: #dadce0; +} +QLCDNumber { + color: #4d5157; + min-width: 2em; + margin: 2px; +} +QLabel:!window, +QLCDNumber:!window { + background-color: transparent; +} +QToolBox:selected { + border: 2px solid #0081db; +} +QToolBox::tab { + background: #edeef0; + border-bottom: 2px solid #dadce0; + border-top-left-radius: $radius{4px}; + border-top-right-radius: $radius{4px}; +} +QToolBox::tab:selected { + border-bottom: 2px solid #0081db; +} +QToolBox::tab:selected:disabled { + border-bottom: 2px solid #dadce0; +} + +QAbstractScrollArea { + selection-background-color: #4ca6e5; + selection-color: #4d5157; + margin: 1px; +} +QAbstractScrollArea:disabled { + selection-background-color: #0081db; +} +QAbstractScrollArea::corner { + background: transparent; +} +QAbstractScrollArea > .QWidget { + background: transparent; +} +QAbstractScrollArea > .QWidget > .QWidget { + background: transparent; +} +QTextEdit, QPlainTextEdit { + background: #ffffff; +} +QTextEdit:focus, +QTextEdit:selected, +QPlainTextEdit:focus, +QPlainTextEdit:selected { + border: 1px solid #0081db; + selection-background-color: #a2d8ff; +} +QTextEdit:!focus, +QPlainTextEdit:!focus { + $env_patch{"version": ">=5.15.0", "value": "selection-background-color: #e4e6f2"}; +} +QTextEdit:!active, +QPlainTextEdit:!active { + $env_patch{"version": "<5.15.0", "value": "selection-background-color: #e4e6f2"}; +} +QAbstractItemView { + alternate-background-color: #e9ecef; +} +QAbstractItemView::item { + $env_patch{"version": ">=6.0.0", "value": "border-color: transparent"}; +} +QAbstractItemView:selected:!active, +QAbstractItemView:selected:!focus, +QAbstractItemView::item:selected:!active, +QTreeView::branch:selected:!active { + background: #e4e6f2; +} +QAbstractItemView::item:selected, +QTreeView::branch:selected { + background: #4ca6e5; + color: #4d5157; +} +QAbstractItemView::item:!selected:hover, +QTreeView::branch:!selected:hover { + background: #d3d3d3; +} +QAbstractItemView::item:selected:disabled { + color: #babdc2; +} +QAbstractItemView QLineEdit, +QAbstractItemView QAbstractSpinBox, +QAbstractItemView QComboBox, +QAbstractItemView QAbstractButton { + padding: 0; + margin: 1px; +} +QTreeView::branch { + border-image: url(${path}/themes/light/svg/vertical_line__guides-stroke-inactive.svg) 0; +} +QTreeView::branch:active { + border-image: url(${path}/themes/light/svg/vertical_line__icon-foreground.svg) 0; +} +QTreeView::branch:disabled { + border-image: url(${path}/themes/light/svg/vertical_line__icon-foreground-disabled.svg) 0; +} +QTreeView::branch:has-siblings:adjoins-item, +QTreeView::branch:!has-children:!has-siblings:adjoins-item { + border-image: unset; +} +QTreeView::branch:has-children:!has-siblings:closed, +QTreeView::branch:closed:has-children:has-siblings { + border-image: unset; + image: url(${path}/themes/light/svg/chevron_right__icon-foreground.svg); +} +QTreeView::branch:has-children:!has-siblings:closed:disabled, +QTreeView::branch:closed:has-children:has-siblings:disabled { + image: url(${path}/themes/light/svg/chevron_right__icon-foreground-disabled.svg); +} +QTreeView::branch:open:has-children:!has-siblings, +QTreeView::branch:open:has-children:has-siblings { + border-image: unset; + image: url(${path}/themes/light/svg/expand_less__icon-foreground__rotate-180.svg); +} +QTreeView::branch:open:has-children:!has-siblings:disabled, +QTreeView::branch:open:has-children:has-siblings:disabled { + image: url(${path}/themes/light/svg/expand_less__icon-foreground-disabled__rotate-180.svg); +} +QTableView { + gridline-color: #58595c; + background: #ffffff; +} +QTableView QTableCornerButton::section { + margin: 0 1px 1px 0; + background: #dadce0; + border-top-left-radius: $radius{2px}; +} +QTableView QTableCornerButton::section:pressed { + background: #4ca6e5; +} +QTableView > QHeaderView{ + background: #ffffff; +} +QHeaderView { + padding: 0; + margin: 0; + border: none; + border-radius: $radius{0}; +} +QHeaderView::section { + background: #dadce0; + text-align: left; + padding: 0 4px; + border: none; +} +QHeaderView::section:horizontal:on, +QHeaderView::section:vertical:on { + border-color: #0081db; +} +QHeaderView::section:horizontal:on:disabled, +QHeaderView::section:vertical:on:disabled { + color: #dadce0; + border-color: #dadce0; +} +QHeaderView::section:horizontal { + border-top: 2px solid transparent; + margin-right: 1px; +} +QHeaderView::section:vertical { + border-left: 2px solid transparent; + margin-bottom: 1px; +} +QHeaderView::section:last, +QHeaderView::section:only-one { + margin: 0; +} +QHeaderView::down-arrow { + margin: -2px -6px -6px -6px; + image: url(${path}/themes/light/svg/expand_less__icon-foreground__rotate-180.svg); +} +QHeaderView::down-arrow:disabled { + image: url(${path}/themes/light/svg/expand_less__icon-foreground-disabled__rotate-180.svg); +} +QHeaderView::up-arrow { + margin: -2px -6px -6px -6px; + image: url(${path}/themes/light/svg/expand_less__icon-foreground.svg); +} +QHeaderView::up-arrow:disabled { + image: url(${path}/themes/light/svg/expand_less__icon-foreground-disabled.svg); +} +QCalendarWidget { + border: none; +} +QCalendarWidget > .QWidget { + background: #ffffff; + border-bottom: 1px solid #dadce0; + border-radius: $radius{4px}; + border-bottom-left-radius: $radius{0}; + border-bottom-right-radius: $radius{0}; +} +QCalendarWidget > .QWidget > QWidget { + padding: 1px; +} +QCalendarWidget > .QWidget > QSpinBox { + margin-left: 1px; +} +QCalendarWidget > .QWidget > QSpinBox::up-button, +QCalendarWidget > .QWidget > QSpinBox::down-button { + margin: 1px 3px 1px 1px; +} +QCalendarWidget .QWidget > QToolButton { + border-radius: $radius{4px}; +} +QCalendarWidget > .QWidget > QToolButton::menu-indicator { + height: 14px; + width: 14px; + top: 5px; + left: 3px; +} +QCalendarWidget > QTableView { + margin: 0; + border: none; + border-radius: $radius{4px}; + border-top-left-radius: $radius{0}; + border-top-right-radius: $radius{0}; +} +QCalendarWidget > .QWidget > QToolButton#qt_calendar_prevmonth { + qproperty-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground__rotate-270.svg); +} +QCalendarWidget > .QWidget > QToolButton#qt_calendar_nextmonth { + qproperty-icon: url(${path}/themes/light/svg/arrow_upward__icon-foreground__rotate-90.svg); +} +QLineEdit, +QAbstractSpinBox { + border: 1px solid #dadce0; + padding: 3px 4px; + min-height: 1em; + background: rgba(255.000, 255.000, 255.000, 0.000); + border-radius: $radius{4px}; +} +QLineEdit:focus, +QAbstractSpinBox:focus { + border: 1px solid #0081db; +} +QAbstractSpinBox::up-button, +QAbstractSpinBox::down-button { + subcontrol-origin: border; + width: 12px; + height: 4px; + padding: 3px; + border-radius: $radius{4px}; +} +QAbstractSpinBox::up-button:hover, +QAbstractSpinBox::down-button:hover { + background: #e2eafb; +} +QAbstractSpinBox::up-button { + subcontrol-position: top right; + margin: 3px 3px 1px 1px; +} +QAbstractSpinBox::up-arrow { + image: url(${path}/themes/light/svg/arrow_drop_up__icon-foreground.svg); +} +QAbstractSpinBox::up-arrow:disabled { + image: url(${path}/themes/light/svg/arrow_drop_up__icon-foreground-disabled.svg); +} +QAbstractSpinBox::down-button { + subcontrol-position: bottom right; + margin: 1px 3px 3px 1px; +} +QAbstractSpinBox::down-arrow { + image: url(${path}/themes/light/svg/arrow_drop_up__icon-foreground__rotate-180.svg); +} +QAbstractSpinBox::down-arrow:disabled { + image: url(${path}/themes/light/svg/arrow_drop_up__icon-foreground-disabled__rotate-180.svg); +} +QDateTimeEdit::drop-down { + padding-right: 4px; + width: 16px; + image: url(${path}/themes/light/svg/calendar_today__icon-foreground.svg); +} +QDateTimeEdit::drop-down:disabled { + image: url(${path}/themes/light/svg/calendar_today__icon-foreground-disabled.svg); +} +QDateTimeEdit::down-arrow[calendarPopup=true] { + image: none; +} +QDateTimeEdit QCalendarWidget QAbstractItemView { + padding: -1px; + border: none; +} +QFileDialog > QFrame QAbstractItemView { + border: none; +} +QFileDialog > QFrame > QFrame QFrame QFrame { + border: none; + padding: 0; +} +QFontDialog QListView { + min-height: 60px; +} +QFontDialog QScrollBar:vertical { + margin: 0; +} +QComboBox::indicator:checked, +QMenu::indicator:checked { + width: 18px; + image: url(${path}/themes/light/svg/check__icon-foreground.svg); +} +QMenu::indicator { + width: 18px; + background: #c4c7cc; + margin-left: 3px; + border-radius: $radius{4px}; +} +QCheckBox, +QRadioButton { + spacing: 8px; +} +QGroupBox::title, +QAbstractItemView::item { + spacing: 6px; +} +QCheckBox::indicator, +QGroupBox::indicator, +QAbstractItemView::indicator, +QRadioButton::indicator { + height: 18px; + width: 18px; +} +QCheckBox::indicator, +QGroupBox::indicator, +QAbstractItemView::indicator { + image: url(${path}/themes/light/svg/check_box_outline_blank__icon-foreground.svg); +} +QCheckBox::indicator:unchecked:disabled, +QGroupBox::indicator:unchecked:disabled, +QAbstractItemView::indicator:unchecked:disabled { + image: url(${path}/themes/light/svg/check_box_outline_blank__icon-foreground-disabled.svg); +} +QCheckBox::indicator:checked, +QGroupBox::indicator:checked, +QAbstractItemView::indicator:checked { + image: url(${path}/themes/light/svg/check_box__highlight.svg); +} +QCheckBox::indicator:checked:disabled, +QGroupBox::indicator:checked:disabled, +QAbstractItemView::indicator:checked:disabled { + image: url(${path}/themes/light/svg/check_box__icon-foreground-disabled.svg); +} +QCheckBox::indicator:indeterminate, +QAbstractItemView::indicator:indeterminate { + image: url(${path}/themes/light/svg/indeterminate_check_box__highlight.svg); +} +QCheckBox::indicator:indeterminate:disabled, +QAbstractItemView::indicator:indeterminate:disabled { + image: url(${path}/themes/light/svg/indeterminate_check_box__icon-foreground-disabled.svg); +} +QRadioButton::indicator:unchecked { + image: url(${path}/themes/light/svg/radio_button_unchecked__icon-foreground.svg); +} +QRadioButton::indicator:unchecked:disabled { + image: url(${path}/themes/light/svg/radio_button_unchecked__icon-foreground-disabled.svg); +} +QRadioButton::indicator:checked { + image: url(${path}/themes/light/svg/radio_button_checked__highlight.svg); +} +QRadioButton::indicator:checked:disabled { + image: url(${path}/themes/light/svg/radio_button_checked__icon-foreground-disabled.svg); +} +QComboBox QAbstractItemView, +QStatusBar > QMenu, +QDateTimeEdit QCalendarWidget QAbstractItemView, +QDateTimeEdit QCalendarWidget .QWidget { + margin: 0; + border-radius: $radius{0}; + $env_patch{"version": "<6.0.0", "os": "Darwin", "value": "border-radius: $radius{4px}"}; +} +QMenu, +QStatusBar > QMenu { + $env_patch{"version": "<6.0.0", "os": "Darwin", "value": "border-radius: $radius{8px}"}; +} +PlotWidget { + padding: 0; +} +ParameterTree > .QWidget > .QWidget > .QWidget > QAbstractSpinBox::up-button, +ParameterTree > .QWidget > .QWidget > .QWidget > QAbstractSpinBox::down-button { + margin: 2px 3px 1px 1px; + padding: 2px; +} +ParameterTree > .QWidget > .QWidget > .QWidget > QComboBox{ + min-height: 1.2em; +} + +""" \ No newline at end of file diff --git a/appMain.py b/appMain.py index aed6b931..61ff699c 100644 --- a/appMain.py +++ b/appMain.py @@ -42,13 +42,14 @@ import tkinter as tk import qdarktheme import qdarktheme.themes.dark.stylesheet as qdarksheet +import qdarktheme.themes.light.stylesheet as qlightsheet # #################################################################################################################### # ################################### Imports part of FlatCAM ############################################# # #################################################################################################################### # Various -from appGUI import style_sheet +from appGUI.themes import dark_style_sheet, light_style_sheet from appCommon.Common import LoudDict from appCommon.Common import color_variant @@ -640,10 +641,11 @@ class App(QtCore.QObject): self.resource_location = 'assets/resources' elif self.options["global_theme"] == 'light': self.resource_location = 'assets/resources' + qlightsheet.STYLE_SHEET = light_style_sheet.L_STYLE_SHEET self.qapp.setStyleSheet(qdarktheme.load_stylesheet('light')) else: self.resource_location = 'assets/resources/dark_resources' - qdarksheet.STYLE_SHEET = style_sheet.D_STYLE_SHEET + qdarksheet.STYLE_SHEET = dark_style_sheet.D_STYLE_SHEET self.qapp.setStyleSheet(qdarktheme.load_stylesheet()) # ########################################################################################################### From ba494718c46931c32441d205344960a4b5d3421b Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 19 Apr 2022 01:06:33 +0300 Subject: [PATCH 09/15] - some more fixes for the 'Light' theme --- CHANGELOG.md | 1 + appGUI/themes/light_style_sheet.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e8eee44..24af0f0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ CHANGELOG for FlatCAM Evo beta 19.04.2022 - fixed and prettified the 'Light' theme +- some more fixes for the 'Light' theme 18.04.2022 diff --git a/appGUI/themes/light_style_sheet.py b/appGUI/themes/light_style_sheet.py index 36a5611b..b0e87a96 100644 --- a/appGUI/themes/light_style_sheet.py +++ b/appGUI/themes/light_style_sheet.py @@ -715,7 +715,8 @@ QToolBox::tab:selected:disabled { QAbstractScrollArea { selection-background-color: #4ca6e5; selection-color: #4d5157; - margin: 1px; + margin: 0px; + padding: 0px, 0px, 0px, 0px; } QAbstractScrollArea:disabled { selection-background-color: #0081db; @@ -776,7 +777,7 @@ QAbstractItemView QAbstractSpinBox, QAbstractItemView QComboBox, QAbstractItemView QAbstractButton { padding: 0; - margin: 1px; + margin: 0px; } QTreeView::branch { border-image: url(${path}/themes/light/svg/vertical_line__guides-stroke-inactive.svg) 0; @@ -833,7 +834,7 @@ QHeaderView { QHeaderView::section { background: #dadce0; text-align: left; - padding: 0 4px; + padding: 0 0px; border: none; } QHeaderView::section:horizontal:on, From c3b612bf491d8ece6c7a91efe064c43ade1d7896 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Tue, 19 Apr 2022 01:11:58 +0300 Subject: [PATCH 10/15] - made sure that the 'default' theme gets the 'stronger' colors --- CHANGELOG.md | 1 + appGUI/MainGUI.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24af0f0e..da764cc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ CHANGELOG for FlatCAM Evo beta - fixed and prettified the 'Light' theme - some more fixes for the 'Light' theme +- made sure that the 'default' theme gets the 'stronger' colors 18.04.2022 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index 89f33101..ee94602b 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -82,7 +82,7 @@ class MainGUI(QtWidgets.QMainWindow): """ if color in self.theme_safe_colors: - if self.app.options['global_theme'] == 'light': + if self.app.options['global_theme'] in ['default', 'light']: return color else: return self.theme_safe_colors[color] From de8fd2cceb09cd510100ecdcaa1b4027af608612 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 20 Apr 2022 14:35:39 +0300 Subject: [PATCH 11/15] - in Solderpast Plugin fixed the GCode generation; make sure that if no object is selected then the first Gerber object is autoselected - in Solderpaste Plugin fixed the CNCJob plotting - in Solderpaste Plugin added a new parameter 'Margin' which allows reducing how much solderpaste is added and therefore adding a space between the solderpaste and the pad boundary - all CNCJob objects generated by the Solderpaste plugin now have the GCode saved as source_code which can be saved also from the CNCJob object context menu, and edited --- CHANGELOG.md | 7 ++ appGUI/preferences/PreferencesUIManager.py | 1 + .../tools/ToolsSolderpastePrefGroupUI.py | 81 +++++++++++-------- appObjects/CNCJobObject.py | 21 ++--- appPlugins/ToolSolderPaste.py | 39 ++++++++- defaults.py | 1 + 6 files changed, 103 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da764cc0..4b4cbae8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ CHANGELOG for FlatCAM Evo beta ================================================= +20.04.2022 + +- in Solderpast Plugin fixed the GCode generation; make sure that if no object is selected then the first Gerber object is autoselected +- in Solderpaste Plugin fixed the CNCJob plotting +- in Solderpaste Plugin added a new parameter 'Margin' which allows reducing how much solderpaste is added and therefore adding a space between the solderpaste and the pad boundary +- all CNCJob objects generated by the Solderpaste plugin now have the GCode saved as source_code which can be saved also from the CNCJob object context menu, and edited + 19.04.2022 - fixed and prettified the 'Light' theme diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index 35a4a37d..cd3bcb53 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -575,6 +575,7 @@ class PreferencesUIManager(QtCore.QObject): # SolderPaste Dispensing Tool "tools_solderpaste_tools": self.ui.plugin_pref_form.tools_solderpaste_group.nozzle_tool_dia_entry, "tools_solderpaste_new": self.ui.plugin_pref_form.tools_solderpaste_group.addtool_entry, + "tools_solderpaste_margin": self.ui.plugin_pref_form.tools_solderpaste_group.margin_entry, "tools_solderpaste_z_start": self.ui.plugin_pref_form.tools_solderpaste_group.z_start_entry, "tools_solderpaste_z_dispense": self.ui.plugin_pref_form.tools_solderpaste_group.z_dispense_entry, "tools_solderpaste_z_stop": self.ui.plugin_pref_form.tools_solderpaste_group.z_stop_entry, diff --git a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index d4a83813..218c71d9 100644 --- a/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py @@ -60,8 +60,23 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.addtool_entry.set_range(0.0000001, 10000.0000) self.addtool_entry.setSingleStep(0.1) - param_grid.addWidget(self.addtool_entry_lbl, 1, 0) - param_grid.addWidget(self.addtool_entry, 1, 1) + param_grid.addWidget(self.addtool_entry_lbl, 2, 0) + param_grid.addWidget(self.addtool_entry, 2, 1) + + # Margin + self.margin_label = FCLabel('%s:' % _("Margin")) + self.margin_label.setToolTip('%s %s' % ( + _("Offset from the boundary."), + _("Fraction of tool diameter.") + ) + ) + self.margin_entry = FCDoubleSpinner(suffix='%') + self.margin_entry.set_range(-100.0000, 100.0000) + self.margin_entry.set_precision(self.decimals) + self.margin_entry.setSingleStep(0.1) + + param_grid.addWidget(self.margin_label, 4, 0) + param_grid.addWidget(self.margin_entry, 4, 1) # Z dispense start self.z_start_entry = FCDoubleSpinner() @@ -73,8 +88,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_start_label.setToolTip( _("The height (Z) when solder paste dispensing starts.") ) - param_grid.addWidget(self.z_start_label, 2, 0) - param_grid.addWidget(self.z_start_entry, 2, 1) + param_grid.addWidget(self.z_start_label, 6, 0) + param_grid.addWidget(self.z_start_entry, 6, 1) # Z dispense self.z_dispense_entry = FCDoubleSpinner() @@ -86,8 +101,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_dispense_label.setToolTip( _("The height (Z) when doing solder paste dispensing.") ) - param_grid.addWidget(self.z_dispense_label, 3, 0) - param_grid.addWidget(self.z_dispense_entry, 3, 1) + param_grid.addWidget(self.z_dispense_label, 8, 0) + param_grid.addWidget(self.z_dispense_entry, 8, 1) # Z dispense stop self.z_stop_entry = FCDoubleSpinner() @@ -99,8 +114,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_stop_label.setToolTip( _("The height (Z) when solder paste dispensing stops.") ) - param_grid.addWidget(self.z_stop_label, 4, 0) - param_grid.addWidget(self.z_stop_entry, 4, 1) + param_grid.addWidget(self.z_stop_label, 10, 0) + param_grid.addWidget(self.z_stop_entry, 101, 1) # Z travel self.z_travel_entry = FCDoubleSpinner() @@ -113,8 +128,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("The height (Z) for travel between pads\n" "(without dispensing solder paste).") ) - param_grid.addWidget(self.z_travel_label, 5, 0) - param_grid.addWidget(self.z_travel_entry, 5, 1) + param_grid.addWidget(self.z_travel_label, 12, 0) + param_grid.addWidget(self.z_travel_entry, 12, 1) # Z toolchange location self.z_toolchange_entry = FCDoubleSpinner() @@ -126,8 +141,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.z_toolchange_label.setToolTip( _("The height (Z) for tool (nozzle) change.") ) - param_grid.addWidget(self.z_toolchange_label, 6, 0) - param_grid.addWidget(self.z_toolchange_entry, 6, 1) + param_grid.addWidget(self.z_toolchange_label, 14, 0) + param_grid.addWidget(self.z_toolchange_entry, 14, 1) # X,Y Toolchange location self.xy_toolchange_entry = NumericalEvalTupleEntry(border_color='#0069A9') @@ -136,8 +151,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("The X,Y location for tool (nozzle) change.\n" "The format is (x, y) where x and y are real numbers.") ) - param_grid.addWidget(self.xy_toolchange_label, 7, 0) - param_grid.addWidget(self.xy_toolchange_entry, 7, 1) + param_grid.addWidget(self.xy_toolchange_label, 16, 0) + param_grid.addWidget(self.xy_toolchange_entry, 16, 1) # Feedrate X-Y self.frxy_entry = FCDoubleSpinner() @@ -149,8 +164,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): self.frxy_label.setToolTip( _("Feedrate (speed) while moving on the X-Y plane.") ) - param_grid.addWidget(self.frxy_label, 8, 0) - param_grid.addWidget(self.frxy_entry, 8, 1) + param_grid.addWidget(self.frxy_label, 18, 0) + param_grid.addWidget(self.frxy_entry, 18, 1) # Feedrate Z self.frz_entry = FCDoubleSpinner() @@ -163,8 +178,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("Feedrate (speed) while moving vertically\n" "(on Z plane).") ) - param_grid.addWidget(self.frz_label, 9, 0) - param_grid.addWidget(self.frz_entry, 9, 1) + param_grid.addWidget(self.frz_label, 20, 0) + param_grid.addWidget(self.frz_entry, 20, 1) # Feedrate Z Dispense self.frz_dispense_entry = FCDoubleSpinner() @@ -177,8 +192,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("Feedrate (speed) while moving up vertically\n" "to Dispense position (on Z plane).") ) - param_grid.addWidget(self.frz_dispense_label, 10, 0) - param_grid.addWidget(self.frz_dispense_entry, 10, 1) + param_grid.addWidget(self.frz_dispense_label, 22, 0) + param_grid.addWidget(self.frz_dispense_entry, 22, 1) # Spindle Speed Forward self.speedfwd_entry = FCSpinner() @@ -190,25 +205,25 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("The dispenser speed while pushing solder paste\n" "through the dispenser nozzle.") ) - param_grid.addWidget(self.speedfwd_label, 11, 0) - param_grid.addWidget(self.speedfwd_entry, 11, 1) + param_grid.addWidget(self.speedfwd_label, 24, 0) + param_grid.addWidget(self.speedfwd_entry, 24, 1) # Dwell Forward self.dwellfwd_entry = FCDoubleSpinner() self.dwellfwd_entry.set_precision(self.decimals) - self.dwellfwd_entry.set_range(0.0000001, 10000.0000) + self.dwellfwd_entry.set_range(0.0000, 10000.0000) self.dwellfwd_entry.setSingleStep(0.1) self.dwellfwd_label = FCLabel('%s:' % _("Dwell FWD")) self.dwellfwd_label.setToolTip( _("Pause after solder dispensing.") ) - param_grid.addWidget(self.dwellfwd_label, 12, 0) - param_grid.addWidget(self.dwellfwd_entry, 12, 1) + param_grid.addWidget(self.dwellfwd_label, 26, 0) + param_grid.addWidget(self.dwellfwd_entry, 26, 1) # Spindle Speed Reverse self.speedrev_entry = FCSpinner() - self.speedrev_entry.set_range(0, 999999) + self.speedrev_entry.set_range(0, 1000000) self.speedrev_entry.set_step(1000) self.speedrev_label = FCLabel('%s:' % _("Spindle Speed REV")) @@ -216,13 +231,13 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("The dispenser speed while retracting solder paste\n" "through the dispenser nozzle.") ) - param_grid.addWidget(self.speedrev_label, 13, 0) - param_grid.addWidget(self.speedrev_entry, 13, 1) + param_grid.addWidget(self.speedrev_label, 28, 0) + param_grid.addWidget(self.speedrev_entry, 28, 1) # Dwell Reverse self.dwellrev_entry = FCDoubleSpinner() self.dwellrev_entry.set_precision(self.decimals) - self.dwellrev_entry.set_range(0.0000001, 10000.0000) + self.dwellrev_entry.set_range(0.0000, 10000.0000) self.dwellrev_entry.setSingleStep(0.1) self.dwellrev_label = FCLabel('%s:' % _("Dwell REV")) @@ -230,8 +245,8 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): _("Pause after solder paste dispenser retracted,\n" "to allow pressure equilibrium.") ) - param_grid.addWidget(self.dwellrev_label, 14, 0) - param_grid.addWidget(self.dwellrev_entry, 14, 1) + param_grid.addWidget(self.dwellrev_label, 30, 0) + param_grid.addWidget(self.dwellrev_entry, 30, 1) # Preprocessors pp_label = FCLabel('%s:' % _('Preprocessor')) @@ -246,7 +261,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI): for it in range(self.pp_combo.count()): self.pp_combo.setItemData(it, self.pp_combo.itemText(it), QtCore.Qt.ItemDataRole.ToolTipRole) - param_grid.addWidget(pp_label, 15, 0) - param_grid.addWidget(self.pp_combo, 15, 1) + param_grid.addWidget(pp_label, 32, 0) + param_grid.addWidget(self.pp_combo, 32, 1) self.layout.addStretch() diff --git a/appObjects/CNCJobObject.py b/appObjects/CNCJobObject.py index 8cf9abb8..e795c3ef 100644 --- a/appObjects/CNCJobObject.py +++ b/appObjects/CNCJobObject.py @@ -1001,15 +1001,15 @@ class CNCJobObject(FlatCAMObj, CNCjob): if postamble == '': postamble = self.app.options["cncjob_append"] - try: - if self.special_group: - self.app.inform.emit('[WARNING_NOTCL] %s %s %s.' % - (_("This CNCJob object can't be processed because it is a"), - str(self.special_group), - _("CNCJob object"))) - return 'fail' - except AttributeError: - pass + # try: + # if self.special_group: + # self.app.inform.emit('[WARNING_NOTCL] %s %s %s.' % + # (_("This CNCJob object can't be processed because it is a"), + # str(self.special_group), + # _("CNCJob object"))) + # return 'fail' + # except AttributeError: + # pass # if this dict is not empty then the object is a Geometry object if self.obj_options['type'].lower() == 'geometry': @@ -1357,7 +1357,8 @@ class CNCJobObject(FlatCAMObj, CNCjob): self.plot2(tooldia=dia_plot, obj=self, visible=visible, gcode_parsed=gcode_parsed, kind=kind) self.shapes.redraw() - except (ObjectDeleted, AttributeError): + except (ObjectDeleted, AttributeError) as err: + self.app.log.debug("CNCJobObject.plot() --> %s" % str(err)) self.shapes.clear(update=True) if self.app.use_3d_engine: self.annotation.clear(update=True) diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index 58586eed..1a7efd3e 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -154,6 +154,7 @@ class SolderPaste(AppTool): "tools_solderpaste_z_dispense": self.ui.z_dispense_entry, "tools_solderpaste_z_stop": self.ui.z_stop_entry, "tools_solderpaste_z_travel": self.ui.z_travel_entry, + "tools_solderpaste_margin": self.ui.margin_entry, "tools_solderpaste_z_toolchange": self.ui.z_toolchange_entry, "tools_solderpaste_xy_toolchange": self.ui.xy_toolchange_entry, "tools_solderpaste_frxy": self.ui.frxy_entry, @@ -217,6 +218,12 @@ class SolderPaste(AppTool): if obj and obj.kind == 'gerber': obj_name = obj.obj_options['name'] self.ui.obj_combo.set_value(obj_name) + else: + # select first Gerber object found + for o in self.app.collection.get_list(): + if o.kind == 'gerber': + obj_name = o.obj_options['name'] + self.ui.obj_combo.set_value(obj_name) def build_ui(self): """ @@ -451,6 +458,8 @@ class SolderPaste(AppTool): current_row = self.ui.tools_table.currentRow() uid = tooluid if tooluid else int(self.ui.tools_table.item(current_row, 2).text()) + if uid < 0: + return for key in self.form_fields: self.tooltable_tools[uid]['data'].update({ key: self.form_fields[key].get_value() @@ -718,6 +727,10 @@ class SolderPaste(AppTool): :param use_thread: use thread, True or False :return: a Geometry type object """ + + # this is a percentage of the tool diameter + tool_margin = self.ui.margin_entry.get_value() + proc = self.app.proc_container.new('%s...' % _("Working")) obj = work_object @@ -795,7 +808,7 @@ class SolderPaste(AppTool): tooluid = 1 for tool in sorted_tools: - offset = tool / 2 + offset = ((tool_margin * tool) * 0.01) + (tool / 2) for uid, vl in self.tooltable_tools.items(): if float('%.*f' % (self.decimals, float(vl['tooldia']))) == tool: tooluid = int(uid) @@ -817,7 +830,7 @@ class SolderPaste(AppTool): # so we do a hack: get first the exterior in a form of LinearRings and then convert back to Polygon # because intersection does not work on LinearRings for g in work_geo: - # for whatever reason intersection on LinearRings does not work so we convert back to Polygons + # for whatever reason intersection on LinearRings does not work, so we convert back to Polygons poly = Polygon(g) x_min, y_min, x_max, y_max = poly.bounds @@ -1002,13 +1015,13 @@ class SolderPaste(AppTool): app_obj.log.debug("GeometryObject.mtool_gen_cncjob() --> generate_from_geometry2() failed") return 'fail' else: - tool_cnc_dict['gcode'] = StringIO(res) + tool_cnc_dict['gcode'] = res total_gcode += res # ## PARSE GCODE # ## tool_cnc_dict['gcode_parsed'] = new_obj.gcode_parse(tool_data=tool_cnc_dict['data']) - # TODO this serve for bounding box creation only; should be optimized + # TODO this serve for bounding box creation only; should be optimized. Using recursive bounds()? tool_cnc_dict['solid_geometry'] = unary_union([geo['geom'] for geo in tool_cnc_dict['gcode_parsed']]) # tell gcode_parse from which point to start drawing the lines depending on what kind of @@ -1019,6 +1032,9 @@ class SolderPaste(AppTool): }) tool_cnc_dict.clear() + used_tools = list(obj.tools.keys()) + new_obj.used_tools = used_tools + new_obj.source_file = StringIO(total_gcode) if use_thread: @@ -1330,6 +1346,21 @@ class SolderUI: param_grid.addWidget(self.z_travel_label, 0, 0) param_grid.addWidget(self.z_travel_entry, 0, 1) + # MARGIN + self.margin_label = FCLabel('%s:' % _("Margin")) + self.margin_label.setToolTip('%s %s' % ( + _("Offset from the boundary."), + _("Fraction of tool diameter.") + ) + ) + self.margin_entry = FCDoubleSpinner(suffix='%') + self.margin_entry.set_range(-100.0000, 100.0000) + self.margin_entry.set_precision(self.decimals) + self.margin_entry.setSingleStep(0.1) + + param_grid.addWidget(self.margin_label, 2, 0) + param_grid.addWidget(self.margin_entry, 2, 1) + # ############################################################################################################# # Dispense Frame # ############################################################################################################# diff --git a/defaults.py b/defaults.py index 2cd38352..8dc78ab6 100644 --- a/defaults.py +++ b/defaults.py @@ -650,6 +650,7 @@ class AppDefaults: # SolderPaste Tool "tools_solderpaste_tools": "1.0, 0.3", "tools_solderpaste_new": 0.3, + "tools_solderpaste_margin": 0.0, "tools_solderpaste_z_start": 0.05, "tools_solderpaste_z_dispense": 0.1, "tools_solderpaste_z_stop": 0.05, From 20808917804cea7fb3e6684c72b377d74a70161a Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 20 Apr 2022 17:33:11 +0300 Subject: [PATCH 12/15] - updated some custom widgets in the GUI elements such that the scrolling in the Preferences can be done without blocking on some of the widgets --- CHANGELOG.md | 3 +- appGUI/GUIElements.py | 416 +++++++++++++++++++++++------------------- 2 files changed, 234 insertions(+), 185 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b4cbae8..c9c056db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,11 @@ CHANGELOG for FlatCAM Evo beta 20.04.2022 -- in Solderpast Plugin fixed the GCode generation; make sure that if no object is selected then the first Gerber object is autoselected +- in Solderpaste Plugin fixed the GCode generation; make sure that if no object is selected then the first Gerber object is autoselected - in Solderpaste Plugin fixed the CNCJob plotting - in Solderpaste Plugin added a new parameter 'Margin' which allows reducing how much solderpaste is added and therefore adding a space between the solderpaste and the pad boundary - all CNCJob objects generated by the Solderpaste plugin now have the GCode saved as source_code which can be saved also from the CNCJob object context menu, and edited +- updated some custom widgets in the GUI elements such that the scrolling in the Preferences can be done without blocking on some of the widgets 19.04.2022 diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index c7b01204..bf07c8e3 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -1045,12 +1045,25 @@ class FCColorEntry(QtWidgets.QFrame): return value[7:9] +class FCSlider(QtWidgets.QSlider): + + def __int__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + + def wheelEvent(self, event: QtGui.QWheelEvent) -> None: + if self.hasFocus(): + super().wheelEvent(event) + else: + event.ignore() + + class FCSliderWithSpinner(QtWidgets.QFrame): def __init__(self, min=0, max=100, step=1, **kwargs): super().__init__(**kwargs) - self.slider = QtWidgets.QSlider(QtCore.Qt.Orientation.Horizontal) + self.slider = FCSlider(QtCore.Qt.Orientation.Horizontal) self.slider.setMinimum(min) self.slider.setMaximum(max) self.slider.setSingleStep(step) @@ -1075,7 +1088,7 @@ class FCSliderWithSpinner(QtWidgets.QFrame): self.spinner.valueChanged.connect(self._on_spinner) self.valueChanged = self.spinner.valueChanged - self.slider.installEventFilter(self) + # self.slider.installEventFilter(self) def get_value(self) -> int: return self.spinner.get_value() @@ -1091,11 +1104,11 @@ class FCSliderWithSpinner(QtWidgets.QFrame): slider_value = self.slider.value() self.spinner.set_value(slider_value) - def eventFilter(self, object, event): - if event.type() == QtCore.QEvent.Type.Wheel: - if not self.slider.hasFocus(): - return True - return False + # def eventFilter(self, object, event): + # if event.type() == QtCore.QEvent.Type.Wheel: + # if not self.slider.hasFocus(): + # return True + # return False class FCSpinner(QtWidgets.QSpinBox): @@ -1127,6 +1140,7 @@ class FCSpinner(QtWidgets.QSpinBox): self.prev_readyToEdit = True self.menu = None + self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) if policy: sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Preferred) @@ -1151,10 +1165,17 @@ class FCSpinner(QtWidgets.QSpinBox): else: super().keyPressEvent(event) - def wheelEvent(self, *args, **kwargs): - # should work only there is a focus in the lineedit of the SpinBox - if self.readyToEdit is False: - super().wheelEvent(*args, **kwargs) + def wheelEvent(self, event: QtGui.QWheelEvent) -> None: + if self.hasFocus(): + super().wheelEvent(event) + else: + event.ignore() + # def wheelEvent(self, *args, **kwargs): + # # should work only there is a focus in the lineedit of the SpinBox + # if self.readyToEdit is False: + # super().wheelEvent(*args, **kwargs) + # return + # self.clearFocus() def on_edit_finished(self): self.clearFocus() @@ -1326,173 +1347,6 @@ class FCSpinner(QtWidgets.QSpinBox): # return QtCore.QSize(EDIT_SIZE_HINT, default_hint_size.height()) -class FCDoubleSlider(QtWidgets.QSlider): - # frome here: https://stackoverflow.com/questions/42820380/use-float-for-qslider - - # create our our signal that we can connect to if necessary - doubleValueChanged = pyqtSignal(float) - - def __init__(self, decimals=3, orientation='horizontal', *args, **kargs): - if orientation == 'horizontal': - super(FCDoubleSlider, self).__init__(QtCore.Qt.Orientation.Horizontal, *args, **kargs) - else: - super(FCDoubleSlider, self).__init__(QtCore.Qt.Orientation.Vertical, *args, **kargs) - - self._multi = 10 ** decimals - - self.valueChanged.connect(self.emitDoubleValueChanged) - - def emitDoubleValueChanged(self): - value = float(super(FCDoubleSlider, self).value()) / self._multi - self.doubleValueChanged.emit(value) - - def value(self): - return float(super(FCDoubleSlider, self).value()) / self._multi - - def get_value(self): - return self.value() - - def setMinimum(self, value): - return super(FCDoubleSlider, self).setMinimum(int(value * self._multi)) - - def setMaximum(self, value): - return super(FCDoubleSlider, self).setMaximum(int(value * self._multi)) - - def setSingleStep(self, value): - return super(FCDoubleSlider, self).setSingleStep(int(value * self._multi)) - - def singleStep(self): - return float(super(FCDoubleSlider, self).singleStep()) / self._multi - - def set_value(self, value): - super(FCDoubleSlider, self).setValue(int(value * self._multi)) - - def set_precision(self, decimals): - self._multi = 10 ** decimals - - def set_range(self, min, max): - self.blockSignals(True) - self.setRange(int(min * self._multi), int(max * self._multi)) - self.blockSignals(False) - - -class FCSliderWithDoubleSpinner(QtWidgets.QFrame): - - def __init__(self, min=0, max=10000.0000, step=1, precision=4, orientation='horizontal', **kwargs): - super().__init__(**kwargs) - - self.slider = FCDoubleSlider(orientation=orientation) - self.slider.setMinimum(min) - self.slider.setMaximum(max) - self.slider.setSingleStep(step) - self.slider.set_range(min, max) - - self.spinner = FCDoubleSpinner() - self.spinner.set_range(min, max) - self.spinner.set_precision(precision) - - self.spinner.set_step(step) - self.spinner.setMinimumWidth(70) - - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, - QtWidgets.QSizePolicy.Policy.Preferred) - self.spinner.setSizePolicy(sizePolicy) - - self.layout = QtWidgets.QHBoxLayout() - self.layout.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - self.layout.setContentsMargins(0, 0, 0, 0) - self.layout.addWidget(self.slider) - self.layout.addWidget(self.spinner) - self.setLayout(self.layout) - - self.slider.doubleValueChanged.connect(self._on_slider) - self.spinner.valueChanged.connect(self._on_spinner) - - self.valueChanged = self.spinner.valueChanged - - def set_precision(self, prec): - self.spinner.set_precision(prec) - - def setSingleStep(self, step): - self.spinner.set_step(step) - - def set_range(self, min, max): - self.spinner.set_range(min, max) - self.slider.set_range(min, max) - - def set_minimum(self, min): - self.slider.setMinimum(min) - self.spinner.setMinimum(min) - - def set_maximum(self, max): - self.slider.setMaximum(max) - self.spinner.setMaximum(max) - - def get_value(self) -> float: - return self.spinner.get_value() - - def set_value(self, value: float): - self.spinner.set_value(value) - - def _on_spinner(self): - spinner_value = self.spinner.value() - self.slider.set_value(spinner_value) - - def _on_slider(self): - slider_value = self.slider.value() - self.spinner.set_value(slider_value) - - -class FCButtonWithDoubleSpinner(QtWidgets.QFrame): - - def __init__(self, min=0, max=100, step=1, decimals=4, button_text='', button_icon=None, callback=None, **kwargs): - super().__init__(**kwargs) - - self.button = QtWidgets.QToolButton() - if button_text != '': - self.button.setText(button_text) - if button_icon: - self.button.setIcon(button_icon) - - self.spinner = FCDoubleSpinner() - self.spinner.set_range(min, max) - self.spinner.set_step(step) - self.spinner.set_precision(decimals) - self.spinner.setMinimumWidth(70) - - sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, - QtWidgets.QSizePolicy.Policy.Preferred) - self.spinner.setSizePolicy(sizePolicy) - - self.layout = QtWidgets.QHBoxLayout() - self.layout.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) - self.layout.setContentsMargins(0, 0, 0, 0) - self.layout.addWidget(self.spinner) - self.layout.addWidget(self.button) - self.setLayout(self.layout) - - self.valueChanged = self.spinner.valueChanged - - self._callback = callback - self.button.clicked.connect(self._callback) - - def get_value(self) -> float: - return self.spinner.get_value() - - def set_value(self, value: float): - self.spinner.set_value(value) - - def set_callback(self, callback): - self._callback = callback - - def set_text(self, txt: str): - if txt: - self.button.setText(txt) - - def set_icon(self, icon: QtGui.QIcon): - self.button.setIcon(icon) - - class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): returnPressed = QtCore.pyqtSignal() confirmation_signal = QtCore.pyqtSignal(bool, float, float) @@ -1507,6 +1361,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): :param policy: by default the widget will not compact as much as possible on horizontal """ super(FCDoubleSpinner, self).__init__(parent) + self.cursor_pos = None self.readyToEdit = True self.editingFinished.connect(self.on_edit_finished) @@ -1536,6 +1391,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): self.prev_readyToEdit = True self.menu = None + self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) if policy: sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Preferred) @@ -1565,10 +1421,15 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): else: super().keyPressEvent(event) - def wheelEvent(self, *args, **kwargs): - # should work only there is a focus in the lineedit of the SpinBox - if self.readyToEdit is False: - super().wheelEvent(*args, **kwargs) + def wheelEvent(self, event: QtGui.QWheelEvent) -> None: + if self.hasFocus(): + super().wheelEvent(event) + else: + event.ignore() + # def wheelEvent(self, *args, **kwargs): + # # should work only there is a focus in the lineedit of the SpinBox + # if self.readyToEdit is False: + # super().wheelEvent(*args, **kwargs) def focusOutEvent(self, e): # don't focus out if the user requests an popup menu @@ -1747,6 +1608,189 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): # return QtCore.QSize(EDIT_SIZE_HINT, default_hint_size.height()) +class FCSliderWithDoubleSpinner(QtWidgets.QFrame): + + def __init__(self, min=0, max=10000.0000, step=1, precision=4, orientation='horizontal', **kwargs): + super().__init__(**kwargs) + + self.slider = FCDoubleSlider(orientation=orientation) + self.slider.setMinimum(min) + self.slider.setMaximum(max) + self.slider.setSingleStep(step) + self.slider.set_range(min, max) + + self.spinner = FCDoubleSpinner() + self.spinner.set_range(min, max) + self.spinner.set_precision(precision) + + self.spinner.set_step(step) + self.spinner.setMinimumWidth(70) + + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, + QtWidgets.QSizePolicy.Policy.Preferred) + self.spinner.setSizePolicy(sizePolicy) + + self.layout = QtWidgets.QHBoxLayout() + self.layout.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) + self.layout.setContentsMargins(0, 0, 0, 0) + self.layout.addWidget(self.slider) + self.layout.addWidget(self.spinner) + self.setLayout(self.layout) + + self.slider.doubleValueChanged.connect(self._on_slider) + self.spinner.valueChanged.connect(self._on_spinner) + + self.valueChanged = self.spinner.valueChanged + + self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + + def wheelEvent(self, event: QtGui.QWheelEvent) -> None: + if self.hasFocus(): + super().wheelEvent(event) + else: + event.ignore() + + def set_precision(self, prec): + self.spinner.set_precision(prec) + + def setSingleStep(self, step): + self.spinner.set_step(step) + + def set_range(self, min, max): + self.spinner.set_range(min, max) + self.slider.set_range(min, max) + + def set_minimum(self, min): + self.slider.setMinimum(min) + self.spinner.setMinimum(min) + + def set_maximum(self, max): + self.slider.setMaximum(max) + self.spinner.setMaximum(max) + + def get_value(self) -> float: + return self.spinner.get_value() + + def set_value(self, value: float): + self.spinner.set_value(value) + + def _on_spinner(self): + spinner_value = self.spinner.value() + self.slider.set_value(spinner_value) + + def _on_slider(self): + slider_value = self.slider.value() + self.spinner.set_value(slider_value) + + +class FCDoubleSlider(QtWidgets.QSlider): + # frome here: https://stackoverflow.com/questions/42820380/use-float-for-qslider + + # create our own signal that we can connect to if necessary + doubleValueChanged = pyqtSignal(float) + + def __init__(self, decimals=3, orientation='horizontal', *args, **kargs): + if orientation == 'horizontal': + super(FCDoubleSlider, self).__init__(QtCore.Qt.Orientation.Horizontal, *args, **kargs) + else: + super(FCDoubleSlider, self).__init__(QtCore.Qt.Orientation.Vertical, *args, **kargs) + + self._multi = 10 ** decimals + + self.valueChanged.connect(self.emitDoubleValueChanged) + + self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) + + def wheelEvent(self, event: QtGui.QWheelEvent) -> None: + if self.hasFocus(): + super().wheelEvent(event) + else: + event.ignore() + + def emitDoubleValueChanged(self): + value = float(super(FCDoubleSlider, self).value()) / self._multi + self.doubleValueChanged.emit(value) + + def value(self): + return float(super(FCDoubleSlider, self).value()) / self._multi + + def get_value(self): + return self.value() + + def setMinimum(self, value): + return super(FCDoubleSlider, self).setMinimum(int(value * self._multi)) + + def setMaximum(self, value): + return super(FCDoubleSlider, self).setMaximum(int(value * self._multi)) + + def setSingleStep(self, value): + return super(FCDoubleSlider, self).setSingleStep(int(value * self._multi)) + + def singleStep(self): + return float(super(FCDoubleSlider, self).singleStep()) / self._multi + + def set_value(self, value): + super(FCDoubleSlider, self).setValue(int(value * self._multi)) + + def set_precision(self, decimals): + self._multi = 10 ** decimals + + def set_range(self, min, max): + self.blockSignals(True) + self.setRange(int(min * self._multi), int(max * self._multi)) + self.blockSignals(False) + + +class FCButtonWithDoubleSpinner(QtWidgets.QFrame): + + def __init__(self, min=0, max=100, step=1, decimals=4, button_text='', button_icon=None, callback=None, **kwargs): + super().__init__(**kwargs) + + self.button = QtWidgets.QToolButton() + if button_text != '': + self.button.setText(button_text) + if button_icon: + self.button.setIcon(button_icon) + + self.spinner = FCDoubleSpinner() + self.spinner.set_range(min, max) + self.spinner.set_step(step) + self.spinner.set_precision(decimals) + self.spinner.setMinimumWidth(70) + + sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, + QtWidgets.QSizePolicy.Policy.Preferred) + self.spinner.setSizePolicy(sizePolicy) + + self.layout = QtWidgets.QHBoxLayout() + self.layout.setAlignment(QtCore.Qt.AlignmentFlag.AlignLeft | QtCore.Qt.AlignmentFlag.AlignVCenter) + self.layout.setContentsMargins(0, 0, 0, 0) + self.layout.addWidget(self.spinner) + self.layout.addWidget(self.button) + self.setLayout(self.layout) + + self.valueChanged = self.spinner.valueChanged + + self._callback = callback + self.button.clicked.connect(self._callback) + + def get_value(self) -> float: + return self.spinner.get_value() + + def set_value(self, value: float): + self.spinner.set_value(value) + + def set_callback(self, callback): + self._callback = callback + + def set_text(self, txt: str): + if txt: + self.button.setText(txt) + + def set_icon(self, icon: QtGui.QIcon): + self.button.setIcon(icon) + + class FCCheckBox(QtWidgets.QCheckBox): def __init__(self, label='', parent=None): super(FCCheckBox, self).__init__(str(label), parent) @@ -2491,6 +2535,7 @@ class FCComboBox(QtWidgets.QComboBox): self._set_last = False self._obj_type = None + self.setFocusPolicy(Qt.FocusPolicy.StrongFocus) if policy is True: sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Preferred) @@ -2508,8 +2553,11 @@ class FCComboBox(QtWidgets.QComboBox): return True return False - def wheelEvent(self, *args, **kwargs): - pass + def wheelEvent(self, event: QtGui.QWheelEvent) -> None: + if self.hasFocus(): + super().wheelEvent(event) + else: + event.ignore() def get_value(self): return str(self.currentText()) From 22ad4f79469ac556e174f4a7ad3f4c073b51aace Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 20 Apr 2022 18:04:30 +0300 Subject: [PATCH 13/15] - remade how the Preferences Tab is constructed such that now is made on demand for each section (tab) therefore making it faster to load (once a section is loaded - by clicking its tab - it will not be reloaded in the current session) --- CHANGELOG.md | 1 + appGUI/preferences/PreferencesUIManager.py | 189 +++++++++++++-------- 2 files changed, 123 insertions(+), 67 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9c056db..e019619f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG for FlatCAM Evo beta - in Solderpaste Plugin added a new parameter 'Margin' which allows reducing how much solderpaste is added and therefore adding a space between the solderpaste and the pad boundary - all CNCJob objects generated by the Solderpaste plugin now have the GCode saved as source_code which can be saved also from the CNCJob object context menu, and edited - updated some custom widgets in the GUI elements such that the scrolling in the Preferences can be done without blocking on some of the widgets +- remade how the Preferences Tab is constructed such that now is made on demand for each section (tab) therefore making it faster to load (once a section is loaded - by clicking its tab - it will not be reloaded in the current session) 19.04.2022 diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index cd3bcb53..b0d23f1f 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -28,6 +28,16 @@ class PreferencesUIManager(QtCore.QObject): """ super(PreferencesUIManager, self).__init__() + self.general_displayed = False + self.gerber_displayed = False + self.excellon_displayed = False + self.geometry_displayed = False + self.cnc_displayed = False + self.engrave_displayed = False + self.plugins_displayed = False + self.plugins2_displayed = False + self.util_displayed = False + self.defaults = defaults self.data_path = data_path self.ui = ui @@ -800,6 +810,14 @@ class PreferencesUIManager(QtCore.QObject): :return: None """ + self.pref_connect() + + # Initialize the color box's color in Preferences -> Global -> Colors + self.__init_color_pickers() + + # log.debug("Finished Preferences GUI form initialization.") + + def init_preferences_gui(self): gen_form = self.ui.general_pref_form try: self.ui.general_scroll_area.takeWidget() @@ -807,73 +825,13 @@ class PreferencesUIManager(QtCore.QObject): self.ui.app.log.debug("Nothing to remove") self.ui.general_scroll_area.setWidget(gen_form) gen_form.show() + self.general_displayed = True - ger_form = self.ui.gerber_pref_form - try: - self.ui.gerber_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.gerber_scroll_area.setWidget(ger_form) - ger_form.show() + def pref_connect(self): + self.pref_disconnect() - exc_form = self.ui.excellon_pref_form - try: - self.ui.excellon_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.excellon_scroll_area.setWidget(exc_form) - exc_form.show() - - geo_form = self.ui.geo_pref_form - try: - self.ui.geometry_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.geometry_scroll_area.setWidget(geo_form) - geo_form.show() - - cnc_form = self.ui.cncjob_pref_form - try: - self.ui.cncjob_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.cncjob_scroll_area.setWidget(cnc_form) - cnc_form.show() - - plugins_engraving_form = self.ui.plugin_eng_pref_form - try: - self.ui.plugins_engraving_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.plugins_engraving_scroll_area.setWidget(plugins_engraving_form) - plugins_engraving_form.show() - - plugins_form = self.ui.plugin_pref_form - try: - self.ui.tools_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.tools_scroll_area.setWidget(plugins_form) - plugins_form.show() - - plugins2_form = self.ui.plugin2_pref_form - try: - self.ui.tools2_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.tools2_scroll_area.setWidget(plugins2_form) - plugins2_form.show() - - fa_form = self.ui.util_pref_form - try: - self.ui.fa_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - self.ui.fa_scroll_area.setWidget(fa_form) - fa_form.show() - - # Initialize the color box's color in Preferences -> Global -> Colors - self.__init_color_pickers() + self.init_preferences_gui() + self.ui.pref_tab_area.tabBarClicked.connect(self.on_tab_clicked) # Button handlers self.ui.pref_save_button.clicked.connect(lambda: self.on_save_button(save_to_file=True)) @@ -881,9 +839,12 @@ class PreferencesUIManager(QtCore.QObject): self.ui.pref_close_button.clicked.connect(self.on_pref_close_button) self.ui.pref_defaults_button.clicked.connect(self.on_restore_defaults_preferences) - # log.debug("Finished Preferences GUI form initialization.") + def pref_disconnect(self): + try: + self.ui.pref_tab_area.tabBarClicked.disconnect() + except Exception: + pass - def clear_preferences_gui(self): # Disconnect Button handlers try: self.ui.pref_save_button.clicked.disconnect() @@ -950,6 +911,100 @@ class PreferencesUIManager(QtCore.QObject): except Exception: self.ui.app.log.debug("Nothing to remove") + def clear_preferences_gui(self): + self.pref_disconnect() + + def on_tab_clicked(self, idx): + if idx == 0 and self.general_displayed is False: + self.general_displayed = True + gen_form = self.ui.general_pref_form + try: + self.ui.general_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.general_scroll_area.setWidget(gen_form) + gen_form.show() + + if idx == 1 and self.gerber_displayed is False: + self.gerber_displayed = True + ger_form = self.ui.gerber_pref_form + try: + self.ui.gerber_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.gerber_scroll_area.setWidget(ger_form) + ger_form.show() + + if idx == 2 and self.excellon_displayed is False: + self.excellon_displayed = True + exc_form = self.ui.excellon_pref_form + try: + self.ui.excellon_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.excellon_scroll_area.setWidget(exc_form) + exc_form.show() + + if idx == 3 and self.geometry_displayed is False: + self.geometry_displayed = True + geo_form = self.ui.geo_pref_form + try: + self.ui.geometry_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.geometry_scroll_area.setWidget(geo_form) + geo_form.show() + + if idx == 4 and self.cnc_displayed is False: + self.cnc_displayed = True + cnc_form = self.ui.cncjob_pref_form + try: + self.ui.cncjob_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.cncjob_scroll_area.setWidget(cnc_form) + cnc_form.show() + + if idx == 5 and self.engrave_displayed is False: + self.engrave_displayed = True + plugins_engraving_form = self.ui.plugin_eng_pref_form + try: + self.ui.plugins_engraving_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.plugins_engraving_scroll_area.setWidget(plugins_engraving_form) + plugins_engraving_form.show() + + if idx == 6 and self.plugins_displayed is False: + self.plugins_displayed = True + plugins_form = self.ui.plugin_pref_form + try: + self.ui.tools_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.tools_scroll_area.setWidget(plugins_form) + plugins_form.show() + + if idx == 7 and self.plugins2_displayed is False: + self.plugins2_displayed = True + plugins2_form = self.ui.plugin2_pref_form + try: + self.ui.tools2_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.tools2_scroll_area.setWidget(plugins2_form) + plugins2_form.show() + + if idx == 8 and self.util_displayed is False: + self.util_displayed = True + fa_form = self.ui.util_pref_form + try: + self.ui.fa_scroll_area.takeWidget() + except Exception: + self.ui.app.log.debug("Nothing to remove") + self.ui.fa_scroll_area.setWidget(fa_form) + fa_form.show() + def __init_color_pickers(self): # Init Gerber Plot Colors self.ui.gerber_pref_form.gerber_gen_group.fill_color_entry.set_value(self.defaults['gerber_plot_fill']) From 6690e507f61c7e698da6b1771a6f18e42eb22ac8 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 20 Apr 2022 18:47:32 +0300 Subject: [PATCH 14/15] - a fix for the latest change in the Preferences Tab --- CHANGELOG.md | 1 + appGUI/preferences/PreferencesUIManager.py | 102 +++++++++++---------- 2 files changed, 56 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e019619f..16d8fb05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ CHANGELOG for FlatCAM Evo beta - all CNCJob objects generated by the Solderpaste plugin now have the GCode saved as source_code which can be saved also from the CNCJob object context menu, and edited - updated some custom widgets in the GUI elements such that the scrolling in the Preferences can be done without blocking on some of the widgets - remade how the Preferences Tab is constructed such that now is made on demand for each section (tab) therefore making it faster to load (once a section is loaded - by clicking its tab - it will not be reloaded in the current session) +- a fix for the latest change in the Preferences Tab 19.04.2022 diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index b0d23f1f..0e295799 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -809,6 +809,7 @@ class PreferencesUIManager(QtCore.QObject): :return: None """ + self.init_preferences_gui() self.pref_connect() @@ -818,6 +819,16 @@ class PreferencesUIManager(QtCore.QObject): # log.debug("Finished Preferences GUI form initialization.") def init_preferences_gui(self): + self.general_displayed = False + self.gerber_displayed = False + self.excellon_displayed = False + self.geometry_displayed = False + self.cnc_displayed = False + self.engrave_displayed = False + self.plugins_displayed = False + self.plugins2_displayed = False + self.util_displayed = False + gen_form = self.ui.general_pref_form try: self.ui.general_scroll_area.takeWidget() @@ -825,12 +836,10 @@ class PreferencesUIManager(QtCore.QObject): self.ui.app.log.debug("Nothing to remove") self.ui.general_scroll_area.setWidget(gen_form) gen_form.show() - self.general_displayed = True def pref_connect(self): self.pref_disconnect() - self.init_preferences_gui() self.ui.pref_tab_area.tabBarClicked.connect(self.on_tab_clicked) # Button handlers @@ -866,53 +875,52 @@ class PreferencesUIManager(QtCore.QObject): except Exception: pass - try: - self.ui.general_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.gerber_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.excellon_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.geometry_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.cncjob_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.plugins_engraving_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.tools_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.tools2_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - - try: - self.ui.fa_scroll_area.takeWidget() - except Exception: - self.ui.app.log.debug("Nothing to remove") - def clear_preferences_gui(self): self.pref_disconnect() + # try: + # self.ui.general_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.gerber_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.excellon_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.geometry_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.cncjob_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.plugins_engraving_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.tools_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.tools2_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") + # + # try: + # self.ui.fa_scroll_area.takeWidget() + # except Exception: + # self.ui.app.log.debug("Nothing to remove") def on_tab_clicked(self, idx): if idx == 0 and self.general_displayed is False: From d7d53399a0868d6da41d23f9e1bfe16436c1a25a Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 20 Apr 2022 21:27:20 +0300 Subject: [PATCH 15/15] - some changes in the Geometry Editor UI's and in some cases, fixes for the right-click close action --- CHANGELOG.md | 1 + appEditors/AppGeoEditor.py | 6 ++ appEditors/geo_plugins/GeoCirclePlugin.py | 56 ++++++++++----- appEditors/geo_plugins/GeoRectanglePlugin.py | 72 +++++++++++++------ .../geo_plugins/GeoSimplificationPlugin.py | 48 ++++++++----- appGUI/MainGUI.py | 8 +-- 6 files changed, 130 insertions(+), 61 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d8fb05..5e53c371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ CHANGELOG for FlatCAM Evo beta - updated some custom widgets in the GUI elements such that the scrolling in the Preferences can be done without blocking on some of the widgets - remade how the Preferences Tab is constructed such that now is made on demand for each section (tab) therefore making it faster to load (once a section is loaded - by clicking its tab - it will not be reloaded in the current session) - a fix for the latest change in the Preferences Tab +- some changes in the Geometry Editor UI's and in some cases, fixes for the right-click close action 19.04.2022 diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index c32d2e89..cc6839f4 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -3003,6 +3003,9 @@ class FCPaint(FCShapeTool): self.origin = (0, 0) self.draw_app.paint_tool.run() + def clean_up(self): + pass + class FCTransform(FCShapeTool): def __init__(self, draw_app): @@ -3016,6 +3019,9 @@ class FCTransform(FCShapeTool): self.origin = (0, 0) self.draw_app.transform_tool.run() + def clean_up(self): + pass + # ############################################### # ################ Main Application ############# diff --git a/appEditors/geo_plugins/GeoCirclePlugin.py b/appEditors/geo_plugins/GeoCirclePlugin.py index 5b86414c..bf45b5aa 100644 --- a/appEditors/geo_plugins/GeoCirclePlugin.py +++ b/appEditors/geo_plugins/GeoCirclePlugin.py @@ -187,48 +187,70 @@ class CircleEditorUI: self.circle_tool_box.addLayout(grid0) # Position - self.pos_lbl = FCLabel('%s' % _("Position"), bold=True) + self.pos_lbl = FCLabel('%s' % _("Position"), color='red', bold=True) grid0.addWidget(self.pos_lbl, 0, 0, 1, 3) + # ############################################################################################################# + # Position Frame + # ############################################################################################################# + pos_frame = FCFrame() + grid0.addWidget(pos_frame, 2, 0, 1, 2) + + pos_grid = GLay(v_spacing=5, h_spacing=3) + pos_frame.setLayout(pos_grid) + # X Pos self.x_lbl = FCLabel('%s:' % _("X")) self.x_entry = FCDoubleSpinner() self.x_entry.set_precision(self.decimals) self.x_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.x_lbl, 2, 0) - grid0.addWidget(self.x_entry, 2, 1, 1, 2) + pos_grid.addWidget(self.x_lbl, 0, 0) + pos_grid.addWidget(self.x_entry, 0, 1, 1, 2) # Y Pos self.y_lbl = FCLabel('%s:' % _("Y")) self.y_entry = FCDoubleSpinner() self.y_entry.set_precision(self.decimals) self.y_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.y_lbl, 4, 0) - grid0.addWidget(self.y_entry, 4, 1, 1, 2) + pos_grid.addWidget(self.y_lbl, 2, 0) + pos_grid.addWidget(self.y_entry, 2, 1, 1, 2) + + # Radius + self.radius_lbl = FCLabel('%s' % _("Radius"), bold=True, color='blue') + grid0.addWidget(self.radius_lbl, 4, 0) + + # ############################################################################################################# + # Radius Frame + # ############################################################################################################# + rad_frame = FCFrame() + grid0.addWidget(rad_frame, 6, 0, 1, 2) + + rad_grid = GLay(v_spacing=5, h_spacing=3) + rad_frame.setLayout(rad_grid) # Radius X - self.radius_x_lbl = FCLabel('%s X:' % _("Radius")) + self.radius_x_lbl = FCLabel('%s:' % "X") self.radius_x_entry = FCDoubleSpinner() self.radius_x_entry.set_precision(self.decimals) self.radius_x_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.radius_x_lbl, 6, 0) - grid0.addWidget(self.radius_x_entry, 6, 1) + rad_grid.addWidget(self.radius_x_lbl, 0, 0) + rad_grid.addWidget(self.radius_x_entry, 0, 1) # Radius Y - self.radius_y_lbl = FCLabel('%s Y:' % _("Radius")) + self.radius_y_lbl = FCLabel('%s:' % "Y") self.radius_y_entry = FCDoubleSpinner() self.radius_y_entry.set_precision(self.decimals) self.radius_y_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.radius_y_lbl, 7, 0) - grid0.addWidget(self.radius_y_entry, 7, 1) + rad_grid.addWidget(self.radius_y_lbl, 1, 0) + rad_grid.addWidget(self.radius_y_entry, 1, 1) # Angle self.angle_lbl = FCLabel('%s:' % _("Angle")) self.angle_entry = FCDoubleSpinner() self.angle_entry.set_precision(self.decimals) self.angle_entry.set_range(0.0000, 360.0000) - grid0.addWidget(self.angle_lbl, 8, 0) - grid0.addWidget(self.angle_entry, 8, 1) + rad_grid.addWidget(self.angle_lbl, 2, 0) + rad_grid.addWidget(self.angle_entry, 2, 1) # Radius link self.radius_link_btn = QtWidgets.QToolButton() @@ -236,13 +258,15 @@ class CircleEditorUI: self.radius_link_btn.setSizePolicy(QtWidgets.QSizePolicy.Policy.MinimumExpanding, QtWidgets.QSizePolicy.Policy.Expanding) self.radius_link_btn.setCheckable(True) - grid0.addWidget(self.radius_link_btn, 6, 2, 3, 1) + rad_grid.addWidget(self.radius_link_btn, 0, 2, 3, 1) # Buttons self.add_button = FCButton(_("Add")) self.add_button.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png')) grid0.addWidget(self.add_button, 18, 0, 1, 3) + GLay.set_common_column_size([grid0, pos_grid, rad_grid], 0) + self.layout.addStretch(1) # Note @@ -256,14 +280,14 @@ class CircleEditorUI: def on_link_checked(self, checked): if checked: - self.radius_x_lbl.set_value('%s:' % _("Radius")) + self.radius_x_lbl.set_value('%s:' % _("Value")) self.radius_y_lbl.setDisabled(True) self.radius_y_entry.setDisabled(True) self.radius_y_entry.set_value(self.radius_x_entry.get_value()) self.angle_lbl.setDisabled(True) self.angle_entry.setDisabled(True) else: - self.radius_x_lbl.set_value('%s X:' % _("Radius")) + self.radius_x_lbl.set_value('%s:' % "X") self.radius_y_lbl.setDisabled(False) self.radius_y_entry.setDisabled(False) self.angle_lbl.setDisabled(False) diff --git a/appEditors/geo_plugins/GeoRectanglePlugin.py b/appEditors/geo_plugins/GeoRectanglePlugin.py index d76a9aed..6815767d 100644 --- a/appEditors/geo_plugins/GeoRectanglePlugin.py +++ b/appEditors/geo_plugins/GeoRectanglePlugin.py @@ -219,8 +219,20 @@ class RectangleEditorUI: grid0 = GLay(v_spacing=5, h_spacing=3) self.rect_tool_box.addLayout(grid0) + # Position + self.pos_lbl = FCLabel('%s' % _("Position"), bold=True, color='red') + grid0.addWidget(self.pos_lbl, 0, 0, 1, 2) + # ############################################################################################################# + # Position Frame + # ############################################################################################################# + pos_frame = FCFrame() + grid0.addWidget(pos_frame, 2, 0, 1, 2) + + pos_grid = GLay(v_spacing=5, h_spacing=3) + pos_frame.setLayout(pos_grid) + # Anchor - self.anchor_lbl = FCLabel('%s:' % _("Anchor"), bold=True) + self.anchor_lbl = FCLabel('%s:' % _("Anchor"), bold=False) choices = [ {"label": _("T Left"), "value": "tl"}, {"label": _("T Right"), "value": "tr"}, @@ -229,31 +241,38 @@ class RectangleEditorUI: {"label": _("Center"), "value": "c"} ] self.anchor_radio = RadioSetCross(choices, compact=True) - grid0.addWidget(self.anchor_lbl, 0, 0) - grid0.addWidget(self.anchor_radio, 0, 1) - - # Position - self.pos_lbl = FCLabel('%s' % _("Position"), bold=True) - grid0.addWidget(self.pos_lbl, 2, 0, 1, 2) + pos_grid.addWidget(self.anchor_lbl, 0, 0) + pos_grid.addWidget(self.anchor_radio, 0, 1) # X Pos self.x_lbl = FCLabel('%s:' % _("X")) self.x_entry = FCDoubleSpinner() self.x_entry.set_precision(self.decimals) self.x_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.x_lbl, 4, 0) - grid0.addWidget(self.x_entry, 4, 1) + pos_grid.addWidget(self.x_lbl, 2, 0) + pos_grid.addWidget(self.x_entry, 2, 1) # Y Pos self.y_lbl = FCLabel('%s:' % _("Y")) self.y_entry = FCDoubleSpinner() self.y_entry.set_precision(self.decimals) self.y_entry.set_range(-10000.0000, 10000.0000) - grid0.addWidget(self.y_lbl, 6, 0) - grid0.addWidget(self.y_entry, 6, 1) + pos_grid.addWidget(self.y_lbl, 4, 0) + pos_grid.addWidget(self.y_entry, 4, 1) + + self.corner_lbl = FCLabel('%s' % _("Corner"), bold=True, color='green') + grid0.addWidget(self.corner_lbl, 4, 0, 1, 2) + # ############################################################################################################# + # Corner Frame + # ############################################################################################################# + cor_frame = FCFrame() + grid0.addWidget(cor_frame, 6, 0, 1, 2) + + cor_grid = GLay(v_spacing=5, h_spacing=3) + cor_frame.setLayout(cor_grid) # Corner Type - self.corner_lbl = FCLabel('%s:' % _("Corner")) + self.corner_lbl = FCLabel('%s:' % _("Type")) self.corner_lbl.setToolTip( _("There are 3 types of corners:\n" " - 'Round': the corners are rounded\n" @@ -265,38 +284,47 @@ class RectangleEditorUI: {'label': _('Square'), 'value': 's'}, {'label': _('Beveled'), 'value': 'b'}, ], orientation='vertical', compact=True) - grid0.addWidget(self.corner_lbl, 8, 0) - grid0.addWidget(self.corner_radio, 8, 1) + cor_grid.addWidget(self.corner_lbl, 0, 0) + cor_grid.addWidget(self.corner_radio, 0, 1) # Radius self.radius_lbl = FCLabel('%s:' % _("Radius")) self.radius_entry = FCDoubleSpinner() self.radius_entry.set_precision(self.decimals) self.radius_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(self.radius_lbl, 10, 0) - grid0.addWidget(self.radius_entry, 10, 1) + cor_grid.addWidget(self.radius_lbl, 2, 0) + cor_grid.addWidget(self.radius_entry, 2, 1) # Size - self.size_lbl = FCLabel('%s' % _("Size"), bold=True) - grid0.addWidget(self.size_lbl, 12, 0, 1, 2) + self.size_lbl = FCLabel('%s' % _("Size"), bold=True, color='indigo') + grid0.addWidget(self.size_lbl, 8, 0, 1, 2) + # ############################################################################################################# + # Size Frame + # ############################################################################################################# + size_frame = FCFrame() + grid0.addWidget(size_frame, 10, 0, 1, 2) + + size_grid = GLay(v_spacing=5, h_spacing=3) + size_frame.setLayout(size_grid) # Length self.length_lbl = FCLabel('%s:' % _("Length")) self.length_entry = NumericalEvalEntry() - grid0.addWidget(self.length_lbl, 14, 0) - grid0.addWidget(self.length_entry, 14, 1) + size_grid.addWidget(self.length_lbl, 0, 0) + size_grid.addWidget(self.length_entry, 0, 1) # Width self.width_lbl = FCLabel('%s:' % _("Width")) self.width_entry = NumericalEvalEntry() - grid0.addWidget(self.width_lbl, 16, 0) - grid0.addWidget(self.width_entry, 16, 1) + size_grid.addWidget(self.width_lbl, 2, 0) + size_grid.addWidget(self.width_entry, 2, 1) # Buttons self.add_button = FCButton(_("Add")) self.add_button.setIcon(QtGui.QIcon(self.app.resource_location + '/plus16.png')) grid0.addWidget(self.add_button, 18, 0, 1, 2) + GLay.set_common_column_size([grid0, pos_grid, cor_grid, size_grid], 0) self.layout.addStretch(1) # Note diff --git a/appEditors/geo_plugins/GeoSimplificationPlugin.py b/appEditors/geo_plugins/GeoSimplificationPlugin.py index adcd898d..cc89b1e1 100644 --- a/appEditors/geo_plugins/GeoSimplificationPlugin.py +++ b/appEditors/geo_plugins/GeoSimplificationPlugin.py @@ -196,40 +196,49 @@ class SimplificationEditorUI: self.simp_tools_box.addLayout(grid0) # Coordinates - coords_lbl = FCLabel('%s' % _("Coordinates"), bold=True) + coords_lbl = FCLabel('%s' % _("Coordinates"), bold=True, color='red') coords_lbl.setToolTip( _("The coordinates of the selected geometry element.") ) - grid0.addWidget(coords_lbl, 22, 0, 1, 3) + grid0.addWidget(coords_lbl, 0, 0, 1, 2) + + # ############################################################################################################# + # Coordinates Frame + # ############################################################################################################# + coors_frame = FCFrame() + grid0.addWidget(coors_frame, 2, 0, 1, 2) + + coords_grid = GLay(v_spacing=5, h_spacing=3) + coors_frame.setLayout(coords_grid) self.geo_coords_entry = FCTextEdit() self.geo_coords_entry.setPlaceholderText( _("The coordinates of the selected geometry element.") ) - grid0.addWidget(self.geo_coords_entry, 24, 0, 1, 3) + coords_grid.addWidget(self.geo_coords_entry, 0, 0, 1, 2) # Vertex Points Number - vertex_lbl = FCLabel('%s' % _("Vertex Points"), bold=True) + vertex_lbl = FCLabel('%s:' % _("Vertex Points"), bold=False) vertex_lbl.setToolTip( _("The number of vertex points in the selected geometry element.") ) self.geo_vertex_entry = FCEntry(decimals=self.decimals) self.geo_vertex_entry.setReadOnly(True) - grid0.addWidget(vertex_lbl, 26, 0) - grid0.addWidget(self.geo_vertex_entry, 26, 1, 1, 2) - - separator_line = QtWidgets.QFrame() - separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) - separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) - grid0.addWidget(separator_line, 28, 0, 1, 3) + coords_grid.addWidget(vertex_lbl, 2, 0) + coords_grid.addWidget(self.geo_vertex_entry, 2, 1) # Simplification Title - simplif_lbl = FCLabel('%s' % _("Simplification"), bold=True) - simplif_lbl.setToolTip( - _("Simplify a geometry by reducing its vertex points number.") - ) - grid0.addWidget(simplif_lbl, 30, 0, 1, 3) + par_lbl = FCLabel('%s' % _("Parameters"), bold=True, color='blue') + grid0.addWidget(par_lbl, 4, 0, 1, 2) + # ############################################################################################################# + # Parameters Frame + # ############################################################################################################# + par_frame = FCFrame() + grid0.addWidget(par_frame, 6, 0, 1, 2) + + par_grid = GLay(v_spacing=5, h_spacing=3) + par_frame.setLayout(par_grid) # Simplification Tolerance simplification_tol_lbl = FCLabel('%s' % _("Tolerance"), bold=True) @@ -242,8 +251,8 @@ class SimplificationEditorUI: self.geo_tol_entry.setSingleStep(10 ** -self.decimals) self.geo_tol_entry.set_range(0.0000, 10000.0000) - grid0.addWidget(simplification_tol_lbl, 32, 0) - grid0.addWidget(self.geo_tol_entry, 32, 1, 1, 2) + par_grid.addWidget(simplification_tol_lbl, 0, 0) + par_grid.addWidget(self.geo_tol_entry, 0, 1) # Simplification button self.simplification_btn = FCButton(_("Simplify")) @@ -258,6 +267,7 @@ class SimplificationEditorUI: } """) - grid0.addWidget(self.simplification_btn, 34, 0, 1, 3) + self.layout.addWidget(self.simplification_btn) + GLay.set_common_column_size([grid0, coords_grid, par_grid], 0) self.layout.addStretch(1) diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index ee94602b..8aa2d52f 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -749,7 +749,7 @@ class MainGUI(QtWidgets.QMainWindow): '%s\t%s' % (_("Copy Geom"), _('C'))) self.geo_delete_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/deleteshape16.png'), - '%s\t%s' % (_("Delete Shape"), _('DEL')) + '%s\t%s' % (_("Delete"), _('DEL')) ) self.geo_editor_menu.addSeparator() self.geo_move_menuitem = self.geo_editor_menu.addAction( @@ -1297,7 +1297,7 @@ class MainGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/copy32.png'), _("Copy Shape(s)")) self.geo_delete_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete Shape")) + QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete")) self.geo_transform_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/transform.png'), _("Transformations")) self.geo_edit_toolbar.addSeparator() @@ -2665,7 +2665,7 @@ class MainGUI(QtWidgets.QMainWindow): self.geo_copy_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/copy32.png'), _("Copy Objects")) self.geo_delete_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete Shape")) + QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete")) self.geo_transform_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/transform.png'), _("Transformations")) @@ -5247,7 +5247,7 @@ class ShortcutsTab(QtWidgets.QWidget): _('Space'), _("Rotate Geometry"), _('ENTER'), _("Finish drawing for certain tools"), _('Esc'), _("Abort and return to Select"), - _('Del'), _("Delete Shape") + _('Del'), _("Delete") ) # EXCELLON EDITOR SHORTCUT LIST