mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #27117: Make colorizer htest and turtledemo work with dark theme.
Factor out code for configuring text widget colors to a new function.
This commit is contained in:
parent
82069612ec
commit
2bac3b778f
3 changed files with 31 additions and 16 deletions
|
@ -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 + "_"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue