rdbende / Sun-Valley-ttk-theme

A gorgeous theme for Tkinter/ttk, based on the Sun Valley visual style ✨
https://pypi.org/project/sv-ttk
MIT License
1.78k stars 106 forks source link

tkcalendar breaks when you apply the sun valley theme #138

Open Tervicke opened 1 month ago

Tervicke commented 1 month ago

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 commented 1 month ago

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!