Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

ZichermanSoftware
Copy link

Addressing issue #1047

I added the option to change the font color of the help text.

Copy link
Collaborator

@torzdf torzdf left a 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.

Comment on lines +59 to +62
self.add_item(
section=section, title="text_color", datatype=str,
choices=["black", "red", "green", "blue", "yellow"],
default="black", group="font", info="Help text color.")
Copy link
Collaborator

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
Copy link
Collaborator

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"]]
Copy link
Collaborator

@torzdf torzdf Sep 24, 2020

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,
Copy link
Collaborator

@torzdf torzdf Sep 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

foreground=self._foreground,

@torzdf
Copy link
Collaborator

torzdf commented Mar 20, 2021

Thanks for this PR.

It has now been superseded by these commits:

a49f810
6872173

@torzdf torzdf closed this Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants