Open Nitaki-dev opened 4 months ago
Hi, can you share the steps to reproduce this? Last time I checked the behavior was the same with the default theme, and the selection went away when another widget was focused.
You can recreate this by running the Widget demo, and changing the value of the readonly combobox to anything, and then click on anythingelse to change the focus
Hmm, I see no difference, except that with clam the selection is grey when unfocused.
sv-ttk: Képernyőfelvétel 2024-04-27 18-11-26.webm
clam: Képernyőfelvétel 2024-04-27 18-14-03.webm
ps: forgot to record the mouse :D
default theme: Képernyőfelvétel 2024-04-27 18-34-41.webm
And yes, there's a difference between the three, though I'm not sure which behavior sv-ttk
should follow.
huh, weird. for me without any themes it does this:
https://github.com/rdbende/Sun-Valley-ttk-theme/assets/64524466/b672c3b5-af78-4afe-b715-61a7e455a7ad
As you can see, whenever the focus is taken away from the combobox, the blue background disappears.
Im not sure if that is how you want sv-ttk
to function, but i think thats how it should be. Are there any ways for me to still achieve this?
I also encountered this problem. In the default theme, the highlight is removed when the widget loses focus, but in sv-ttk the highlight remains.
The solution for me is as follows (https://stackoverflow.com/a/71531095):
def on_select(event):
selected = var.get()
combobox.set("")
combobox.set(select)
combobox.bind("<<ComboboxSelected>>", on_select)
After selecting any item from a combobox, the text highlight stays, even when the combobox no longer has focus. (in both light and dark theme)
With theme:
Without theme (how it should be):