From a973275f979a29b82c2dcbc8a6dfd66b46f89fc4 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 11 May 2022 20:13:36 +0300 Subject: [PATCH] - fixed a crash when creating a Document object due of changes in Qt6 (missing QtGui.Qt) - in Document object fixed the issue with not setting selection color when in a dark theme (essentially got rid of using QPalette) - in dark theme stylesheet changed the indent of the QCheckBox (and in Radio buttons too) - updated the FClabel widget with some more properties - updated the hack to make sure that the Editor sub-tools do not lose the stylesheet of the background - updated the disabled project item color default value for the dark theme --- CHANGELOG.md | 9 +++ appEditors/AppGerberEditor.py | 2 +- appEditors/exc_plugins/ExcCopyPlugin.py | 6 +- appEditors/exc_plugins/ExcDrillArrayPlugin.py | 6 +- appEditors/exc_plugins/ExcDrillPlugin.py | 6 +- appEditors/exc_plugins/ExcResizePlugin.py | 6 +- appEditors/exc_plugins/ExcSlotArrayPlugin.py | 6 +- appEditors/exc_plugins/ExcSlotPlugin.py | 6 +- appEditors/geo_plugins/GeoBufferPlugin.py | 6 +- appEditors/geo_plugins/GeoCirclePlugin.py | 6 +- appEditors/geo_plugins/GeoCopyPlugin.py | 6 +- appEditors/geo_plugins/GeoPaintPlugin.py | 6 +- appEditors/geo_plugins/GeoPathPlugin.py | 6 +- appEditors/geo_plugins/GeoRectanglePlugin.py | 8 +-- .../geo_plugins/GeoSimplificationPlugin.py | 6 +- appEditors/geo_plugins/GeoTextPlugin.py | 6 +- .../geo_plugins/GeoTransformationPlugin.py | 6 +- appGUI/GUIElements.py | 51 ++++++++++++--- appGUI/ObjectUI.py | 12 +--- .../general/GeneralGUIPrefGroupUI.py | 8 ++- appGUI/themes/dark_style_sheet.py | 2 +- appObjects/DocumentObject.py | 46 +++++++++----- appPlugins/ToolAlignObjects.py | 2 +- appPlugins/ToolCalculators.py | 2 +- appPlugins/ToolCopperThieving.py | 2 +- appPlugins/ToolCutOut.py | 2 +- appPlugins/ToolDblSided.py | 2 +- appPlugins/ToolDistance.py | 2 +- appPlugins/ToolDrilling.py | 2 +- appPlugins/ToolEtchCompensation.py | 2 +- appPlugins/ToolExtract.py | 2 +- appPlugins/ToolFiducials.py | 2 +- appPlugins/ToolFilm.py | 2 +- appPlugins/ToolFollow.py | 2 +- appPlugins/ToolImage.py | 2 +- appPlugins/ToolInvertGerber.py | 2 +- appPlugins/ToolIsolation.py | 6 +- appPlugins/ToolLevelling.py | 24 +++---- appPlugins/ToolMarkers.py | 2 +- appPlugins/ToolMilling.py | 2 +- appPlugins/ToolNCC.py | 2 +- appPlugins/ToolOptimal.py | 2 +- appPlugins/ToolPaint.py | 2 +- appPlugins/ToolPanelize.py | 2 +- appPlugins/ToolPcbWizard.py | 2 +- appPlugins/ToolPunchGerber.py | 2 +- appPlugins/ToolQRCode.py | 14 ++--- appPlugins/ToolReport.py | 2 +- appPlugins/ToolRulesCheck.py | 2 +- appPlugins/ToolSolderPaste.py | 2 +- appPlugins/ToolSub.py | 2 +- appPlugins/ToolTransform.py | 2 +- appTool.py | 62 +++++++------------ defaults.py | 2 +- 54 files changed, 204 insertions(+), 180 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0744f87a..9f567d0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ CHANGELOG for FlatCAM Evo beta ================================================= +11.05.2022 + +- fixed a crash when creating a Document object due of changes in Qt6 (missing QtGui.Qt) +- in Document object fixed the issue with not setting selection color when in a dark theme (essentially got rid of using QPalette) +- in dark theme stylesheet changed the indent of the QCheckBox (and in Radio buttons too) +- updated the FClabel widget with some more properties +- updated the hack to make sure that the Editor sub-tools do not lose the stylesheet of the background +- updated the disabled project item color default value for the dark theme + 10.05.2022 - upgraded the Geometry Editor main UI diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 2e41cdc8..52b9a832 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -7219,7 +7219,7 @@ class TransformEditorTool(AppTool): except AttributeError: pass - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Transformation")) diff --git a/appEditors/exc_plugins/ExcCopyPlugin.py b/appEditors/exc_plugins/ExcCopyPlugin.py index 6ef646be..f2610c71 100644 --- a/appEditors/exc_plugins/ExcCopyPlugin.py +++ b/appEditors/exc_plugins/ExcCopyPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class ExcCopyEditorTool(AppTool): +class ExcCopyEditorTool(AppToolEditor): """ Copy Plugin """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -36,7 +36,7 @@ class ExcCopyEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor CopyTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/exc_plugins/ExcDrillArrayPlugin.py b/appEditors/exc_plugins/ExcDrillArrayPlugin.py index 93c24316..382135ea 100644 --- a/appEditors/exc_plugins/ExcDrillArrayPlugin.py +++ b/appEditors/exc_plugins/ExcDrillArrayPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class ExcDrillArrayEditorTool(AppTool): +class ExcDrillArrayEditorTool(AppToolEditor): """ Create an array of drill holes """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -31,7 +31,7 @@ class ExcDrillArrayEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Exc Editor ArrayTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/exc_plugins/ExcDrillPlugin.py b/appEditors/exc_plugins/ExcDrillPlugin.py index 387ff3f3..b5c396cb 100644 --- a/appEditors/exc_plugins/ExcDrillPlugin.py +++ b/appEditors/exc_plugins/ExcDrillPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class ExcDrillEditorTool(AppTool): +class ExcDrillEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -36,7 +36,7 @@ class ExcDrillEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor ToolPath()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/exc_plugins/ExcResizePlugin.py b/appEditors/exc_plugins/ExcResizePlugin.py index bdea50fb..e4d117d7 100644 --- a/appEditors/exc_plugins/ExcResizePlugin.py +++ b/appEditors/exc_plugins/ExcResizePlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class ExcResizeEditorTool(AppTool): +class ExcResizeEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -36,7 +36,7 @@ class ExcResizeEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor ToolPath()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/exc_plugins/ExcSlotArrayPlugin.py b/appEditors/exc_plugins/ExcSlotArrayPlugin.py index 57950e61..19fb582d 100644 --- a/appEditors/exc_plugins/ExcSlotArrayPlugin.py +++ b/appEditors/exc_plugins/ExcSlotArrayPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class ExcSlotArrayEditorTool(AppTool): +class ExcSlotArrayEditorTool(AppToolEditor): """ Create an array of drill holes """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -33,7 +33,7 @@ class ExcSlotArrayEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Exc Editor ArrayTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/exc_plugins/ExcSlotPlugin.py b/appEditors/exc_plugins/ExcSlotPlugin.py index 22a85634..65d8ba03 100644 --- a/appEditors/exc_plugins/ExcSlotPlugin.py +++ b/appEditors/exc_plugins/ExcSlotPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class ExcSlotEditorTool(AppTool): +class ExcSlotEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -36,7 +36,7 @@ class ExcSlotEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor ToolPath()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoBufferPlugin.py b/appEditors/geo_plugins/GeoBufferPlugin.py index 9af28c53..ec90c64a 100644 --- a/appEditors/geo_plugins/GeoBufferPlugin.py +++ b/appEditors/geo_plugins/GeoBufferPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class BufferSelectionTool(AppTool): +class BufferSelectionTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -30,7 +30,7 @@ class BufferSelectionTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor ToolBuffer()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoCirclePlugin.py b/appEditors/geo_plugins/GeoCirclePlugin.py index c0ab2070..f3be68e8 100644 --- a/appEditors/geo_plugins/GeoCirclePlugin.py +++ b/appEditors/geo_plugins/GeoCirclePlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class CircleEditorTool(AppTool): +class CircleEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -30,7 +30,7 @@ class CircleEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor CircleTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoCopyPlugin.py b/appEditors/geo_plugins/GeoCopyPlugin.py index 97bd1db7..9d1e2f0d 100644 --- a/appEditors/geo_plugins/GeoCopyPlugin.py +++ b/appEditors/geo_plugins/GeoCopyPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class CopyEditorTool(AppTool): +class CopyEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -36,7 +36,7 @@ class CopyEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor CopyTool()") - AppTool.run(self) + AppToolEditor.run(self) # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoPaintPlugin.py b/appEditors/geo_plugins/GeoPaintPlugin.py index 2cf0aeee..139088dc 100644 --- a/appEditors/geo_plugins/GeoPaintPlugin.py +++ b/appEditors/geo_plugins/GeoPaintPlugin.py @@ -7,13 +7,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class PaintOptionsTool(AppTool): +class PaintOptionsTool(AppToolEditor): """ Inputs to specify how to paint the selected polygons. """ def __init__(self, app, fcdraw): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.app = app self.fcdraw = fcdraw @@ -26,7 +26,7 @@ class PaintOptionsTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor ToolPaint()") - AppTool.run(self) + AppToolEditor.run(self) # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoPathPlugin.py b/appEditors/geo_plugins/GeoPathPlugin.py index 6dc5cd6c..622e969c 100644 --- a/appEditors/geo_plugins/GeoPathPlugin.py +++ b/appEditors/geo_plugins/GeoPathPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class PathEditorTool(AppTool): +class PathEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -36,7 +36,7 @@ class PathEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor ToolPath()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoRectanglePlugin.py b/appEditors/geo_plugins/GeoRectanglePlugin.py index 7a2a7eff..7e92876e 100644 --- a/appEditors/geo_plugins/GeoRectanglePlugin.py +++ b/appEditors/geo_plugins/GeoRectanglePlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class RectangleEditorTool(AppTool): +class RectangleEditorTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app, plugin_name): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -30,7 +30,7 @@ class RectangleEditorTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor RectangleTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: @@ -301,7 +301,7 @@ class RectangleEditorUI: size_frame.setLayout(size_grid) # Length - self.length_lbl = FCLabel('%s:' % _("Projection")) + self.length_lbl = FCLabel('%s:' % _("Length")) self.length_entry = NumericalEvalEntry() size_grid.addWidget(self.length_lbl, 0, 0) size_grid.addWidget(self.length_entry, 0, 1) diff --git a/appEditors/geo_plugins/GeoSimplificationPlugin.py b/appEditors/geo_plugins/GeoSimplificationPlugin.py index 9e774843..38c064f6 100644 --- a/appEditors/geo_plugins/GeoSimplificationPlugin.py +++ b/appEditors/geo_plugins/GeoSimplificationPlugin.py @@ -6,7 +6,7 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class SimplificationTool(AppTool): +class SimplificationTool(AppToolEditor): """ Do a shape simplification for the selected geometry. """ @@ -14,7 +14,7 @@ class SimplificationTool(AppTool): update_ui = pyqtSignal(object, int) def __init__(self, app, draw_app): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.draw_app = draw_app self.decimals = app.decimals @@ -33,7 +33,7 @@ class SimplificationTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor SimplificationTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoTextPlugin.py b/appEditors/geo_plugins/GeoTextPlugin.py index 79334e06..1c9d0842 100644 --- a/appEditors/geo_plugins/GeoTextPlugin.py +++ b/appEditors/geo_plugins/GeoTextPlugin.py @@ -7,13 +7,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class TextInputTool(AppTool): +class TextInputTool(AppToolEditor): """ Simple input for buffer distance. """ def __init__(self, app, draw_app): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.app = app self.draw_app = draw_app @@ -33,7 +33,7 @@ class TextInputTool(AppTool): def run(self): self.app.defaults.report_usage("Geo Editor TextInputTool()") - AppTool.run(self) + super().run() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: diff --git a/appEditors/geo_plugins/GeoTransformationPlugin.py b/appEditors/geo_plugins/GeoTransformationPlugin.py index e428039a..d5dfe54c 100644 --- a/appEditors/geo_plugins/GeoTransformationPlugin.py +++ b/appEditors/geo_plugins/GeoTransformationPlugin.py @@ -6,13 +6,13 @@ if '_' not in builtins.__dict__: _ = gettext.gettext -class TransformEditorTool(AppTool): +class TransformEditorTool(AppToolEditor): """ Inputs to specify how to paint the selected polygons. """ def __init__(self, app, draw_app): - AppTool.__init__(self, app) + AppToolEditor.__init__(self, app) self.app = app self.draw_app = draw_app @@ -84,7 +84,7 @@ class TransformEditorTool(AppTool): except AttributeError: pass - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Transformation")) diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index 93847ae2..9a903192 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -3037,12 +3037,7 @@ class FCButton(QtWidgets.QPushButton): @color.setter def color(self, color): self._color = color - self.setStyleSheet(""" - QPushButton - {{ - color: {color}; - }} - """.format(color=color)) + self.setStyleSheet(".FCButton{color: %s;}" % color) def get_value(self): return self.isChecked() @@ -3076,6 +3071,11 @@ class FCLabel(QtWidgets.QLabel): super(FCLabel, self).__init__(parent) + self._color = None + self._bold = False + self._title = title + self._font_size = None + if color: color = self.patching_text_color(color) @@ -3105,6 +3105,38 @@ class FCLabel(QtWidgets.QLabel): self.middle_clicked_state = False self.right_clicked_state = False + @property + def color(self): + return self._color + + @color.setter + def color(self, color): + self._color = color + self.setText('%s' % (str(color), self._title)) + + @property + def bold(self): + return self._bold + + @bold.setter + def bold(self, bold): + self._bold = bold + font = QtGui.QFont() + font.setBold(True) if bold else font.setBold(False) + self.setFont(font) + + @property + def font_size(self): + return self._font_size + + @font_size.setter + def font_size(self, size): + self._font_size = size + font = QtGui.QFont() + if size: + font.setPointSize(size) + self.setFont(font) + def patching_text_color(self, color): return color @@ -3123,7 +3155,8 @@ class FCLabel(QtWidgets.QLabel): return self.text() def set_value(self, val): - self.setText(str(val)) + self._title = str(val) + self.setText(self._title) class FCMenu(QtWidgets.QMenu): @@ -5635,7 +5668,7 @@ class AppInfoBar(QtWidgets.QWidget): self.text.setText(text) self.text.setToolTip(text) if color: - self.text.setStyleSheet('color: %s' % str(color)) + self.text.color = color def set_status(self, text, level="info"): level = str(level) @@ -5703,7 +5736,7 @@ class CoordsToolbar(QtWidgets.QToolBar): def set_color(self, color): if color: - self.setStyleSheet('QtWidgets.QToolBar {color: %s}' % str(color)) + self.setStyleSheet('QtWidgets.QToolBar {color: %s;}' % str(color)) class AppSystemTray(QtWidgets.QSystemTrayIcon): diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index fef5527d..48f9619a 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -1508,11 +1508,7 @@ class ScriptObjectUI(ObjectUI): self.autocomplete_cb.setToolTip( _("This selects if the auto completer is enabled in the Script Editor.") ) - self.autocomplete_cb.setStyleSheet( - """ - QCheckBox {font-weight: bold; color: black} - """ - ) + self.autocomplete_cb.setStyleSheet("") h_lay.addWidget(self.autocomplete_cb) h_lay.addStretch() @@ -1582,11 +1578,7 @@ class DocumentObjectUI(ObjectUI): self.autocomplete_cb.setToolTip( _("This selects if the auto completer is enabled in the Document Editor.") ) - self.autocomplete_cb.setStyleSheet( - """ - QCheckBox {font-weight: bold; color: black} - """ - ) + self.autocomplete_cb.setStyleSheet("") h_lay.addWidget(self.autocomplete_cb) h_lay.addStretch() diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index e846d1e0..cad40955 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'), bold=True) + 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.") @@ -277,11 +277,13 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) grid1.addWidget(separator_line, 26, 0, 1, 2) + proj_item_lbl = FCLabel('%s' % _("Project Items Color"), bold=True, color='green') + grid1.addWidget(proj_item_lbl, 27, 0, 1, 2) # ------------------------------------------------------------------ # ----------------------- Project Settings ----------------------------- # ------------------------------------------------------------------ # Light Theme - self.proj_settings_l_label = FCLabel('%s' % _("Light"), bold=True) + self.proj_settings_l_label = FCLabel('%s %s' % (_("Light"), _("Theme")), bold=True) grid1.addWidget(self.proj_settings_l_label, 28, 0, 1, 2) # Project Tab items color @@ -313,7 +315,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): grid1.addWidget(separator_line, 33, 0, 1, 2) # Dark Theme - self.proj_settings_d_label = FCLabel('%s' % _("Dark"), bold=True) + self.proj_settings_d_label = FCLabel('%s %s' % (_("Dark"), _("Theme")), bold=True) grid1.addWidget(self.proj_settings_d_label, 34, 0, 1, 2) # Project Tab items color diff --git a/appGUI/themes/dark_style_sheet.py b/appGUI/themes/dark_style_sheet.py index 3688c129..fe1006fc 100644 --- a/appGUI/themes/dark_style_sheet.py +++ b/appGUI/themes/dark_style_sheet.py @@ -114,7 +114,7 @@ QRadioButton:hover { } QCheckBox::indicator, QRadioButton::indicator { - margin: 0 0 2 10; + margin: 0 0 2 0; height: 18px; width: 18px; } diff --git a/appObjects/DocumentObject.py b/appObjects/DocumentObject.py index 8151d772..afe8450d 100644 --- a/appObjects/DocumentObject.py +++ b/appObjects/DocumentObject.py @@ -135,16 +135,23 @@ class DocumentObject(FlatCAMObj): # self.document_editor_tab.handleTextChanged() self.ser_attrs = ['options', 'kind', 'source_file'] - if QtGui.Qt.mightBeRichText(self.source_file): - # self.document_editor_tab.code_editor.setHtml(self.source_file) + try: + if QtGui.Qt.mightBeRichText(self.source_file): + # self.document_editor_tab.code_editor.setHtml(self.source_file) + self.document_editor_tab.load_text(self.source_file, move_to_start=True, clear_text=True, as_html=True) + else: + # for line in self.source_file.splitlines(): + # self.document_editor_tab.code_editor.append(line) + self.document_editor_tab.load_text(self.source_file, move_to_start=True, clear_text=True, as_html=False) + except AttributeError: self.document_editor_tab.load_text(self.source_file, move_to_start=True, clear_text=True, as_html=True) - else: - # for line in self.source_file.splitlines(): - # self.document_editor_tab.code_editor.append(line) - self.document_editor_tab.load_text(self.source_file, move_to_start=True, clear_text=True, as_html=False) self.build_ui() + # TODO does not work, why? + # switch the notebook area to Properties Tab + # self.app.ui.notebook.setCurrentWidget(self.app.ui.properties_tab) + @property def read_only(self): return self._read_only @@ -269,19 +276,19 @@ class DocumentObject(FlatCAMObj): # Setting font colors handlers def on_font_color_entry(self): self.app.options['document_font_color'] = self.ui.font_color_entry.get_value() - self.ui.font_color_button.setStyleSheet("background-color:%s" % str(self.app.options['document_font_color'])) + self.ui.font_color_button.setStyleSheet("background-color:%s;" % str(self.app.options['document_font_color'])) def on_font_color_button(self): current_color = QtGui.QColor(self.app.options['document_font_color']) - c_dialog = QtWidgets.QColorDialog() + c_dialog = QtWidgets.QColorDialog(parent=self.app.ui) font_color = c_dialog.getColor(initial=current_color) if font_color.isValid() is False: return self.document_editor_tab.code_editor.setTextColor(font_color) - self.ui.font_color_button.setStyleSheet("background-color:%s" % str(font_color.name())) + self.ui.font_color_button.setStyleSheet("background-color:%s;" % str(font_color.name())) new_val = str(font_color.name()) self.ui.font_color_entry.set_value(new_val) @@ -290,24 +297,31 @@ class DocumentObject(FlatCAMObj): # Setting selection colors handlers def on_selection_color_entry(self): self.app.options['document_sel_color'] = self.ui.sel_color_entry.get_value() - self.ui.sel_color_button.setStyleSheet("background-color:%s" % str(self.app.options['document_sel_color'])) + self.ui.sel_color_button.setStyleSheet("background-color:%s;" % str(self.app.options['document_sel_color'])) def on_selection_color_button(self): current_color = QtGui.QColor(self.app.options['document_sel_color']) - c_dialog = QtWidgets.QColorDialog() + c_dialog = QtWidgets.QColorDialog(parent=self.app.ui) sel_color = c_dialog.getColor(initial=current_color) if sel_color.isValid() is False: return - p = QtGui.QPalette() - p.setColor(QtGui.QPalette.ColorRole.Highlight, sel_color) - p.setColor(QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor('white')) + # p = QtGui.QPalette() + # p.setColor(QtGui.QPalette.ColorRole.Highlight, sel_color) + # p.setColor(QtGui.QPalette.ColorRole.HighlightedText, QtGui.QColor('white')) + # self.document_editor_tab.code_editor.setPalette(p) - self.document_editor_tab.code_editor.setPalette(p) + self.document_editor_tab.code_editor.setStyleSheet( + """ + QTextEdit {selection-background-color:%s; + selection-color:white; + } + """ % sel_color.name() + ) - self.ui.sel_color_button.setStyleSheet("background-color:%s" % str(sel_color.name())) + self.ui.sel_color_button.setStyleSheet("background-color:%s;" % str(sel_color.name())) new_val = str(sel_color.name()) self.ui.sel_color_entry.set_value(new_val) diff --git a/appPlugins/ToolAlignObjects.py b/appPlugins/ToolAlignObjects.py index 7f2c2e1f..8ab7abe5 100644 --- a/appPlugins/ToolAlignObjects.py +++ b/appPlugins/ToolAlignObjects.py @@ -115,7 +115,7 @@ class AlignObjects(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Align Tool")) diff --git a/appPlugins/ToolCalculators.py b/appPlugins/ToolCalculators.py index 274aaf31..0dd99735 100644 --- a/appPlugins/ToolCalculators.py +++ b/appPlugins/ToolCalculators.py @@ -78,7 +78,7 @@ class ToolCalculator(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() diff --git a/appPlugins/ToolCopperThieving.py b/appPlugins/ToolCopperThieving.py index 88bb85aa..e44d9edd 100644 --- a/appPlugins/ToolCopperThieving.py +++ b/appPlugins/ToolCopperThieving.py @@ -121,7 +121,7 @@ class ToolCopperThieving(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() diff --git a/appPlugins/ToolCutOut.py b/appPlugins/ToolCutOut.py index 3fc6586e..9ac54e8c 100644 --- a/appPlugins/ToolCutOut.py +++ b/appPlugins/ToolCutOut.py @@ -164,7 +164,7 @@ class CutOut(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Cutout")) diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index e4e06829..d40589e7 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -89,7 +89,7 @@ class DblSidedTool(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("2-Sided")) diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index 5cdf862b..35e21632 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -133,7 +133,7 @@ class Distance(AppTool): except AttributeError: pass - AppTool.run(self) + super().run() else: if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) diff --git a/appPlugins/ToolDrilling.py b/appPlugins/ToolDrilling.py index 507f2b98..e0e5504c 100644 --- a/appPlugins/ToolDrilling.py +++ b/appPlugins/ToolDrilling.py @@ -165,7 +165,7 @@ class ToolDrilling(AppTool, Excellon): self.set_tool_ui() - AppTool.run(self) + super().run() self.on_object_changed() # self.build_tool_ui() diff --git a/appPlugins/ToolEtchCompensation.py b/appPlugins/ToolEtchCompensation.py index 6341afbc..5732c862 100644 --- a/appPlugins/ToolEtchCompensation.py +++ b/appPlugins/ToolEtchCompensation.py @@ -84,7 +84,7 @@ class ToolEtchCompensation(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Etch Compensation")) diff --git a/appPlugins/ToolExtract.py b/appPlugins/ToolExtract.py index bbbf462b..d5d70dfb 100644 --- a/appPlugins/ToolExtract.py +++ b/appPlugins/ToolExtract.py @@ -120,7 +120,7 @@ class ToolExtract(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.build_tool_ui() diff --git a/appPlugins/ToolFiducials.py b/appPlugins/ToolFiducials.py index c6520977..8f1c2de4 100644 --- a/appPlugins/ToolFiducials.py +++ b/appPlugins/ToolFiducials.py @@ -122,7 +122,7 @@ class ToolFiducials(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() diff --git a/appPlugins/ToolFilm.py b/appPlugins/ToolFilm.py index 4d60b92a..31bc970f 100644 --- a/appPlugins/ToolFilm.py +++ b/appPlugins/ToolFilm.py @@ -135,7 +135,7 @@ class Film(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() diff --git a/appPlugins/ToolFollow.py b/appPlugins/ToolFollow.py index 422af7df..d33bf6ee 100644 --- a/appPlugins/ToolFollow.py +++ b/appPlugins/ToolFollow.py @@ -108,7 +108,7 @@ class ToolFollow(AppTool, Gerber): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Follow")) diff --git a/appPlugins/ToolImage.py b/appPlugins/ToolImage.py index 00e9200e..e889bc27 100644 --- a/appPlugins/ToolImage.py +++ b/appPlugins/ToolImage.py @@ -85,7 +85,7 @@ class ToolImage(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Image Import")) diff --git a/appPlugins/ToolInvertGerber.py b/appPlugins/ToolInvertGerber.py index 1365968d..63a6c22b 100644 --- a/appPlugins/ToolInvertGerber.py +++ b/appPlugins/ToolInvertGerber.py @@ -85,7 +85,7 @@ class ToolInvertGerber(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Invert Gerber")) diff --git a/appPlugins/ToolIsolation.py b/appPlugins/ToolIsolation.py index abc6d076..b3aa0e52 100644 --- a/appPlugins/ToolIsolation.py +++ b/appPlugins/ToolIsolation.py @@ -176,7 +176,7 @@ class ToolIsolation(AppTool, Gerber): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() # reset those objects on a new run @@ -2138,8 +2138,8 @@ class ToolIsolation(AppTool, Gerber): return 'fail' else: if self.validation_status: - msg = '[success] %s: %s' % (_("Isolation geometry created"), geo_obj.obj_options["name"]) - app_obj.inform.emit(msg) + mssg = '[success] %s: %s' % (_("Isolation geometry created"), geo_obj.obj_options["name"]) + app_obj.inform.emit(mssg) a_select = True if self.validation_status else False self.app.app_obj.new_object("geometry", iso_name, iso_init, plot=plot, autoselected=a_select) diff --git a/appPlugins/ToolLevelling.py b/appPlugins/ToolLevelling.py index f3962545..e69f9e0e 100644 --- a/appPlugins/ToolLevelling.py +++ b/appPlugins/ToolLevelling.py @@ -161,7 +161,7 @@ class ToolLevelling(AppTool, CNCjob): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Levelling")) @@ -2117,21 +2117,15 @@ class LevelUI: self.gr_ctrl_tab_layout.addStretch(1) - jog_title_label = FCLabel(_("Jog")) - jog_title_label.setStyleSheet(""" - FCLabel - { - font-weight: bold; - } - """) + jog_title_label = FCLabel(_("Jog"), bold=True) - zero_title_label = FCLabel(_("Zero Axes")) - zero_title_label.setStyleSheet(""" - FCLabel - { - font-weight: bold; - } - """) + zero_title_label = FCLabel(_("Zero Axes"), bold=True) + # zero_title_label.setStyleSheet(""" + # FCLabel + # { + # font-weight: bold; + # } + # """) grbl_ctrl_grid.addWidget(jog_title_label, 0, 0) grbl_ctrl_grid.addWidget(zero_title_label, 0, 2) diff --git a/appPlugins/ToolMarkers.py b/appPlugins/ToolMarkers.py index c0be5dd4..da970529 100644 --- a/appPlugins/ToolMarkers.py +++ b/appPlugins/ToolMarkers.py @@ -136,7 +136,7 @@ class ToolMarkers(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() diff --git a/appPlugins/ToolMilling.py b/appPlugins/ToolMilling.py index 703cf47f..dc2ffe67 100644 --- a/appPlugins/ToolMilling.py +++ b/appPlugins/ToolMilling.py @@ -203,7 +203,7 @@ class ToolMilling(AppTool, Excellon): self.set_tool_ui() - AppTool.run(self) + super().run() # reset those objects on a new run self.target_obj = None diff --git a/appPlugins/ToolNCC.py b/appPlugins/ToolNCC.py index fbe6f018..62dac7eb 100644 --- a/appPlugins/ToolNCC.py +++ b/appPlugins/ToolNCC.py @@ -177,7 +177,7 @@ class NonCopperClear(AppTool, Gerber): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() # reset those objects on a new run diff --git a/appPlugins/ToolOptimal.py b/appPlugins/ToolOptimal.py index e1045728..37e60ac7 100644 --- a/appPlugins/ToolOptimal.py +++ b/appPlugins/ToolOptimal.py @@ -96,7 +96,7 @@ class ToolOptimal(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Find Optimal")) diff --git a/appPlugins/ToolPaint.py b/appPlugins/ToolPaint.py index 61e18521..c3f762eb 100644 --- a/appPlugins/ToolPaint.py +++ b/appPlugins/ToolPaint.py @@ -184,7 +184,7 @@ class ToolPaint(AppTool, Gerber): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.build_ui() diff --git a/appPlugins/ToolPanelize.py b/appPlugins/ToolPanelize.py index 9b9712fa..cb365f81 100644 --- a/appPlugins/ToolPanelize.py +++ b/appPlugins/ToolPanelize.py @@ -90,7 +90,7 @@ class Panelize(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Panelization")) diff --git a/appPlugins/ToolPcbWizard.py b/appPlugins/ToolPcbWizard.py index 009a48fb..524856fc 100644 --- a/appPlugins/ToolPcbWizard.py +++ b/appPlugins/ToolPcbWizard.py @@ -96,7 +96,7 @@ class PcbWizard(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("PcbWizard Import")) diff --git a/appPlugins/ToolPunchGerber.py b/appPlugins/ToolPunchGerber.py index b6b23cf9..cef8987b 100644 --- a/appPlugins/ToolPunchGerber.py +++ b/appPlugins/ToolPunchGerber.py @@ -145,7 +145,7 @@ class ToolPunchGerber(AppTool, Gerber): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.build_tool_ui() diff --git a/appPlugins/ToolQRCode.py b/appPlugins/ToolQRCode.py index 8fbb4238..607c5f6f 100644 --- a/appPlugins/ToolQRCode.py +++ b/appPlugins/ToolQRCode.py @@ -105,7 +105,7 @@ class QRCode(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() @@ -148,11 +148,11 @@ class QRCode(AppTool): self.ui.text_data.set_value(self.app.options["tools_qrcode_qrdata"]) self.ui.fill_color_entry.set_value(self.app.options['tools_qrcode_fill_color']) - self.ui.fill_color_button.setStyleSheet("background-color:%s" % + self.ui.fill_color_button.setStyleSheet("background-color:%s;" % str(self.app.options['tools_qrcode_fill_color'])[:7]) self.ui.back_color_entry.set_value(self.app.options['tools_qrcode_back_color']) - self.ui.back_color_button.setStyleSheet("background-color:%s" % + self.ui.back_color_button.setStyleSheet("background-color:%s;" % str(self.app.options['tools_qrcode_back_color'])[:7]) # SELECT THE CURRENT OBJECT @@ -657,7 +657,7 @@ class QRCode(AppTool): def on_qrcode_fill_color_entry(self): color = self.ui.fill_color_entry.get_value() - self.ui.fill_color_button.setStyleSheet("background-color:%s" % str(color)) + self.ui.fill_color_button.setStyleSheet("background-color:%s;" % str(color)) def on_qrcode_fill_color_button(self): current_color = QtGui.QColor(self.ui.fill_color_entry.get_value()) @@ -668,14 +668,14 @@ class QRCode(AppTool): if fill_color.isValid() is False: return - self.ui.fill_color_button.setStyleSheet("background-color:%s" % str(fill_color.name())) + self.ui.fill_color_button.setStyleSheet("background-color:%s;" % str(fill_color.name())) new_val_sel = str(fill_color.name()) self.ui.fill_color_entry.set_value(new_val_sel) def on_qrcode_back_color_entry(self): color = self.ui.back_color_entry.get_value() - self.ui.back_color_button.setStyleSheet("background-color:%s" % str(color)) + self.ui.back_color_button.setStyleSheet("background-color:%s;" % str(color)) def on_qrcode_back_color_button(self): current_color = QtGui.QColor(self.ui.back_color_entry.get_value()) @@ -686,7 +686,7 @@ class QRCode(AppTool): if back_color.isValid() is False: return - self.ui.back_color_button.setStyleSheet("background-color:%s" % str(back_color.name())) + self.ui.back_color_button.setStyleSheet("background-color:%s;" % str(back_color.name())) new_val_sel = str(back_color.name()) self.ui.back_color_entry.set_value(new_val_sel) diff --git a/appPlugins/ToolReport.py b/appPlugins/ToolReport.py index 468a3276..debed045 100644 --- a/appPlugins/ToolReport.py +++ b/appPlugins/ToolReport.py @@ -108,7 +108,7 @@ class ObjectReport(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.properties() diff --git a/appPlugins/ToolRulesCheck.py b/appPlugins/ToolRulesCheck.py index 07ab4ec9..7ea02991 100644 --- a/appPlugins/ToolRulesCheck.py +++ b/appPlugins/ToolRulesCheck.py @@ -99,7 +99,7 @@ class RulesCheck(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Check Rules")) diff --git a/appPlugins/ToolSolderPaste.py b/appPlugins/ToolSolderPaste.py index 62380a37..b827d5a0 100644 --- a/appPlugins/ToolSolderPaste.py +++ b/appPlugins/ToolSolderPaste.py @@ -103,7 +103,7 @@ class SolderPaste(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.build_ui() diff --git a/appPlugins/ToolSub.py b/appPlugins/ToolSub.py index 30c36bd8..79c8ef09 100644 --- a/appPlugins/ToolSub.py +++ b/appPlugins/ToolSub.py @@ -145,7 +145,7 @@ class ToolSub(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Subtract")) diff --git a/appPlugins/ToolTransform.py b/appPlugins/ToolTransform.py index 542c3cfb..19f4b77f 100644 --- a/appPlugins/ToolTransform.py +++ b/appPlugins/ToolTransform.py @@ -75,7 +75,7 @@ class ToolTransform(AppTool): if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) - AppTool.run(self) + super().run() self.set_tool_ui() self.app.ui.notebook.setTabText(2, _("Transformation")) diff --git a/appTool.py b/appTool.py index e32aff78..290b8a7b 100644 --- a/appTool.py +++ b/appTool.py @@ -114,47 +114,6 @@ class AppTool(QtWidgets.QWidget): # Put ourselves in the appGUI self.app.ui.plugin_scroll_area.setWidget(self) - # TODO Hack, should find the root cause and fix - # for whatever reason the stylesheet for dark mode is lost at some point here, so we should reapply it for the - # QWidget - if self.app.options['global_theme'] not in ['default', 'light']: - self.setStyleSheet( - ''' - QWidget { - background-color: rgba(32.000, 33.000, 36.000, 1.000); - color: rgba(170.000, 170.000, 170.000, 1.000); - selection-background-color: rgba(138.000, 180.000, 247.000, 1.000); - selection-color: rgba(32.000, 33.000, 36.000, 1.000); - } - QWidget:disabled { - color: rgba(105.000, 113.000, 119.000, 1.000); - selection-background-color: rgba(83.000, 87.000, 91.000, 1.000); - selection-color: rgba(105.000, 113.000, 119.000, 1.000); - } - QWidget { - backward-icon: url(${path}/themes/dark/svg/arrow_upward__icon-foreground__rotate-270.svg); - forward-icon: url(${path}/themes/dark/svg/arrow_upward__icon-foreground__rotate-90.svg); - leftarrow-icon: url(${path}/themes/dark/svg/arrow_upward__icon-foreground__rotate-270.svg); - rightarrow-icon: url(${path}/themes/dark/svg/arrow_upward__icon-foreground__rotate-90.svg); - dialog-ok-icon: url(${path}/themes/dark/svg/check__icon-foreground.svg); - dialog-cancel-icon: url(${path}/themes/dark/svg/close__icon-foreground.svg); - dialog-yes-icon: url(${path}/themes/dark/svg/check_circle__icon-foreground.svg); - dialog-no-icon: url(${path}/themes/dark/svg/cancel__icon-foreground.svg); - dialog-apply-icon: url(${path}/themes/dark/svg/check__icon-foreground.svg); - dialog-reset-icon: url(${path}/themes/dark/svg/restart_alt__icon-foreground.svg); - dialog-save-icon: url(${path}/themes/dark/svg/save__icon-foreground.svg); - dialog-discard-icon: url(${path}/themes/dark/svg/delete__icon-foreground.svg); - dialog-close-icon: url(${path}/themes/dark/svg/close__icon-foreground.svg); - dialog-open-icon: url(${path}/themes/dark/svg/folder_open__icon-foreground.svg); - dialog-help-icon: url(${path}/themes/dark/svg/help__icon-foreground.svg); - filedialog-parent-directory-icon: url(${path}/themes/dark/svg/arrow_upward__icon-foreground.svg); - filedialog-new-directory-icon: url(${path}/themes/dark/svg/create_new_folder__icon-foreground.svg); - titlebar-close-icon: url(${path}/themes/dark/svg/close__icon-foreground.svg); - titlebar-normal-icon: url(${path}/themes/dark/svg/flip_to_front__icon-foreground.svg); - } - ''' - ) - # Switch notebook to tool page self.app.ui.notebook.setCurrentWidget(self.app.ui.plugin_tab) @@ -393,3 +352,24 @@ class AppTool(QtWidgets.QWidget): """ default_hint_size = super(AppTool, self).sizeHint() return QtCore.QSize(default_hint_size.width(), default_hint_size.height()) + + +class AppToolEditor(AppTool): + + def run(self): + super(AppToolEditor, self).run() + + # TODO Hack, should find the root cause and fix + # for whatever reason the stylesheet for dark mode is lost at some point here, so we should reapply it for the + # QWidget + if self.app.options['global_theme'] not in ['default', 'light']: + super(AppTool, self).setStyleSheet( + ''' + QWidget { + background-color: rgba(32.000, 33.000, 36.000, 1.000); + color: rgba(170.000, 170.000, 170.000, 1.000); + selection-background-color: rgba(138.000, 180.000, 247.000, 1.000); + selection-color: rgba(32.000, 33.000, 36.000, 1.000); + } + ''' + ) diff --git a/defaults.py b/defaults.py index 12bfc85d..4373fcd2 100644 --- a/defaults.py +++ b/defaults.py @@ -131,7 +131,7 @@ class AppDefaults: "global_proj_item_color_light": '#000000FF', "global_proj_item_dis_color_light": '#b7b7cbFF', "global_proj_item_color_dark": '#AAAAAAFF', - "global_proj_item_dis_color_dark": '#697177FF', + "global_proj_item_dis_color_dark": '#4a4a4aFF', "global_project_autohide": True,