Skip to content

Commit 6abf840

Browse files
[3.12] gh-78955: Use user-selected color theme for Help => IDLE Doc (GH-9502) (#118632)
gh-78955: Use user-selected color theme for Help => IDLE Doc (GH-9502) (cherry picked from commit 7758be4) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent 11594da commit 6abf840

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Lib/idlelib/News3.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Released after 2023-10-02
44
=========================
55

66

7+
gh-78955: Use user-selected color theme for Help => IDLE Doc.
8+
79
gh-96905: In idlelib code, stop redefining built-ins 'dict' and 'object'.
810

911
gh-72284: Improve the lists of features, editor key bindings,

Lib/idlelib/help.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
from tkinter import font as tkfont
3434

3535
from idlelib.config import idleConf
36+
from idlelib.colorizer import color_config
3637

3738
## About IDLE ##
3839

@@ -177,14 +178,16 @@ def __init__(self, parent, filename):
177178

178179
normalfont = self.findfont(['TkDefaultFont', 'arial', 'helvetica'])
179180
fixedfont = self.findfont(['TkFixedFont', 'monaco', 'courier'])
181+
color_config(self)
180182
self['font'] = (normalfont, 12)
181183
self.tag_configure('em', font=(normalfont, 12, 'italic'))
182184
self.tag_configure('h1', font=(normalfont, 20, 'bold'))
183185
self.tag_configure('h2', font=(normalfont, 18, 'bold'))
184186
self.tag_configure('h3', font=(normalfont, 15, 'bold'))
185-
self.tag_configure('pre', font=(fixedfont, 12), background='#f6f6ff')
187+
self.tag_configure('pre', font=(fixedfont, 12))
188+
preback = self['selectbackground']
186189
self.tag_configure('preblock', font=(fixedfont, 10), lmargin1=25,
187-
borderwidth=1, relief='solid', background='#eeffcc')
190+
background=preback)
188191
self.tag_configure('l1', lmargin1=25, lmargin2=25)
189192
self.tag_configure('l2', lmargin1=50, lmargin2=50)
190193
self.tag_configure('l3', lmargin1=75, lmargin2=75)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use user-selected color theme for Help => IDLE Doc.

0 commit comments

Comments
 (0)