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.87k stars 110 forks source link

File selection box unreadable on X11 with dark ttk theme #104

Open mak448a opened 1 year ago

mak448a commented 1 year ago

[EDIT] I didn't include operating system info

Fedora 38 KDE, Python 3.11.4

image

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()
rdbende commented 1 year ago

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.

mak448a commented 1 year ago

It's on Wayland, too. But it's running on XWayland, so I guess that doesn't really count. Also, great theme!

rdbende commented 1 year ago

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.

mak448a commented 1 year ago

Wow didn't know you used Fedora too

ethical-haquer commented 9 months ago

I was able to get this result: Dark_Theme_Filepicker 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.