Akascape / py-window-styles

Customize your python UI window with awesome pre-built windows 11 themes.
Creative Commons Zero v1.0 Universal
257 stars 15 forks source link

acrylic on windows 11 #17

Closed youngtutorsuk closed 3 months ago

youngtutorsuk commented 4 months ago

import customtkinter import os from PIL import Image import pywinstyles

class App(customtkinter.CTk): def init(self): super().init()

    self.title("TASK V1")
    self.iconbitmap(r"C:\Users\musta\Downloads\New folder\bot.ico")
    self.grid_rowconfigure(1, weight=1)
    self.columnconfigure(2, weight=1)

    # create scrollable checkbox frame
    self.scrollable_checkbox_frame = ScrollableCheckBoxFrame(master=self, width=200, command=self.checkbox_frame_event,
                                                             item_list=[f"item {i}" for i in range(15)])
    self.scrollable_checkbox_frame.grid(row=1, column=0, padx=15, pady=15, sticky="ns")

if name == "main":

app = App() pywinstyles.apply_style(app, 'acrylic') app.mainloop() self.toplevel_window.focus() not particularly the code but across all the gui's that were previously working with the acrylic window now only appear slightly grey ever since my laptop updated to the latest windows 11 update

littlewhitecloud commented 4 months ago

I am not getting this error, but if you got something like this: image That means your window is not focus every time.

youngtutorsuk commented 4 months ago

how can i solve the issue?

Akascape commented 4 months ago

@youngtutorsuk Try aero theme

youngtutorsuk commented 4 months ago

with aero theme the background and title bar to turn black

littlewhitecloud commented 4 months ago

Again, I am still not getting the black background. image

Also, acrylic works fine on Windows 11. (But it seems that it don't work fine on Windows 10) image

youngtutorsuk commented 3 months ago

Windows 11 Home version 23H2 osbuild 22631.3155

littlewhitecloud commented 3 months ago

image

I am using 23H2 22631.2861 and I will update win11 later.

Akascape commented 3 months ago

@littlewhitecloud I am also using the same version 23H2 osbuild 22631.3155, this is the acrylic and aero themes: image

Akascape commented 3 months ago

Acrylic has been modified to reduce gpu usage, but there is a focus out issue with that. But aero is still not changed and uses gpu, so use aero in that case.

littlewhitecloud commented 3 months ago

@littlewhitecloud I am also using the same version 23H2 osbuild 22631.3155, this is the acrylic and aero themes: image

Does it work well? Or what's the meaning of the slight grey?

Akascape commented 3 months ago

@littlewhitecloud the window looks a little greyish in this version, that's all. And the focus out removes all the transparency and make it grey.

littlewhitecloud commented 3 months ago

@littlewhitecloud the window looks a little greyish in this version, that's all. And the focus out removes all the transparency and make it grey.

I see. Maybe this color 292929 makes the window looks a bit grey.

ChangeDWMAccent(self.HWND, 30, 3, color=0x292929)

image

https://github.com/Akascape/py-window-styles/blob/d3aaf0a6fc4a905eec0d3a21820f3caa48f12d28/pywinstyles/py_win_style.py#L81C1-L81C62

Set it to 0x000000 may fix this.

littlewhitecloud commented 3 months ago

image I have just updated windows11 and now it is 22631.3296. Everythings works as fine as the version below.

with aero theme the background and title bar to turn black

The titlebar will turn black right, but if the background turns black too, I think maybe you used ExtendFrameIntoClientArea. Or the aero theme were not applied. image

Acrylic has been modified to reduce gpu usage, but there is a focus out issue with that. But aero is still not changed and uses gpu, so use aero in that case.

Also, the window with acrylic effect may turn grey after focus out, it is legall. Because it can reduce the GPU usage and use less resource when the window is focus out and don't need to draw that. The window with mica effect will also turn grey.

littlewhitecloud commented 3 months ago

Is there anything wrong?

Akascape commented 3 months ago

@littlewhitecloud No

youngtutorsuk commented 3 months ago

the aero theme turns the background black and acrylic tints everything light grey i have specifically made the window in focus but that hasn't changed it.

Akascape commented 3 months ago

@youngtutorsuk I guess you have to turn on the transparency effects mode in settings.