Open OddUnicorn opened 1 year ago
I already call self.set_appearance_mode("dark")
after toggling fullscreen mode. My approach just looks a little different:
self.bind('<f>', self.toggle_fullscreen)
[...]
def toggle_fullscreen(self, event=None):
# Toggle between fullscreen and windowed modes
self.attributes("-fullscreen", not self.attributes("-fullscreen"))
self.after(50, lambda: self.draw_image)
self.after(50, lambda: ctk.set_appearance_mode("dark"))
Anyway, it doesn't help, the title bar won't switch back to dark mode. Just for clarification, CTk sometimes needs some time to end it's tasks, therefore the delayed scheduling, just to be on the safe side.
well, I'm still looking for a solution...
As a quick fix you can update to the correct titlebar color with this:
self._windows_set_titlebar_color(self._get_appearance_mode())
where self
is an instance of CTk
.
I start my app with
app = customtkinter.CTk
app.set_appearance_mode("dark")
andapp.after(0, lambda: app.wm_state('zoomed'))
. Than I enable fullscreen withapp.attributes("-fullscreen", true)
. After disabling fullscreen withapp.attributes("-fullscreen", false)
, the mode for the window title bar has changed from "dark" to "light". I tried to set it back to dark mode withapp.set_appearance_mode("dark")
but it stays in light mode. Is this a bug? Is there a workaround I could try?