summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2024-05-06 07:55:56 (GMT)
committerGitHub <noreply@github.com>2024-05-06 07:55:56 (GMT)
commit7758be431807d574e0f1bbab003796585ae46719 (patch)
treea57090227e823329e51709f910499c50b18afc4c /Lib/idlelib
parenta8e5fed1007233f677d3539162257b99b920df00 (diff)
downloadcpython-7758be431807d574e0f1bbab003796585ae46719.zip
cpython-7758be431807d574e0f1bbab003796585ae46719.tar.gz
cpython-7758be431807d574e0f1bbab003796585ae46719.tar.bz2
gh-78955: Use user-selected color theme for Help => IDLE Doc (#9502)
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/News3.txt2
-rw-r--r--Lib/idlelib/help.py7
2 files changed, 7 insertions, 2 deletions
diff --git a/Lib/idlelib/News3.txt b/Lib/idlelib/News3.txt
index 241b1f4..fb07d7b 100644
--- a/Lib/idlelib/News3.txt
+++ b/Lib/idlelib/News3.txt
@@ -4,6 +4,8 @@ Released on 2024-10-xx
=========================
+gh-78955: Use user-selected color theme for Help => IDLE Doc.
+
gh-96905: In idlelib code, stop redefining built-ins 'dict' and 'object'.
gh-72284: Improve the lists of features, editor key bindings,
diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py
index bdf4b2b..d8613b2 100644
--- a/Lib/idlelib/help.py
+++ b/Lib/idlelib/help.py
@@ -33,6 +33,7 @@ from tkinter.ttk import Frame, Menubutton, Scrollbar, Style
from tkinter import font as tkfont
from idlelib.config import idleConf
+from idlelib.colorizer import color_config
## About IDLE ##
@@ -177,14 +178,16 @@ class HelpText(Text):
normalfont = self.findfont(['TkDefaultFont', 'arial', 'helvetica'])
fixedfont = self.findfont(['TkFixedFont', 'monaco', 'courier'])
+ color_config(self)
self['font'] = (normalfont, 12)
self.tag_configure('em', font=(normalfont, 12, 'italic'))
self.tag_configure('h1', font=(normalfont, 20, 'bold'))
self.tag_configure('h2', font=(normalfont, 18, 'bold'))
self.tag_configure('h3', font=(normalfont, 15, 'bold'))
- self.tag_configure('pre', font=(fixedfont, 12), background='#f6f6ff')
+ self.tag_configure('pre', font=(fixedfont, 12))
+ preback = self['selectbackground']
self.tag_configure('preblock', font=(fixedfont, 10), lmargin1=25,
- borderwidth=1, relief='solid', background='#eeffcc')
+ background=preback)
self.tag_configure('l1', lmargin1=25, lmargin2=25)
self.tag_configure('l2', lmargin1=50, lmargin2=50)
self.tag_configure('l3', lmargin1=75, lmargin2=75)