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

Do not config menus on windows #126

Merged
merged 1 commit into from Jan 28, 2024
Merged

Do not config menus on windows #126

merged 1 commit into from Jan 28, 2024

Conversation

Akuli
Copy link
Contributor

@Akuli Akuli commented Jan 15, 2024

Fixes Akuli/porcupine#1431

I haven't tested this on Windows.

@rdbende
Copy link
Owner

rdbende commented Jan 15, 2024

@littlewhitecloud this should solve your issue. Can you confirm?

@littlewhitecloud
Copy link
Contributor

I will test it later because I'm doing my final exam.

@littlewhitecloud
Copy link
Contributor

littlewhitecloud commented Jan 21, 2024

image
It is very useful but it won't apply the dark theme if you don't add a new widget into the window.
Before:
image

After:
image

import tkinter
import tkinter.ttk
import sv_ttk  # pip install sv-ttk

root = tkinter.Tk()
sv_ttk.set_theme('dark')  # Try removing this line

main_menu = tkinter.Menu()
root.config(menu=main_menu)

submenu = tkinter.Menu(main_menu, tearoff=False)
main_menu.add_cascade(label="File", menu=submenu)

submenu.add_command(label="New File", accelerator="Ctrl+N")
submenu.add_command(label="Open", accelerator="Ctrl+O")
submenu.add_command(label="Save", accelerator="Ctrl+S", state="disabled")
submenu.add_command(label="Save As", accelerator="Ctrl+Shift+S", state="disabled")
submenu.add_separator()
submenu.add_command(label="Close", accelerator="Ctrl+W", state="disabled")
submenu.add_command(label="Quit", accelerator="Ctrl+Q")


testbutton = tkinter.ttk.Button(root, text="test")
testbutton.pack()

root.mainloop()

@littlewhitecloud
Copy link
Contributor

Nevermind, maybe it is vaild.

@Akuli
Copy link
Contributor Author

Akuli commented Jan 22, 2024

I personally would prefer the menus without dark theme applied to them. You can at least clearly see what's disabled. And as rdbende said, the menu bar doesn't become dark anyway.

I'd suggest we merge this.

@littlewhitecloud
Copy link
Contributor

littlewhitecloud commented Jan 23, 2024

I do think so. Maybe I had figure out where is the problem is, but I need time to do it... Maybe merge it is a good idea...

@rdbende rdbende merged commit 2205b9e into rdbende:main Jan 28, 2024
17 checks passed
@rdbende
Copy link
Owner

rdbende commented Jan 28, 2024

Thanks!

@rdbende
Copy link
Owner

rdbende commented Jan 28, 2024

#127 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Text is blur in the disabled menu on windows when using svttk
3 participants