From 1cd0aa61e7a7ca0e8f04754706833bb08533e7ab Mon Sep 17 00:00:00 2001 From: dalthviz Date: Thu, 15 Nov 2018 23:31:16 +0100 Subject: [PATCH 01/12] DarkIcons: dark icons for regex, case sensitive and message box information --- spyder/plugins/findinfiles/widgets.py | 9 +++++---- spyder/utils/icon_manager.py | 4 +++- spyder/widgets/findreplace.py | 5 +++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spyder/plugins/findinfiles/widgets.py b/spyder/plugins/findinfiles/widgets.py index 1b42ef408c6..9a05e39e832 100644 --- a/spyder/plugins/findinfiles/widgets.py +++ b/spyder/plugins/findinfiles/widgets.py @@ -41,7 +41,7 @@ from spyder.widgets.comboboxes import PatternComboBox from spyder.widgets.onecolumntree import OneColumnTree from spyder.utils.misc import regexp_error_msg -from spyder.utils.qthelpers import create_toolbutton, get_icon +from spyder.utils.qthelpers import create_toolbutton from spyder.config.gui import get_font from spyder.widgets.waitingspinner import QWaitingSpinner @@ -427,10 +427,11 @@ def __init__(self, parent, search_text, search_text_regexp, self.search_text = PatternComboBox(self, search_text, _("Search pattern")) self.edit_regexp = create_toolbutton(self, - icon=get_icon('regexp.svg'), + icon=ima.icon('regex'), tip=_('Regular expression')) self.case_button = create_toolbutton(self, - icon=get_icon("upper_lower.png"), + icon=ima.icon( + "format_letter_case"), tip=_("Case Sensitive")) self.case_button.setCheckable(True) self.case_button.setChecked(case_sensitive) @@ -469,7 +470,7 @@ def __init__(self, parent, search_text, search_text_regexp, and exclude_idx < self.exclude_pattern.count(): self.exclude_pattern.setCurrentIndex(exclude_idx) self.exclude_regexp = create_toolbutton(self, - icon=get_icon('regexp.svg'), + icon=ima.icon('regex'), tip=_('Regular expression')) self.exclude_regexp.setCheckable(True) self.exclude_regexp.setChecked(exclude_regexp) diff --git a/spyder/utils/icon_manager.py b/spyder/utils/icon_manager.py index c5278c3696d..14c5382885b 100644 --- a/spyder/utils/icon_manager.py +++ b/spyder/utils/icon_manager.py @@ -30,6 +30,8 @@ } _qtaargs = { + 'format_letter_case': [('mdi.format-letter-case',), {'color': MAIN_FG_COLOR}], + 'regex': [('mdi.regex',), {'color': MAIN_FG_COLOR}], 'log': [('fa.file-text-o',), {'color': MAIN_FG_COLOR}], 'configure': [('fa.wrench',), {'color': MAIN_FG_COLOR}], 'bold': [('fa.bold',), {'color': MAIN_FG_COLOR}], @@ -176,7 +178,7 @@ 'DialogCloseButton': [('fa.close',), {'color': MAIN_FG_COLOR}], 'DirClosedIcon': [('fa.folder-o',), {'color': MAIN_FG_COLOR}], 'DialogHelpButton': [('fa.life-ring',), {'color': 'darkred'}], - 'MessageBoxInformation': [('fa.info',), {'color': '3775a9'}], + 'MessageBoxInformation': [('fa.info',), {'color': MAIN_FG_COLOR}], 'DirOpenIcon': [('fa.folder-open',), {'color': MAIN_FG_COLOR}], 'FileIcon': [('fa.file-o',), {'color': MAIN_FG_COLOR}], 'ExcelFileIcon': [('fa.file-excel-o',), {'color': MAIN_FG_COLOR}], diff --git a/spyder/widgets/findreplace.py b/spyder/widgets/findreplace.py index b9824dd4f5c..2f67f63fe32 100644 --- a/spyder/widgets/findreplace.py +++ b/spyder/widgets/findreplace.py @@ -97,13 +97,14 @@ def __init__(self, parent, enable_replace=False): self.next_button.clicked.connect(self.update_search_combo) self.previous_button.clicked.connect(self.update_search_combo) - self.re_button = create_toolbutton(self, icon=get_icon('regexp.svg'), + self.re_button = create_toolbutton(self, icon=ima.icon('regex'), tip=_("Regular expression")) self.re_button.setCheckable(True) self.re_button.toggled.connect(lambda state: self.find()) self.case_button = create_toolbutton(self, - icon=get_icon("upper_lower.png"), + icon=ima.icon( + "format_letter_case"), tip=_("Case Sensitive")) self.case_button.setCheckable(True) self.case_button.toggled.connect(lambda state: self.find()) From 495f82b86326421ce9e59f19a45ecb6f25da6341 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Sat, 17 Nov 2018 00:43:12 +0100 Subject: [PATCH 02/12] DarkIcons: remove old regex and case sensitive icons and update NOTICE --- NOTICE.txt | 32 ------------------ spyder/images/regexp.svg | 61 ---------------------------------- spyder/images/upper_lower.png | Bin 339 -> 0 bytes 3 files changed, 93 deletions(-) delete mode 100644 spyder/images/regexp.svg delete mode 100644 spyder/images/upper_lower.png diff --git a/NOTICE.txt b/NOTICE.txt index 477661ea314..5fd36c9cfc7 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1202,7 +1202,6 @@ spyder/images/genprefs.png spyder/images/help.png spyder/images/italic.png spyder/images/pythonpath_mgr.png -spyder/images/upper_lower.png spyder/images/vcs_browse.png spyder/images/vcs_commit.png spyder/images/actions/1downarrow.png @@ -1606,37 +1605,6 @@ spyder/images/winpython.svg ------------------------------------------------------------------------------- - -OOjs UI MediaWiki lib ---------------------- - - -Copyright (c) 2011-2018 OOUI Team and other contributors. - - -Authors: OOUI Team and other contributors -https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/AUTHORS.txt -Source: https://phabricator.wikimedia.org/diffusion/GVED/browse/master/lib/oojs-ui/themes/mediawiki/images/icons/ -Download: https://commons.wikimedia.org/wiki/File:OOjs_UI_icon_regular-expression.svg -License: MIT (Expat) License | https://opensource.org/licenses/MIT - -Modifications made: Removed parentheses, make it bigger. - - -Licensed under the terms of the MIT License. - - -See below for the full text of the MIT (Expat) License. - -The current OOjs UI MediaWiki lib repo license can be viewed at: -https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/LICENSE-MIT - - -Files covered: - -spyder/images/regexp.svg - - =============================================================================== diff --git a/spyder/images/regexp.svg b/spyder/images/regexp.svg deleted file mode 100644 index a13c723e3f8..00000000000 --- a/spyder/images/regexp.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - - - diff --git a/spyder/images/upper_lower.png b/spyder/images/upper_lower.png deleted file mode 100644 index f36c99b04f04ca54a0547ccd5da83c27dd164808..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 339 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9Sn6KLbM#5dQ@#YII;= zsI6pRc-hUsVDprLLGnzoO=~$&ty6$ch%1n0hiHNT2q+F`0~y%3|NsAAK1q8Y z&=BF0AirP+hr{b`&B?Cv%bs)imRgLlL(IChbrT(d(u_&o?k=KFZ~R;gvL>4nJ za0`MkV|_~eM4({2r;B5Vgyhd+YpPuM6AmcSyzS1pj#Q zO!~Ck$AnDHX9ognuLuV`pUV5}WGLgLb+fqAu6{1-oD!M<93O2~ From 4ad3eb499282e662e752c843ce28b958396b7ff7 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Sun, 18 Nov 2018 14:32:35 +0100 Subject: [PATCH 03/12] DarkInternalConsole: apply theme changes to the InternalShell/ConsoleBaseWidget --- spyder/app/mainwindow.py | 11 +++- spyder/plugins/console/plugin.py | 40 +++++++++++--- .../plugins/console/widgets/internalshell.py | 18 ++++-- spyder/plugins/console/widgets/shell.py | 27 +++++++-- spyder/plugins/editor/widgets/base.py | 55 ++++++++++--------- spyder/widgets/reporterror.py | 26 +++++++-- 6 files changed, 129 insertions(+), 48 deletions(-) diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index ba698b4ffcb..bc422b8608d 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -2568,8 +2568,17 @@ def render_issue(self, description='', traceback=''): def report_issue(self, body=None, title=None, open_webpage=False): """Report a Spyder issue to github, generating body text if needed.""" if body is None: + from spyder.plugins.console import ( + MAIN_BG_COLOR, MAIN_DEFAULT_FG_COLOR, MAIN_ERROR_FG_COLOR, + MAIN_TB_FG_COLOR, MAIN_PROMPT_FG_COLOR) from spyder.widgets.reporterror import SpyderErrorDialog - report_dlg = SpyderErrorDialog(self, is_report=True) + report_dlg = SpyderErrorDialog( + self, is_report=True, + default_foreground_color=MAIN_DEFAULT_FG_COLOR, + error_foreground_color=MAIN_ERROR_FG_COLOR, + traceback_foreground_color=MAIN_TB_FG_COLOR, + prompt_foreground_color=MAIN_PROMPT_FG_COLOR, + background_color=MAIN_BG_COLOR) report_dlg.show() else: if open_webpage: diff --git a/spyder/plugins/console/plugin.py b/spyder/plugins/console/plugin.py index 2e6e8dc6b75..f72cef13fc6 100644 --- a/spyder/plugins/console/plugin.py +++ b/spyder/plugins/console/plugin.py @@ -21,9 +21,11 @@ from qtpy.compat import getopenfilename from qtpy.QtCore import Qt, Signal, Slot from qtpy.QtWidgets import QInputDialog, QLineEdit, QMenu, QHBoxLayout +from qtpy.QtGui import QColor # Local imports from spyder.config.base import _, DEV, get_debug_level +from spyder.config.gui import is_dark_interface from spyder.config.main import CONF from spyder.utils import icon_manager as ima from spyder.utils.environ import EnvDialog @@ -43,6 +45,20 @@ logger = logging.getLogger(__name__) +if is_dark_interface(): + MAIN_BG_COLOR = '#232629' + MAIN_DEFAULT_FG_COLOR = '#000000' + MAIN_ERROR_FG_COLOR = '#FF0000' + MAIN_TB_FG_COLOR = '#0000FF' + MAIN_PROMPT_FG_COLOR = '#00AA00' +else: + MAIN_BG_COLOR = 'white' + MAIN_DEFAULT_FG_COLOR = '#000000' + MAIN_ERROR_FG_COLOR = '#FF0000' + MAIN_TB_FG_COLOR = '#0000FF' + MAIN_PROMPT_FG_COLOR = '#00AA00' + + class Console(SpyderPluginWidget): """ Console widget @@ -60,12 +76,16 @@ def __init__(self, parent=None, namespace=None, commands=[], message=None, self.dialog_manager = DialogManager() # Shell - light_background = self.get_option('light_background') - self.shell = InternalShell(parent, namespace, commands, message, - self.get_option('max_line_count'), - self.get_plugin_font(), exitfunc, profile, - multithreaded, - light_background=light_background) + self.shell = InternalShell( + parent, namespace, commands, message, + self.get_option('max_line_count'), + self.get_plugin_font(), exitfunc, profile, + multithreaded, + default_foreground_color=MAIN_DEFAULT_FG_COLOR, + error_foreground_color=MAIN_ERROR_FG_COLOR, + traceback_foreground_color=MAIN_TB_FG_COLOR, + prompt_foreground_color=MAIN_PROMPT_FG_COLOR, + background_color=MAIN_BG_COLOR) self.shell.status.connect(lambda msg: self.show_message.emit(msg, 0)) self.shell.go_to_error.connect(self.go_to_error) self.shell.focus_changed.connect(lambda: self.focus_changed.emit()) @@ -219,7 +239,13 @@ def exception_occurred(self, text, is_traceback): if CONF.get('main', 'show_internal_errors'): if self.error_dlg is None: - self.error_dlg = SpyderErrorDialog(self) + self.error_dlg = SpyderErrorDialog( + self, + default_foreground_color=MAIN_DEFAULT_FG_COLOR, + error_foreground_color=MAIN_ERROR_FG_COLOR, + traceback_foreground_color=MAIN_TB_FG_COLOR, + prompt_foreground_color=MAIN_PROMPT_FG_COLOR, + background_color=MAIN_BG_COLOR) self.error_dlg.close_btn.clicked.connect(self.close_error_dlg) self.error_dlg.rejected.connect(self.remove_error_dlg) self.error_dlg.details.go_to_error.connect(self.go_to_error) diff --git a/spyder/plugins/console/widgets/internalshell.py b/spyder/plugins/console/widgets/internalshell.py index 72c45bd3581..7bb4c0394e7 100644 --- a/spyder/plugins/console/widgets/internalshell.py +++ b/spyder/plugins/console/widgets/internalshell.py @@ -136,12 +136,20 @@ class InternalShell(PythonShellWidget): def __init__(self, parent=None, namespace=None, commands=[], message=None, max_line_count=300, font=None, exitfunc=None, profile=False, - multithreaded=True, light_background=True): - PythonShellWidget.__init__(self, parent, - get_conf_path('history_internal.py'), - profile) + multithreaded=True, default_foreground_color=None, + error_foreground_color=None, traceback_foreground_color=None, + prompt_foreground_color=None, background_color=None): + PythonShellWidget.__init__( + self, parent, + get_conf_path('history_internal.py'), + profile=profile, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) - self.set_light_background(light_background) + self.set_color_scheme(default_foreground_color, background_color) self.multithreaded = multithreaded self.setMaximumBlockCount(max_line_count) diff --git a/spyder/plugins/console/widgets/shell.py b/spyder/plugins/console/widgets/shell.py index 3c6aa5988d5..85c11b85b21 100644 --- a/spyder/plugins/console/widgets/shell.py +++ b/spyder/plugins/console/widgets/shell.py @@ -53,11 +53,19 @@ class ShellBaseWidget(ConsoleBaseWidget, SaveHistoryMixin, append_to_history = Signal(str, str) def __init__(self, parent, history_filename, profile=False, - initial_message=None): + initial_message=None, default_foreground_color=None, + error_foreground_color=None, traceback_foreground_color=None, + prompt_foreground_color=None, background_color=None): """ parent : specifies the parent widget """ - ConsoleBaseWidget.__init__(self, parent) + ConsoleBaseWidget.__init__( + self, parent, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) SaveHistoryMixin.__init__(self, history_filename) BrowseHistoryMixin.__init__(self) @@ -631,9 +639,18 @@ class PythonShellWidget(TracebackLinksMixin, ShellBaseWidget, SEPARATOR = '%s##---(%s)---' % (os.linesep*2, time.ctime()) go_to_error = Signal(str) - def __init__(self, parent, history_filename, profile=False, initial_message=None): - ShellBaseWidget.__init__(self, parent, history_filename, profile, - initial_message) + def __init__(self, parent, history_filename, profile=False, + initial_message=None, default_foreground_color=None, + error_foreground_color=None, traceback_foreground_color=None, + prompt_foreground_color=None, background_color=None): + ShellBaseWidget.__init__( + self, parent, history_filename, profile=profile, + initial_message=initial_message, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) TracebackLinksMixin.__init__(self) GetHelpMixin.__init__(self) diff --git a/spyder/plugins/editor/widgets/base.py b/spyder/plugins/editor/widgets/base.py index 97249f623d7..d1e97f7b3fe 100644 --- a/spyder/plugins/editor/widgets/base.py +++ b/spyder/plugins/editor/widgets/base.py @@ -24,6 +24,7 @@ from qtpy.QtWidgets import (QAbstractItemView, QApplication, QListWidget, QListWidgetItem, QMainWindow, QPlainTextEdit, QToolTip) +from qtconsole.styles import dark_color # Local imports from spyder.config.gui import get_font @@ -1262,12 +1263,16 @@ def __init__(self): self.base_format = None self.current_format = None - def set_light_background(self, state): - if state: + def set_color_scheme(self, foreground_color, background_color): + """Set color scheme (foreground and background).""" + if dark_color(foreground_color): self.default_foreground_color = 30 - self.default_background_color = 47 else: self.default_foreground_color = 37 + + if dark_color(background_color): + self.default_background_color = 47 + else: self.default_background_color = 40 def set_base_format(self, base_format): @@ -1336,16 +1341,12 @@ def __init__(self, foregroundcolor, backgroundcolor, self.underline = underline self.format = None - def apply_style(self, font, light_background, is_default): + def apply_style(self, font, is_default): self.format = QTextCharFormat() self.format.setFont(font) foreground = QColor(self.foregroundcolor) - if not light_background and is_default: - inverse_color(foreground) self.format.setForeground(foreground) background = QColor(self.backgroundcolor) - if not light_background: - inverse_color(background) self.format.setBackground(background) font = self.format.font() font.setBold(self.bold) @@ -1362,11 +1363,11 @@ class ConsoleBaseWidget(TextEditBaseWidget): userListActivated = Signal(int, str) completion_widget_activated = Signal(str) - def __init__(self, parent=None): + def __init__(self, parent=None, default_foreground_color=None, + error_foreground_color=None, traceback_foreground_color=None, + prompt_foreground_color=None, background_color=None): TextEditBaseWidget.__init__(self, parent) - self.light_background = True - self.setMaximumBlockCount(300) # ANSI escape code handler @@ -1379,31 +1380,36 @@ def __init__(self, parent=None): self.completion_widget_activated.emit(text)) self.default_style = ConsoleFontStyle( - foregroundcolor=0x000000, backgroundcolor=0xFFFFFF, + foregroundcolor=default_foreground_color, + backgroundcolor=background_color, bold=False, italic=False, underline=False) self.error_style = ConsoleFontStyle( - foregroundcolor=0xFF0000, backgroundcolor=0xFFFFFF, + foregroundcolor=error_foreground_color, + backgroundcolor=background_color, bold=False, italic=False, underline=False) self.traceback_link_style = ConsoleFontStyle( - foregroundcolor=0x0000FF, backgroundcolor=0xFFFFFF, + foregroundcolor=traceback_foreground_color, + backgroundcolor=background_color, bold=True, italic=False, underline=True) self.prompt_style = ConsoleFontStyle( - foregroundcolor=0x00AA00, backgroundcolor=0xFFFFFF, + foregroundcolor=prompt_foreground_color, + backgroundcolor=background_color, bold=True, italic=False, underline=False) self.font_styles = (self.default_style, self.error_style, self.traceback_link_style, self.prompt_style) self.set_pythonshell_font() self.setMouseTracking(True) - def set_light_background(self, state): - self.light_background = state - if state: - self.set_palette(background=QColor(Qt.white), - foreground=QColor(Qt.darkGray)) - else: - self.set_palette(background=QColor(Qt.black), - foreground=QColor(Qt.lightGray)) - self.ansi_handler.set_light_background(state) + def set_color_scheme(self, foreground_color, background_color): + """Set color scheme of the console (foreground and background).""" + self.ansi_handler.set_color_scheme(foreground_color, background_color) + + background_color = QColor(background_color) + foreground_color = QColor(foreground_color) + + self.set_palette(background=background_color, + foreground=foreground_color) + self.set_pythonshell_font() #------Python shell @@ -1489,6 +1495,5 @@ def set_pythonshell_font(self, font=None): font = QFont() for style in self.font_styles: style.apply_style(font=font, - light_background=self.light_background, is_default=style is self.default_style) self.ansi_handler.set_base_format(self.default_style.format) diff --git a/spyder/widgets/reporterror.py b/spyder/widgets/reporterror.py index a77aada3dc8..ab7bab930d6 100644 --- a/spyder/widgets/reporterror.py +++ b/spyder/widgets/reporterror.py @@ -28,7 +28,6 @@ from spyder.plugins.editor.widgets.codeeditor import CodeEditor from spyder.widgets.mixins import BaseEditMixin, TracebackLinksMixin from spyder.plugins.editor.widgets.base import ConsoleBaseWidget -from spyder.plugins.editor.widgets.codeeditor import CodeEditor # Minimum number of characters to introduce in the title and @@ -114,8 +113,16 @@ class ShowErrorWidget(TracebackLinksMixin, ConsoleBaseWidget, BaseEditMixin): QT_CLASS = QPlainTextEdit go_to_error = Signal(str) - def __init__(self, parent=None): - ConsoleBaseWidget.__init__(self, parent) + def __init__(self, parent=None, default_foreground_color=None, + error_foreground_color=None, traceback_foreground_color=None, + prompt_foreground_color=None, background_color=None): + ConsoleBaseWidget.__init__( + self, parent, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) BaseEditMixin.__init__(self) TracebackLinksMixin.__init__(self) self.setReadOnly(True) @@ -124,7 +131,10 @@ def __init__(self, parent=None): class SpyderErrorDialog(QDialog): """Custom error dialog for error reporting.""" - def __init__(self, parent=None, is_report=False): + def __init__(self, parent=None, is_report=False, + default_foreground_color=None, + error_foreground_color=None, traceback_foreground_color=None, + prompt_foreground_color=None, background_color=None): QDialog.__init__(self, parent) self.is_report = is_report @@ -184,7 +194,13 @@ def __init__(self, parent=None, is_report=False): self.input_description.textChanged.connect(self._contents_changed) # Widget to show errors - self.details = ShowErrorWidget(self) + self.details = ShowErrorWidget( + self, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) self.details.set_pythonshell_font(get_font()) self.details.hide() From 8363e3a0e82c5d868bf9f55e0dcdfbfd93438ea9 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Sun, 18 Nov 2018 15:04:55 +0100 Subject: [PATCH 04/12] DarkInternalConsole: Change foreground color. Update qdarkstyle and qtawesome valid versions --- README.md | 2 +- requirements/requirements.txt | 4 ++-- spyder/plugins/console/plugin.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e1beddce140..f5cf305ca8a 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ a Python version greater than 2.7 or 3.4 (Python <=3.3 is no longer supported). * **Cloudpickle**: Serialize variables in the IPython kernel to send to Spyder. * **spyder-kernels** 1.0+: Jupyter kernels for the Spyder console. * **keyring**: Save Github credentials to report errors securely. -* **QDarkStyle**: A dark stylesheet for Qt applications, used for Spyder's dark theme. +* **QDarkStyle** 2.6.0+: A dark stylesheet for Qt applications, used for Spyder's dark theme. * **pexpect**/**paramiko**: Connect to remote kernels through SSH. ### Optional dependencies diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 5c310102e4a..2f7b955a6db 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -5,7 +5,7 @@ nbconvert sphinx pylint psutil -qtawesome>=0.4.1 +qtawesome>=0.5.0 qtpy>=1.2.0 pickleshare pyzmq @@ -15,4 +15,4 @@ pyqt5 keyring spyder-kernels>=1.0 python-language-server -qdarkstyle +qdarkstyle>=2.6.0 diff --git a/spyder/plugins/console/plugin.py b/spyder/plugins/console/plugin.py index f72cef13fc6..49e841a8acc 100644 --- a/spyder/plugins/console/plugin.py +++ b/spyder/plugins/console/plugin.py @@ -47,7 +47,7 @@ if is_dark_interface(): MAIN_BG_COLOR = '#232629' - MAIN_DEFAULT_FG_COLOR = '#000000' + MAIN_DEFAULT_FG_COLOR = '#ffffff' MAIN_ERROR_FG_COLOR = '#FF0000' MAIN_TB_FG_COLOR = '#0000FF' MAIN_PROMPT_FG_COLOR = '#00AA00' From 48ec6fbaa5d6922c43cddadfa42b089a3732fb31 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Sun, 18 Nov 2018 22:39:16 +0100 Subject: [PATCH 05/12] DarkIcons: Change CI to use pip in Python 3.5 --- .circleci/config.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dff9637b25..cf32c2cf5b7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,7 +30,7 @@ jobs: <<: *main environment: - PYTHON_VERSION: "3.5" - - USE_CONDA: "yes" + - USE_CONDA: "no" - CI_PYTEST: "true" python2.7-modules: diff --git a/README.md b/README.md index f5cf305ca8a..029f7a7e586 100644 --- a/README.md +++ b/README.md @@ -234,7 +234,7 @@ a Python version greater than 2.7 or 3.4 (Python <=3.3 is no longer supported). * **Pylint**: Static code analysis. * **Psutil**: CPU and memory usage on the status bar. * **Nbconvert**: Manipulation of notebooks in the Editor. -* **Qtawesome** 0.4.1+: To have an icon theme based on FontAwesome. +* **Qtawesome** 0.5.0+: To have an icon theme based on FontAwesome. * **Pickleshare**: Show import completions on the Python consoles. * **PyZMQ**: Client for the language server protocol (LSP). * **QtPy** 1.5.0+: Abstraction layer for Python Qt bindings so that Spyder From 335c24570400609f9bba462e896998194ee55556 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Mon, 19 Nov 2018 23:00:46 +0100 Subject: [PATCH 06/12] DarkIcons: code style improvements, update qdarkstyle version --- README.md | 2 +- requirements/requirements.txt | 2 +- spyder/plugins/console/plugin.py | 13 +++++----- .../plugins/console/widgets/internalshell.py | 16 ++++++------ spyder/plugins/console/widgets/shell.py | 26 +++++++++---------- spyder/widgets/findreplace.py | 2 +- spyder/widgets/reporterror.py | 24 ++++++++--------- 7 files changed, 42 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 029f7a7e586..67e0813d2c8 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,7 @@ a Python version greater than 2.7 or 3.4 (Python <=3.3 is no longer supported). * **Cloudpickle**: Serialize variables in the IPython kernel to send to Spyder. * **spyder-kernels** 1.0+: Jupyter kernels for the Spyder console. * **keyring**: Save Github credentials to report errors securely. -* **QDarkStyle** 2.6.0+: A dark stylesheet for Qt applications, used for Spyder's dark theme. +* **QDarkStyle** 2.6.3+: A dark stylesheet for Qt applications, used for Spyder's dark theme. * **pexpect**/**paramiko**: Connect to remote kernels through SSH. ### Optional dependencies diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 2f7b955a6db..8ee7258c585 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -15,4 +15,4 @@ pyqt5 keyring spyder-kernels>=1.0 python-language-server -qdarkstyle>=2.6.0 +qdarkstyle>=2.6.3 diff --git a/spyder/plugins/console/plugin.py b/spyder/plugins/console/plugin.py index 49e841a8acc..6725ba58344 100644 --- a/spyder/plugins/console/plugin.py +++ b/spyder/plugins/console/plugin.py @@ -21,7 +21,6 @@ from qtpy.compat import getopenfilename from qtpy.QtCore import Qt, Signal, Slot from qtpy.QtWidgets import QInputDialog, QLineEdit, QMenu, QHBoxLayout -from qtpy.QtGui import QColor # Local imports from spyder.config.base import _, DEV, get_debug_level @@ -240,12 +239,12 @@ def exception_occurred(self, text, is_traceback): if CONF.get('main', 'show_internal_errors'): if self.error_dlg is None: self.error_dlg = SpyderErrorDialog( - self, - default_foreground_color=MAIN_DEFAULT_FG_COLOR, - error_foreground_color=MAIN_ERROR_FG_COLOR, - traceback_foreground_color=MAIN_TB_FG_COLOR, - prompt_foreground_color=MAIN_PROMPT_FG_COLOR, - background_color=MAIN_BG_COLOR) + self, + default_foreground_color=MAIN_DEFAULT_FG_COLOR, + error_foreground_color=MAIN_ERROR_FG_COLOR, + traceback_foreground_color=MAIN_TB_FG_COLOR, + prompt_foreground_color=MAIN_PROMPT_FG_COLOR, + background_color=MAIN_BG_COLOR) self.error_dlg.close_btn.clicked.connect(self.close_error_dlg) self.error_dlg.rejected.connect(self.remove_error_dlg) self.error_dlg.details.go_to_error.connect(self.go_to_error) diff --git a/spyder/plugins/console/widgets/internalshell.py b/spyder/plugins/console/widgets/internalshell.py index 7bb4c0394e7..e11059d9b7e 100644 --- a/spyder/plugins/console/widgets/internalshell.py +++ b/spyder/plugins/console/widgets/internalshell.py @@ -140,14 +140,14 @@ def __init__(self, parent=None, namespace=None, commands=[], message=None, error_foreground_color=None, traceback_foreground_color=None, prompt_foreground_color=None, background_color=None): PythonShellWidget.__init__( - self, parent, - get_conf_path('history_internal.py'), - profile=profile, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + self, parent, + get_conf_path('history_internal.py'), + profile=profile, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) self.set_color_scheme(default_foreground_color, background_color) self.multithreaded = multithreaded diff --git a/spyder/plugins/console/widgets/shell.py b/spyder/plugins/console/widgets/shell.py index 85c11b85b21..0653ce9a296 100644 --- a/spyder/plugins/console/widgets/shell.py +++ b/spyder/plugins/console/widgets/shell.py @@ -60,12 +60,12 @@ def __init__(self, parent, history_filename, profile=False, parent : specifies the parent widget """ ConsoleBaseWidget.__init__( - self, parent, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + self, parent, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) SaveHistoryMixin.__init__(self, history_filename) BrowseHistoryMixin.__init__(self) @@ -644,13 +644,13 @@ def __init__(self, parent, history_filename, profile=False, error_foreground_color=None, traceback_foreground_color=None, prompt_foreground_color=None, background_color=None): ShellBaseWidget.__init__( - self, parent, history_filename, profile=profile, - initial_message=initial_message, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + self, parent, history_filename, profile=profile, + initial_message=initial_message, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) TracebackLinksMixin.__init__(self) GetHelpMixin.__init__(self) diff --git a/spyder/widgets/findreplace.py b/spyder/widgets/findreplace.py index 2f67f63fe32..9927df561c3 100644 --- a/spyder/widgets/findreplace.py +++ b/spyder/widgets/findreplace.py @@ -104,7 +104,7 @@ def __init__(self, parent, enable_replace=False): self.case_button = create_toolbutton(self, icon=ima.icon( - "format_letter_case"), + "format_letter_case"), tip=_("Case Sensitive")) self.case_button.setCheckable(True) self.case_button.toggled.connect(lambda state: self.find()) diff --git a/spyder/widgets/reporterror.py b/spyder/widgets/reporterror.py index ab7bab930d6..fd957d65835 100644 --- a/spyder/widgets/reporterror.py +++ b/spyder/widgets/reporterror.py @@ -117,12 +117,12 @@ def __init__(self, parent=None, default_foreground_color=None, error_foreground_color=None, traceback_foreground_color=None, prompt_foreground_color=None, background_color=None): ConsoleBaseWidget.__init__( - self, parent, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + self, parent, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) BaseEditMixin.__init__(self) TracebackLinksMixin.__init__(self) self.setReadOnly(True) @@ -195,12 +195,12 @@ def __init__(self, parent=None, is_report=False, # Widget to show errors self.details = ShowErrorWidget( - self, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + self, + default_foreground_color=default_foreground_color, + error_foreground_color=error_foreground_color, + traceback_foreground_color=traceback_foreground_color, + prompt_foreground_color=prompt_foreground_color, + background_color=background_color) self.details.set_pythonshell_font(get_font()) self.details.hide() From 7f44883ae402e5824edad02deafe8880a94ddbab Mon Sep 17 00:00:00 2001 From: dalthviz Date: Wed, 21 Nov 2018 23:16:30 +0100 Subject: [PATCH 07/12] DarkInternalConsole: Simplify color settings setup --- spyder/plugins/console/plugin.py | 37 +++---------------- .../plugins/console/widgets/internalshell.py | 19 +++------- spyder/plugins/console/widgets/shell.py | 24 +++--------- spyder/plugins/editor/widgets/base.py | 26 +++++++++++-- spyder/widgets/reporterror.py | 25 ++----------- 5 files changed, 41 insertions(+), 90 deletions(-) diff --git a/spyder/plugins/console/plugin.py b/spyder/plugins/console/plugin.py index 6725ba58344..d659dbd3c1b 100644 --- a/spyder/plugins/console/plugin.py +++ b/spyder/plugins/console/plugin.py @@ -24,7 +24,6 @@ # Local imports from spyder.config.base import _, DEV, get_debug_level -from spyder.config.gui import is_dark_interface from spyder.config.main import CONF from spyder.utils import icon_manager as ima from spyder.utils.environ import EnvDialog @@ -44,20 +43,6 @@ logger = logging.getLogger(__name__) -if is_dark_interface(): - MAIN_BG_COLOR = '#232629' - MAIN_DEFAULT_FG_COLOR = '#ffffff' - MAIN_ERROR_FG_COLOR = '#FF0000' - MAIN_TB_FG_COLOR = '#0000FF' - MAIN_PROMPT_FG_COLOR = '#00AA00' -else: - MAIN_BG_COLOR = 'white' - MAIN_DEFAULT_FG_COLOR = '#000000' - MAIN_ERROR_FG_COLOR = '#FF0000' - MAIN_TB_FG_COLOR = '#0000FF' - MAIN_PROMPT_FG_COLOR = '#00AA00' - - class Console(SpyderPluginWidget): """ Console widget @@ -75,16 +60,10 @@ def __init__(self, parent=None, namespace=None, commands=[], message=None, self.dialog_manager = DialogManager() # Shell - self.shell = InternalShell( - parent, namespace, commands, message, - self.get_option('max_line_count'), - self.get_plugin_font(), exitfunc, profile, - multithreaded, - default_foreground_color=MAIN_DEFAULT_FG_COLOR, - error_foreground_color=MAIN_ERROR_FG_COLOR, - traceback_foreground_color=MAIN_TB_FG_COLOR, - prompt_foreground_color=MAIN_PROMPT_FG_COLOR, - background_color=MAIN_BG_COLOR) + self.shell = InternalShell(parent, namespace, commands, message, + self.get_option('max_line_count'), + self.get_plugin_font(), exitfunc, profile, + multithreaded) self.shell.status.connect(lambda msg: self.show_message.emit(msg, 0)) self.shell.go_to_error.connect(self.go_to_error) self.shell.focus_changed.connect(lambda: self.focus_changed.emit()) @@ -238,13 +217,7 @@ def exception_occurred(self, text, is_traceback): if CONF.get('main', 'show_internal_errors'): if self.error_dlg is None: - self.error_dlg = SpyderErrorDialog( - self, - default_foreground_color=MAIN_DEFAULT_FG_COLOR, - error_foreground_color=MAIN_ERROR_FG_COLOR, - traceback_foreground_color=MAIN_TB_FG_COLOR, - prompt_foreground_color=MAIN_PROMPT_FG_COLOR, - background_color=MAIN_BG_COLOR) + self.error_dlg = SpyderErrorDialog(self) self.error_dlg.close_btn.clicked.connect(self.close_error_dlg) self.error_dlg.rejected.connect(self.remove_error_dlg) self.error_dlg.details.go_to_error.connect(self.go_to_error) diff --git a/spyder/plugins/console/widgets/internalshell.py b/spyder/plugins/console/widgets/internalshell.py index e11059d9b7e..896d33f7686 100644 --- a/spyder/plugins/console/widgets/internalshell.py +++ b/spyder/plugins/console/widgets/internalshell.py @@ -136,20 +136,11 @@ class InternalShell(PythonShellWidget): def __init__(self, parent=None, namespace=None, commands=[], message=None, max_line_count=300, font=None, exitfunc=None, profile=False, - multithreaded=True, default_foreground_color=None, - error_foreground_color=None, traceback_foreground_color=None, - prompt_foreground_color=None, background_color=None): - PythonShellWidget.__init__( - self, parent, - get_conf_path('history_internal.py'), - profile=profile, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) - - self.set_color_scheme(default_foreground_color, background_color) + multithreaded=True): + PythonShellWidget.__init__(self, parent, + get_conf_path('history_internal.py'), + profile=profile) + self.multithreaded = multithreaded self.setMaximumBlockCount(max_line_count) diff --git a/spyder/plugins/console/widgets/shell.py b/spyder/plugins/console/widgets/shell.py index 0653ce9a296..b92406c79fa 100644 --- a/spyder/plugins/console/widgets/shell.py +++ b/spyder/plugins/console/widgets/shell.py @@ -59,13 +59,7 @@ def __init__(self, parent, history_filename, profile=False, """ parent : specifies the parent widget """ - ConsoleBaseWidget.__init__( - self, parent, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + ConsoleBaseWidget.__init__(self, parent) SaveHistoryMixin.__init__(self, history_filename) BrowseHistoryMixin.__init__(self) @@ -639,18 +633,10 @@ class PythonShellWidget(TracebackLinksMixin, ShellBaseWidget, SEPARATOR = '%s##---(%s)---' % (os.linesep*2, time.ctime()) go_to_error = Signal(str) - def __init__(self, parent, history_filename, profile=False, - initial_message=None, default_foreground_color=None, - error_foreground_color=None, traceback_foreground_color=None, - prompt_foreground_color=None, background_color=None): - ShellBaseWidget.__init__( - self, parent, history_filename, profile=profile, - initial_message=initial_message, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + def __init__(self, parent, history_filename, profile=False, initial_message=None): + ShellBaseWidget.__init__(self, parent, history_filename, + profile=profile, + initial_message=initial_message) TracebackLinksMixin.__init__(self) GetHelpMixin.__init__(self) diff --git a/spyder/plugins/editor/widgets/base.py b/spyder/plugins/editor/widgets/base.py index d1e97f7b3fe..011c6c3eb95 100644 --- a/spyder/plugins/editor/widgets/base.py +++ b/spyder/plugins/editor/widgets/base.py @@ -29,6 +29,7 @@ # Local imports from spyder.config.gui import get_font from spyder.config.main import CONF +from spyder.config.gui import is_dark_interface from spyder.py3compat import PY3, str_lower, to_text_string from spyder.utils import icon_manager as ima from spyder.widgets.calltip import CallTipWidget @@ -38,6 +39,18 @@ from spyder.plugins.editor.utils.decoration import TextDecorationsManager from spyder.plugins.editor.lsp import CompletionItemKind +if is_dark_interface(): + MAIN_BG_COLOR = '#232629' + MAIN_DEFAULT_FG_COLOR = '#ffffff' + MAIN_ERROR_FG_COLOR = '#FF0000' + MAIN_TB_FG_COLOR = '#0000FF' + MAIN_PROMPT_FG_COLOR = '#00AA00' +else: + MAIN_BG_COLOR = 'white' + MAIN_DEFAULT_FG_COLOR = '#000000' + MAIN_ERROR_FG_COLOR = '#FF0000' + MAIN_TB_FG_COLOR = '#0000FF' + MAIN_PROMPT_FG_COLOR = '#00AA00' def insert_text_to(cursor, text, fmt): """Helper to print text, taking into account backspaces""" @@ -1363,9 +1376,7 @@ class ConsoleBaseWidget(TextEditBaseWidget): userListActivated = Signal(int, str) completion_widget_activated = Signal(str) - def __init__(self, parent=None, default_foreground_color=None, - error_foreground_color=None, traceback_foreground_color=None, - prompt_foreground_color=None, background_color=None): + def __init__(self, parent=None): TextEditBaseWidget.__init__(self, parent) self.setMaximumBlockCount(300) @@ -1379,6 +1390,12 @@ def __init__(self, parent=None, default_foreground_color=None, self.userListActivated.connect(lambda user_id, text: self.completion_widget_activated.emit(text)) + background_color = MAIN_BG_COLOR + default_foreground_color = MAIN_DEFAULT_FG_COLOR + error_foreground_color = MAIN_ERROR_FG_COLOR + traceback_foreground_color = MAIN_TB_FG_COLOR + prompt_foreground_color = MAIN_PROMPT_FG_COLOR + self.default_style = ConsoleFontStyle( foregroundcolor=default_foreground_color, backgroundcolor=background_color, @@ -1397,7 +1414,8 @@ def __init__(self, parent=None, default_foreground_color=None, bold=True, italic=False, underline=False) self.font_styles = (self.default_style, self.error_style, self.traceback_link_style, self.prompt_style) - self.set_pythonshell_font() + + self.set_color_scheme(default_foreground_color, background_color) self.setMouseTracking(True) def set_color_scheme(self, foreground_color, background_color): diff --git a/spyder/widgets/reporterror.py b/spyder/widgets/reporterror.py index fd957d65835..8765e416e6e 100644 --- a/spyder/widgets/reporterror.py +++ b/spyder/widgets/reporterror.py @@ -113,16 +113,8 @@ class ShowErrorWidget(TracebackLinksMixin, ConsoleBaseWidget, BaseEditMixin): QT_CLASS = QPlainTextEdit go_to_error = Signal(str) - def __init__(self, parent=None, default_foreground_color=None, - error_foreground_color=None, traceback_foreground_color=None, - prompt_foreground_color=None, background_color=None): - ConsoleBaseWidget.__init__( - self, parent, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + def __init__(self, parent=None): + ConsoleBaseWidget.__init__(self, parent) BaseEditMixin.__init__(self) TracebackLinksMixin.__init__(self) self.setReadOnly(True) @@ -131,10 +123,7 @@ def __init__(self, parent=None, default_foreground_color=None, class SpyderErrorDialog(QDialog): """Custom error dialog for error reporting.""" - def __init__(self, parent=None, is_report=False, - default_foreground_color=None, - error_foreground_color=None, traceback_foreground_color=None, - prompt_foreground_color=None, background_color=None): + def __init__(self, parent=None, is_report=False): QDialog.__init__(self, parent) self.is_report = is_report @@ -194,13 +183,7 @@ def __init__(self, parent=None, is_report=False, self.input_description.textChanged.connect(self._contents_changed) # Widget to show errors - self.details = ShowErrorWidget( - self, - default_foreground_color=default_foreground_color, - error_foreground_color=error_foreground_color, - traceback_foreground_color=traceback_foreground_color, - prompt_foreground_color=prompt_foreground_color, - background_color=background_color) + self.details = ShowErrorWidget(self) self.details.set_pythonshell_font(get_font()) self.details.hide() From 9fcbb8f84052d9262c9ab72ffa41b7653267eabd Mon Sep 17 00:00:00 2001 From: dalthviz Date: Thu, 22 Nov 2018 07:53:00 +0100 Subject: [PATCH 08/12] DarkInternalConsole: Simplify report_issue and update setup.py --- setup.py | 2 +- spyder/app/mainwindow.py | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index be1995cd7b0..f70fa14cd6e 100644 --- a/setup.py +++ b/setup.py @@ -225,7 +225,7 @@ def run(self): 'pyqt5<5.10;python_version>="3"', # Pyls with all its dependencies 'python-language-server[all]', - 'qdarkstyle', + 'qdarkstyle>=2.6.3', # Required to get SSH connections to remote kernels 'pexpect;platform_system!="Windows"', 'paramiko;platform_system=="Windows"' diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py index bc422b8608d..ba698b4ffcb 100644 --- a/spyder/app/mainwindow.py +++ b/spyder/app/mainwindow.py @@ -2568,17 +2568,8 @@ def render_issue(self, description='', traceback=''): def report_issue(self, body=None, title=None, open_webpage=False): """Report a Spyder issue to github, generating body text if needed.""" if body is None: - from spyder.plugins.console import ( - MAIN_BG_COLOR, MAIN_DEFAULT_FG_COLOR, MAIN_ERROR_FG_COLOR, - MAIN_TB_FG_COLOR, MAIN_PROMPT_FG_COLOR) from spyder.widgets.reporterror import SpyderErrorDialog - report_dlg = SpyderErrorDialog( - self, is_report=True, - default_foreground_color=MAIN_DEFAULT_FG_COLOR, - error_foreground_color=MAIN_ERROR_FG_COLOR, - traceback_foreground_color=MAIN_TB_FG_COLOR, - prompt_foreground_color=MAIN_PROMPT_FG_COLOR, - background_color=MAIN_BG_COLOR) + report_dlg = SpyderErrorDialog(self, is_report=True) report_dlg.show() else: if open_webpage: From e06eb92c0ca1e3595dbf2903dc8e2bc3669b0df1 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Thu, 22 Nov 2018 11:04:25 -0500 Subject: [PATCH 09/12] Setup.py: Update minimal QtAwesome version required by us --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f70fa14cd6e..cd41d0e125d 100644 --- a/setup.py +++ b/setup.py @@ -210,13 +210,14 @@ def run(self): 'sphinx', 'pylint', 'psutil', - 'qtawesome>=0.4.1', + 'qtawesome>=0.5.0', 'qtpy>=1.5.0', 'pickleshare', 'pyzmq', 'chardet>=2.0.0', 'numpydoc', 'spyder-kernels>=1.0', + 'qdarkstyle>=2.6.3', # Don't require keyring for Python 2 and Linux # because it depends on system packages 'keyring;sys_platform!="linux2"', @@ -225,7 +226,6 @@ def run(self): 'pyqt5<5.10;python_version>="3"', # Pyls with all its dependencies 'python-language-server[all]', - 'qdarkstyle>=2.6.3', # Required to get SSH connections to remote kernels 'pexpect;platform_system!="Windows"', 'paramiko;platform_system=="Windows"' From 884925ee8b62263c3b0900eb1ce414fd6b9cb12a Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Thu, 22 Nov 2018 11:58:42 -0500 Subject: [PATCH 10/12] Internal console: Apply background color correctly --- spyder/plugins/editor/widgets/base.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spyder/plugins/editor/widgets/base.py b/spyder/plugins/editor/widgets/base.py index 011c6c3eb95..9d7319bdf7f 100644 --- a/spyder/plugins/editor/widgets/base.py +++ b/spyder/plugins/editor/widgets/base.py @@ -1379,6 +1379,12 @@ class ConsoleBaseWidget(TextEditBaseWidget): def __init__(self, parent=None): TextEditBaseWidget.__init__(self, parent) + # We use an object name to set the right background + # color when changing interface theme. This seems to + # be a Qt bug. + # Fixes issue 8072 + self.setObjectName('console') + self.setMaximumBlockCount(300) # ANSI escape code handler From 3b41c5ccd321248966fd86d0f3474dc16ba1510e Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Thu, 22 Nov 2018 14:27:15 -0500 Subject: [PATCH 11/12] Dark theme: Fix background color of several widgets --- spyder/plugins/editor/widgets/base.py | 2 +- spyder/plugins/help/utils/static/dark_css/default.css | 6 +++--- spyder/plugins/plots/plugin.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spyder/plugins/editor/widgets/base.py b/spyder/plugins/editor/widgets/base.py index 9d7319bdf7f..e3072ca5bcd 100644 --- a/spyder/plugins/editor/widgets/base.py +++ b/spyder/plugins/editor/widgets/base.py @@ -40,7 +40,7 @@ from spyder.plugins.editor.lsp import CompletionItemKind if is_dark_interface(): - MAIN_BG_COLOR = '#232629' + MAIN_BG_COLOR = '#19232D' MAIN_DEFAULT_FG_COLOR = '#ffffff' MAIN_ERROR_FG_COLOR = '#FF0000' MAIN_TB_FG_COLOR = '#0000FF' diff --git a/spyder/plugins/help/utils/static/dark_css/default.css b/spyder/plugins/help/utils/static/dark_css/default.css index 14b8ba52d69..49eafb23fff 100644 --- a/spyder/plugins/help/utils/static/dark_css/default.css +++ b/spyder/plugins/help/utils/static/dark_css/default.css @@ -1,5 +1,5 @@ body { - background-color: #232629; + background-color: #19232D; color: white; margin: 0px 25px 15px 25px; } @@ -326,7 +326,7 @@ div.admonition p.admonition-title { .panel { margin-top: 15px; - background-color: #232629; + background-color: #19232D; border: 1px solid transparent; border-radius: 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); @@ -360,7 +360,7 @@ div.admonition p.admonition-title { } .panel-usage > .panel-heading { - color: #232629; + color: #19232D; background-color: #444; border-color: #3498DB; } diff --git a/spyder/plugins/plots/plugin.py b/spyder/plugins/plots/plugin.py index c10c4c7f30d..b83cff139b8 100644 --- a/spyder/plugins/plots/plugin.py +++ b/spyder/plugins/plots/plugin.py @@ -21,7 +21,7 @@ if is_dark_interface(): - MAIN_BG_COLOR = '#232629' + MAIN_BG_COLOR = '#19232D' else: MAIN_BG_COLOR = 'white' From 812ff96a8a47bef75f072f680847b556c53dce44 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Thu, 22 Nov 2018 14:43:04 -0500 Subject: [PATCH 12/12] Internal console: Change color of traceback links in dark mode --- spyder/plugins/editor/widgets/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyder/plugins/editor/widgets/base.py b/spyder/plugins/editor/widgets/base.py index e3072ca5bcd..7e7048a2060 100644 --- a/spyder/plugins/editor/widgets/base.py +++ b/spyder/plugins/editor/widgets/base.py @@ -43,7 +43,7 @@ MAIN_BG_COLOR = '#19232D' MAIN_DEFAULT_FG_COLOR = '#ffffff' MAIN_ERROR_FG_COLOR = '#FF0000' - MAIN_TB_FG_COLOR = '#0000FF' + MAIN_TB_FG_COLOR = '#2980b9' MAIN_PROMPT_FG_COLOR = '#00AA00' else: MAIN_BG_COLOR = 'white'