Skip to content

Commit

Permalink
Merge pull request #8081 from ccordoba12/fix-bg-color
Browse files Browse the repository at this point in the history
PR: Make all editor's background color to be applied correctly
  • Loading branch information
ccordoba12 authored Oct 15, 2018
2 parents bdb7543 + 16340f6 commit 2857a6f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 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
23 changes: 12 additions & 11 deletions spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,17 +297,18 @@ 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')
elif 'errordialog' in plugin_name.lower():
self.setObjectName('errordialog')

# Caret (text cursor)
self.setCursorWidth( CONF.get('main', 'cursor/width') )
Expand Down
4 changes: 3 additions & 1 deletion spyder/widgets/reporterror.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from spyder import __project_url__, __trouble_url__
from spyder.config.base import _
from spyder.config.gui import get_font
from spyder.config.gui import CONF
from spyder.utils import icon_manager as ima
from spyder.utils.qthelpers import restore_keyevent
from spyder.widgets.github.backend import GithubBackend
Expand All @@ -46,7 +47,8 @@ def __init__(self, parent=None):
# Editor options
self.setup_editor(
language='md',
color_scheme='Scintilla',
color_scheme=CONF.get('color_schemes',
'selected'),
linenumbers=False,
scrollflagarea=False,
wrap=True,
Expand Down

0 comments on commit 2857a6f

Please sign in to comment.