Skip to content

Commit

Permalink
Editor: Fix background color when interface is dark
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Oct 15, 2018
1 parent bdb7543 commit 269669b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
11 changes: 5 additions & 6 deletions spyder/plugins/editor/widgets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,11 @@ def set_palette(self, background, foreground):

# Set the right background color when changing color schemes
# or creating new Editor windows. This seems to be a Qt bug.
# Fixes Issue 2028
if sys.platform == 'darwin':
if self.objectName():
style = "QPlainTextEdit#%s {background: %s; color: %s;}" % \
(self.objectName(), background.name(), foreground.name())
self.setStyleSheet(style)
# Fixes Issue 2028 and 8069
if self.objectName():
style = "QPlainTextEdit#%s {background: %s; color: %s;}" % \
(self.objectName(), background.name(), foreground.name())
self.setStyleSheet(style)


#------Extra selections
Expand Down
21 changes: 10 additions & 11 deletions spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,16 @@ def __init__(self, parent=None):
# We use these object names to set the right background
# color when changing color schemes or creating new
# Editor windows. This seems to be a Qt bug.
# Fixes Issue 2028
if sys.platform == 'darwin':
plugin_name = repr(parent)
if 'editor' in plugin_name.lower():
self.setObjectName('editor')
elif 'help' in plugin_name.lower():
self.setObjectName('help')
elif 'historylog' in plugin_name.lower():
self.setObjectName('historylog')
elif 'configdialog' in plugin_name.lower():
self.setObjectName('configdialog')
# Fixes issues 2028 and 8069
plugin_name = repr(parent)
if 'editor' in plugin_name.lower():
self.setObjectName('editor')
elif 'help' in plugin_name.lower():
self.setObjectName('help')
elif 'historylog' in plugin_name.lower():
self.setObjectName('historylog')
elif 'configdialog' in plugin_name.lower():
self.setObjectName('configdialog')

# Caret (text cursor)
self.setCursorWidth( CONF.get('main', 'cursor/width') )
Expand Down

0 comments on commit 269669b

Please sign in to comment.