Sun-Valley-ttk-theme
Sun-Valley-ttk-theme copied to clipboard
File selection box unreadable on X11 with dark ttk theme
[EDIT] I didn't include operating system info
Fedora 38 KDE, Python 3.11.4
from tkinter import *
from tkinter import ttk
import platform
from PIL import ImageTk, Image
import sv_ttk
from tkinter import filedialog
root = Tk()
# root.geometry("800x800")
root.title("Image viewer")
sv_ttk.set_theme("dark")
root.filename = filedialog.askopenfilename(initialdir="~")
root.mainloop()
Also adding, that after selecting and deselecting items again, the text remains black. May even be a bug in Tk, because the widget seems to be initialized with the wrong colors.
It's on Wayland, too. But it's running on XWayland, so I guess that doesn't really count. Also, great theme!
I use Wayland too (Fedora 38 GNOME Wayland session), but indeed, it's running on XWayland, since Tk doesn't have a Wayland native implementation.
Wow didn't know you used Fedora too
I was able to get this result:
using code like this:
from threading import Timer
def open_file():
def change_theme():
sv_ttk.set_theme('dark')
sv_ttk.set_theme('light')
t = Timer(0, change_theme)
t.start()
file_path = filedialog.askopenfilename(args**)
It's nowhere near ideal, seeing as how the whole app has to change themes, but it does work.