-
Notifications
You must be signed in to change notification settings - Fork 49
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
Get the window background dark when using a dark theme #50
Comments
What I think the real problem is here, is that As for multiple windows, the library does not officially support using multiple Clearly the docstrings (and thus the documentation) are unclear in this regard, and it should be improved. Changing the keyword argument name is something I would prefer to save for another set of big changes that break backwards-compatibility. In the meantime, using the |
Check out the updated documentation here, and let me know what you think. |
I think it's OK. Toplevel is a ThemedTk argument? |
Yes, |
I've found out that by doesn't work |
Do you mean that the |
Yeah. Maybe could it be my code (PR #51) that blocks bg? (Note that background argument is working with that code) |
How are you trying to use the import tkinter as tk
w = tk.Tk(background='blue') is supposed to raise an error. The options of a window can only be configured after it has been created. Your code should not influence the behaviour of the |
I use |
Using w = ThemedTk()
w.config(background="blue") # OR w.config(bg="blue"), they are equal
OR
w = ThemedTk(background=True) # Background is theme-appropriate if available |
Ok, I've tried the code. It works well the second option, but with light themes there is the grey background that is very ugly. Also, if I use the first code, widgets' background isn't changed (while my code do this). Also, my code adapt the background to a dark theme if that is specified. Example:
|
The widgets background is not changed because I do not think it is appropriate to do that from Python code. The background color of widgets should be configured in the theme settings instead, and I am open to that if the background color of the widgets is indeed inappropriate. I have not tested all themes beyond the simple To be honest, I do not really like that approach as its behaviour is inconsistent. Instead, what I think would be ideal and clear up all confusion is to choose to change the The only way to properly introduce such a change is to use a deprecation notice (as I do not currently have major changes planned to warrant a major version bump), but I do not know when I will have time to implement such a change. Please know that I do very much appreciate your contributions through this issue. Critical thinking helps improve this library! |
Commit |
I think you should add the https://ttkthemes.readthedocs.io/en/background/example.html So it reads this instead:
Edit: Thanks a lot for developing ttkthemes I really appreciate it. 👍 |
@Azza-NZ Indeed, re-reading that part of the documentation definitely makes me realize that it is unclear. I did work on this before, but it never made it into the new release because actually I had hoped to finish the Materia theme before then. In any case, I have made some changes in the Also, could you maybe post a link to the forum where people are asking questions? I check StackOverflow like once a month, but I am wondering where other people are asking questions so maybe I can jump on things like this sooner.
Thank you! Positive feedback is what motivates me to work on a project more. |
Yeah that looks good have you considered having it set to True by default? A user can set it to False manually if they don't want it. |
@Azza-NZ I have actually considered it, but I want |
Version |
Hi,
I've noticed that when I'm using a dark theme the window background remains grey. How can I avoid this?
Also, window (Tk or toplevel) is from the base tkinter library.
Thanks
EDIT: I found a working solution, using the lookup method:
window.configure(bg=s.lookup("TButton", "background"))
The bad thing is that you have to do this for every window you have.
@RedFantom is it possible to get a list of dark themes (maybe with a method), so that I can set a white background when there is a light theme?
EDIT 2: I've also tried ThemedTk but it seems that background option doesn't work...
EDIT 3: I've fixed ThemedTk background issue with PR #51
The text was updated successfully, but these errors were encountered: