Open legopitstop opened 1 year ago
@legopitstop Somehow, this is a bug. But there is a way to fix this. Add this code under toggle_fullscreen():
import ctypes
if customtkinter.get_appearance_mode()=="Dark":
value=1
else:
value=0
try:
hwnd = ctypes.windll.user32.GetParent(self.winfo_id())
DWMWA_USE_IMMERSIVE_DARK_MODE = 20
DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 = 19
if ctypes.windll.dwmapi.DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE,
ctypes.byref(ctypes.c_int(value)),
ctypes.sizeof(ctypes.c_int(value))) != 0:
ctypes.windll.dwmapi.DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1,
ctypes.byref(ctypes.c_int(value)),
ctypes.sizeof(ctypes.c_int(value)))
except Exception as err:
print(err)
Other useful links: https://github.com/TomSchimansky/CustomTkinter/discussions/1011#discussioncomment-4626534
CTk window loses its themed title bar when you exit fullscreen
customtkinter:
5.0.3
OS:Windows 10
Steps To Reproduce
Observed Results
Code: