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

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

Open
mak448a opened this issue Jul 21, 2023 · 5 comments
Open

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

mak448a opened this issue Jul 21, 2023 · 5 comments
Labels
bug Something isn't working high priority linux

Comments

@mak448a
Copy link

mak448a commented Jul 21, 2023

[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 rdbende added bug Something isn't working linux labels Jul 21, 2023
@rdbende
Copy link
Owner

rdbende commented Jul 24, 2023

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.

@rdbende rdbende pinned this issue Jul 24, 2023
@rdbende rdbende changed the title Doesn't theme file dialog File selection box unreadable on X11 with dark ttk theme Jul 24, 2023
@mak448a
Copy link
Author

mak448a commented Jul 24, 2023

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

@rdbende
Copy link
Owner

rdbende commented Jul 24, 2023

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
Copy link
Author

mak448a commented Jul 24, 2023

Wow didn't know you used Fedora too

@ethical-haquer
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority linux
Projects
None yet
Development

No branches or pull requests

3 participants