Giter Club home page Giter Club logo

py-window-styles's Introduction

Typing SVG

⚡ STATS ⚡

Akascape's github streak stats


⚙️ TECH STACK ⚙️


Main OS 3D Video Editing Photo Editing Music Production Compositing IDLE Recording


🌐 MY SOCIALS 🌐



Buy Me a Coffee at ko-fi.com

py-window-styles's People

Contributors

akascape avatar littlewhitecloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

py-window-styles's Issues

PySimpleGUI

not working with PySimpleGUI
I tried :
pywinstyles.apply_style(window.TKroot, 'mica')
and :
from ctypes import windll import pywinstyles hwnd = windll.user32.GetActiveWindow() pywinstyles.change_header_color(hwnd, color="blue")

Cannot use this

lib\site-packages\customtkinter\windows\widgets\core_widget_classes\ctk_base_class.py", line 111, in config
raise AttributeError("'config' is not implemented for CTk widgets. For consistency, always use 'configure' instead.")
AttributeError: 'config' is not implemented for CTk widgets. For consistency, always use 'configure' instead.
When I try to activate the theme change to aero for the ctk.frame object, I get this error.
This library looks just fine. If it could be used in my project it would be very good. The parts of the code I'm trying to integrate it through:
class App(ctk.CTk):
def init(self):
super().init()
root = ctk.CTk()
ctk.set_default_color_theme("green") # Themes: "blue" (standard), "green", "dark-blue"
ctk.set_appearance_mode("dark")
self.title("")
self.geometry(f"{520}x{235}")
#Creating Main Frame
self.main_frame = ctk.CTkFrame(self, width=510,height=290)
self.main_frame.grid(row=0, column=10,columnspan=10, rowspan=10, ipadx=5, ipady=0, padx=0, pady=0, sticky="nw")
self.main_frame.grid_rowconfigure(3, weight=1)
self.cancel_button = ctk.CTkButton(self.main_frame, text = "Change",font=("Arial", 15),command=self.change_style('aero'))
self.cancel_button.grid(row=5, column=5,columnspan=2, padx=5, pady=10, rowspan=1)
def change_style(self,e):
pywinstyles.apply_style(self.main_frame, e)

acrylic on windows 11

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

Wrong accent colour

The accent colour being returned doesn't match with the rest of the system. Notice the difference in the button colour of my app compared to the MS Store's install button.

image

Problem with window returning to normal position when switching

For example, when pywinstyles.apply_style(self, "aero") is called, the theme is installed and works. However, after that you can call another theme as much as you want by means of pywinstyles.apply_style(self, "dark"), for example.
All the code in text is available in my "changer" repository.
image

Stuttering Caused by Transparency Effects Option in Windows

System: Windows 10 22H2 19045.3448
GPU: NVIDIA GeForce RTX 3060
Python:3.11.5
Enabling the "Transparency Effects" option in Personalization > Colors leads to severe lag when using transparent themes (acrylic, aero, transparent). When dragging windows, there is a significant delay, with windows gradually moving to the mouse's position. Even after releasing the mouse, the windows continue to move until they reach the final release point. Additionally, the GPU usage of the Desktop Window Manager (dwm.exe) ranges from approximately 5% to 30%.
Disabling the "Transparency Effects" option doesn't result in a noticeable difference in GPU usage by the Desktop Window Manager (dwm.exe), but the lag issue disappears.

code:

import tkinter
import pywinstyles

root = tkinter.Tk()
pywinstyles.apply_style(root, "acrylic")

root.mainloop()

Bug

Hey, So I use canvas to my app for position and things like that. Now when I use PyWinStyles it wont work because of the canavs, How do I make it part of the canvas?

bug :/

without using pywinstyles

image


after using pywinstyles

pywinstyles.apply_style(app, "aero")  # here app is CTk (root)
pywinstyles.set_opacity(app, 0.8)
  • something isn't right :/

Screenshot 2024-04-12 083649

Screenshot 2024-04-12 083333

Fix a error

Error:

def ChangeDWMAccent(hWnd: int, attrib: int, state: int, color: str | None = None) -> None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

The | operator only supports python 3.10 and newer.

Fix:

from typing import Union

def ChangeDWMAccent(hWnd: int, attrib: int, state: int, color: Union[str, None] = None) -> None:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.