summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/editor.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2016-05-29 05:40:22 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2016-05-29 05:40:22 (GMT)
commit2bac3b778f0a3efe374334b9694e99ed48431414 (patch)
tree828b05f43f97108e3fa1b9435c1ee8e22d74d6ea /Lib/idlelib/editor.py
parent82069612ec2f1273c7061e099e70bb86bf66e97a (diff)
downloadcpython-2bac3b778f0a3efe374334b9694e99ed48431414.zip
cpython-2bac3b778f0a3efe374334b9694e99ed48431414.tar.gz
cpython-2bac3b778f0a3efe374334b9694e99ed48431414.tar.bz2
Issue #27117: Make colorizer htest and turtledemo work with dark theme.
Factor out code for configuring text widget colors to a new function.
Diffstat (limited to 'Lib/idlelib/editor.py')
-rw-r--r--Lib/idlelib/editor.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/Lib/idlelib/editor.py b/Lib/idlelib/editor.py
index 3aa5278..d7d1d16 100644
--- a/Lib/idlelib/editor.py
+++ b/Lib/idlelib/editor.py
@@ -90,7 +90,7 @@ helpDialog = HelpDialog() # singleton instance, no longer used
class EditorWindow(object):
from idlelib.percolator import Percolator
- from idlelib.colorizer import ColorDelegator
+ from idlelib.colorizer import ColorDelegator, color_config
from idlelib.undo import UndoDelegator
from idlelib.iomenu import IOBinding, filesystemencoding, encoding
from idlelib import mainmenu
@@ -742,20 +742,7 @@ class EditorWindow(object):
# Called from self.filename_change_hook and from configdialog.py
self._rmcolorizer()
self._addcolorizer()
- theme = idleConf.CurrentTheme()
- normal_colors = idleConf.GetHighlight(theme, 'normal')
- cursor_color = idleConf.GetHighlight(theme, 'cursor', fgBg='fg')
- select_colors = idleConf.GetHighlight(theme, 'hilite')
- self.text.config(
- foreground=normal_colors['foreground'],
- background=normal_colors['background'],
- insertbackground=cursor_color,
- selectforeground=select_colors['foreground'],
- selectbackground=select_colors['background'],
- )
- if TkVersion >= 8.5:
- self.text.config(
- inactiveselectbackground=select_colors['background'])
+ EditorWindow.color_config(self.text)
IDENTCHARS = string.ascii_letters + string.digits + "_"