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
Added ability to change text color of the help text #1053
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry it's taken me so long to get around to this....
And also, I'm going to make you change it. I hadn't really looked at the original issue too much. It seems that the foreground color should always be black, rather than user selectable, so the config stuff isn't really necessary (sorry about that!).
If you can make the following changes, I'll merge.
self.add_item( | ||
section=section, title="text_color", datatype=str, | ||
choices=["black", "red", "green", "blue", "yellow"], | ||
default="black", group="font", info="Help text color.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -7,6 +7,7 @@ | |||
import sys | |||
import tkinter as tk | |||
from tkinter import ttk, TclError | |||
from matplotlib import colors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
@@ -571,6 +572,7 @@ def __init__(self, widget, *, background="#FFFFEA", pad=(5, 3, 5, 3), text="widg | |||
self._widget.bind("<ButtonPress>", self._on_leave) | |||
self._background = background | |||
self._pad = pad | |||
self._textcolor = colors.cnames[get_config().user_config_dict["text_color"]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New optional parameter in Tooltip.__init__()
foreground="#000000,
Then referenced here.
self._foreground = foreground
@@ -662,6 +664,7 @@ def tip_pos_calculator(widget, label, | |||
text=self._text, | |||
justify=tk.LEFT, | |||
background=background, | |||
foreground=self._textcolor, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
foreground=self._foreground,
Addressing issue #1047
I added the option to change the font color of the help text.