From 487c2cdf5538768c967111b89b7c069125b7d8dc Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Sun, 23 Sep 2018 01:37:32 -0400 Subject: [PATCH 1/4] bpo-34774: Use user-selected color theme for Help => IDLE Help. --- Lib/idlelib/help.py | 7 +++++-- .../next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py index 21b5ea5a816e3f..776aaee437ccc5 100644 --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -33,6 +33,7 @@ from tkinter import font as tkfont from idlelib.config import idleConf +from idlelib.colorizer import color_config ## About IDLE ## @@ -162,14 +163,16 @@ def __init__(self, parent, filename): 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 = '#eeffcc' if self['fg'] == '#000000' else self['bg'] self.tag_configure('preblock', font=(fixedfont, 10), lmargin1=25, - borderwidth=1, relief='solid', background='#eeffcc') + borderwidth=1, relief='solid', 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) diff --git a/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst b/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst new file mode 100644 index 00000000000000..47ad4ce1643c0b --- /dev/null +++ b/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst @@ -0,0 +1 @@ +Use user-selected color theme for Help => IDLE Help. From 97f2fa69b894943adb0d59d4d9571aad6066ce98 Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 6 May 2024 03:06:32 -0400 Subject: [PATCH 2/4] Use selectbackground for code blocks --- Lib/idlelib/help.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/help.py b/Lib/idlelib/help.py index 493d3a7ffa57d8..d8613b2eadd6aa 100644 --- a/Lib/idlelib/help.py +++ b/Lib/idlelib/help.py @@ -185,9 +185,9 @@ def __init__(self, parent, filename): self.tag_configure('h2', font=(normalfont, 18, 'bold')) self.tag_configure('h3', font=(normalfont, 15, 'bold')) self.tag_configure('pre', font=(fixedfont, 12)) - preback = '#eeffcc' if self['fg'] == '#000000' else self['bg'] + preback = self['selectbackground'] self.tag_configure('preblock', font=(fixedfont, 10), lmargin1=25, - borderwidth=1, relief='solid', background=preback) + 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) From 18001675610102462f5c06a5c666aa1e382573ab Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 6 May 2024 03:09:58 -0400 Subject: [PATCH 3/4] Update Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst --- Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst b/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst index 47ad4ce1643c0b..cac44b13f3f1fa 100644 --- a/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst +++ b/Misc/NEWS.d/next/IDLE/2018-09-23-01-36-39.bpo-34774.VeM-X-.rst @@ -1 +1 @@ -Use user-selected color theme for Help => IDLE Help. +Use user-selected color theme for Help => IDLE Doc. From 00168983c15bab9bec72faacda1f17f4c1caeebd Mon Sep 17 00:00:00 2001 From: Terry Jan Reedy Date: Mon, 6 May 2024 03:18:16 -0400 Subject: [PATCH 4/4] News item. --- Lib/idlelib/News3.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/idlelib/News3.txt b/Lib/idlelib/News3.txt index 241b1f48e5c1d8..fb07d7b3b3fad8 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,