diff --git a/CHANGELOG.md b/CHANGELOG.md index d4312f56..0847466c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ CHANGELOG for FlatCAM Evo beta - changed the activity GIF's for the dark theme - changed some of the dark theme icons to the red color - made sure that the draw color in Editors is inverted for the dark mode +- added a hack so the dark stylesheet for QWidget is reapplied if that Qwidget is removed (I don't know why it is lost in the first time) 4.05.2020 diff --git a/appEditors/exc_plugins/ExcDrillPlugin.py b/appEditors/exc_plugins/ExcDrillPlugin.py index dc78b537..1f83dedb 100644 --- a/appEditors/exc_plugins/ExcDrillPlugin.py +++ b/appEditors/exc_plugins/ExcDrillPlugin.py @@ -62,8 +62,8 @@ class ExcDrillEditorTool(AppTool): self.app.ui.plugin_tab_layout.addWidget(self.app.ui.plugin_scroll_area) self.app.ui.notebook.addTab(self.app.ui.plugin_tab, _("Plugin")) - # focus on Tool Tab - self.app.ui.notebook.setCurrentWidget(self.app.ui.plugin_tab) + # focus on Tool Tab + self.app.ui.notebook.setCurrentWidget(self.app.ui.plugin_tab) # self.app.ui.notebook.callback_on_close = self.on_tab_close diff --git a/appTool.py b/appTool.py index 3863cd83..e32aff78 100644 --- a/appTool.py +++ b/appTool.py @@ -114,6 +114,47 @@ 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)