10000 [3.12] gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (GH-120605) by miss-islington · Pull Request #122592 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (GH-120605) #122592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Lib/idlelib/News3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Released after 2023-10-02
=========================


gh-120083: Add explicit black IDLE Hovertip foreground color needed for
recent macOS. Fixes Sonoma showing unreadable white on pale yellow.
Patch by John Riggles.

gh-122482: Change About IDLE to direct users to discuss.python.org
instead of the now unused idle-dev email and mailing list.

Expand Down
8 changes: 6 additions & 2 deletions Lib/idlelib/tooltip.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def hidetip(self):

class Hovertip(OnHoverTooltipBase):
"A tooltip that pops up when a mouse hovers over an anchor widget."
def __init__(self, anchor_widget, text, hover_delay=1000):
def __init__(self, anchor_widget, text, hover_delay=1000,
foreground="#000000", background="#ffffe0"):
"""Create a text tooltip with a mouse hover delay.

anchor_widget: the widget next to which the tooltip will be shown
Expand All @@ -156,10 +157,13 @@ def __init__(self, anchor_widget, text, hover_delay=1000):
"""
super().__init__(anchor_widget, hover_delay=hover_delay)
self.text = text
self.foreground = foreground
self.background = background

def showcontents(self):
label = Label(self.tipwindow, text=self.text, justify=LEFT,
background="#ffffe0", relief=SOLID, borderwidth=1)
relief=SOLID, borderwidth=1,
foreground=self.foreground, background=self.background)
label.pack()


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add explicit black IDLE Hovertip foreground color needed for recent macOS. Fixes Sonoma showing unreadable white on pale yellow. Patch by John Riggles.
Loading
0