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

tkcalendar breaks when you apply the sun valley theme #138

Open
Tervicke opened this issue May 10, 2024 · 1 comment
Open

tkcalendar breaks when you apply the sun valley theme #138

Tervicke opened this issue May 10, 2024 · 1 comment

Comments

@Tervicke
Copy link

Tervicke commented May 10, 2024

tkcalendar which is a famous calendar written with tkinter breaks when u apply the sun valley theme the most notable and important thing it changes is it sets the current_date_selected to the same color which obviously ruins the whole point of the calendar , here is the example code below

import tkinter as tk
from tkcalendar import Calendar
import sv_ttk

root = tk.Tk()
root.title("Calendar Example")

cal = Calendar(root, selectmode="day", date_pattern="yyyy-mm-dd")
cal.pack(padx=10, pady=10)

sv_ttk.set_theme('Dark') 
root.mainloop()

the output I get is this
image
and if you remove the theme the output is
image
As you can see the the date of 10 is highlighted because that's the current date selected
tkcalendar does provide a way to change the selectedbackground which I tried after settings the sun valley theme thinking it might override the theme but that doesn't seem to work either
the code is here

import tkinter as tk
from tkcalendar import Calendar
import sv_ttk

root = tk.Tk()
root.title("Calendar Example")

cal = Calendar(root, selectmode="day", date_pattern="yyyy-mm-dd")
cal.pack(padx=10, pady=10)

sv_ttk.set_theme('Dark') 
cal.config(selectbackground="blue") 
root.mainloop()
@ebits21
Copy link

ebits21 commented May 19, 2024

I noticed this too. I moved the call to sv-ttk.settheme to before my date entry widget and then it ignores the sunvalley theme and today is highlighted again.

Would love to have it themed better!

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

No branches or pull requests

2 participants