{"id":14977000,"url":"https://github.com/marticliment/win32mica","last_synced_at":"2025-05-07T04:44:32.952Z","repository":{"id":45185371,"uuid":"443853737","full_name":"marticliment/win32mica","owner":"marticliment","description":"Win32mica: a simple module to add the Mica effect on legacy python windows. ","archived":false,"fork":false,"pushed_at":"2023-09-08T13:42:09.000Z","size":2773,"stargazers_count":109,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-07T04:44:24.912Z","etag":null,"topics":["11","legacy","mica","modern","pyqt","pyqt5","pyqt6","pyside2","python","qt","qt5","tinker","tkinter","win32api","win32mica","windows","windows-11","wxpython","xaml"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/win32mica","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marticliment.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"martinet101","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2022-01-02T19:35:21.000Z","updated_at":"2025-05-06T00:04:42.000Z","dependencies_parsed_at":"2023-10-02T00:22:20.068Z","dependency_job_id":null,"html_url":"https://github.com/marticliment/win32mica","commit_stats":{"total_commits":66,"total_committers":3,"mean_commits":22.0,"dds":0.4242424242424242,"last_synced_commit":"73de6db257457a5fc98f72d87ad77cacf09235af"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marticliment%2Fwin32mica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marticliment%2Fwin32mica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marticliment%2Fwin32mica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marticliment%2Fwin32mica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marticliment","download_url":"https://codeload.github.com/marticliment/win32mica/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252816519,"owners_count":21808702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["11","legacy","mica","modern","pyqt","pyqt5","pyqt6","pyside2","python","qt","qt5","tinker","tkinter","win32api","win32mica","windows","windows-11","wxpython","xaml"],"created_at":"2024-09-24T13:54:49.342Z","updated_at":"2025-05-07T04:44:32.927Z","avatar_url":"https://github.com/marticliment.png","language":"Python","funding_links":["https://ko-fi.com/martinet101"],"categories":[],"sub_categories":[],"readme":"\r\n![](https://img.shields.io/pypi/wheel/win32mica?style=for-the-badge)\r\n![](https://img.shields.io/pypi/v/win32mica?style=for-the-badge)\r\n![](https://img.shields.io/pypi/l/win32mica?style=for-the-badge)\r\n![](https://img.shields.io/pypi/pyversions/win32mica?style=for-the-badge)\r\n![](https://img.shields.io/pypi/dm/win32mica?style=for-the-badge)\r\n# Win32mica: A simple module to add the Mica effect and enable immersive dark mode on Python UI Windows\r\nThe aim of this project is to apply the Mica effect and enable immersive dark mode on python applications made with Python, like Tkinter, PyQt/PySide, WxPython, Kivy, etc.\u003cbr\u003e This will work on any windows version, including the new released dev builds where the mica API is public.\r\n\r\nView this project on [PyPi](https://pypi.org/project/win32mica/)\r\nView this project on [GitHub](https://github.com/martinet101/win32mica)\r\n\r\n\r\nhttps://github.com/marticliment/win32mica/assets/53119851/b0c4ce98-9845-449d-94e6-caaa37fc752a\r\n\r\n\r\n## Installation:\r\n```pwsh\r\npython -m pip install win32mica\r\n```\r\n\r\n## Requirements:\r\n - Windows 11\r\n - A window set to not have a transparent background and to have extended composition enabled* (It might work with other settings, but nothing is guaranteed.)\r\n - The hWnd (identifier) of that window. More info: [what is a hWnd?](https://stackoverflow.com/questions/1635645/what-is-hwnd-in-vc) \r\n - OPTIONAL: The window must have semi-transparent widgets/controls in order to recreate the transparency effect on the controls.\r\n - OPTIONAL: Know if Windows has dark or light mode enabled. This can be checked with the [`darkdetect` module](https://pypi.org/project/darkdetect/)\r\n\r\n## Usage:\r\n\r\n```python\r\n######################################################################\r\n#                                                                    #\r\n# Those examples are oversimplified, please see the examples/ folder #\r\n# for detailed usage with each UI library.                           #\r\n#                                                                    #\r\n######################################################################\r\n\r\nhwnd = window.winId().__int__() # Get the hWnd of your window\r\n\r\nfrom win32mica import ApplyMica, MicaTheme, MicaStyle\r\n\r\nmode = MicaTheme.DARK  # Dark mode mica effect\r\nmode = MicaTheme.LIGHT # Light mode mica effect\r\nmode = MicaTheme.AUTO  # Apply system theme, and change it if system theme changes\r\n\r\nstyle = MicaStyle.DEFAULT # Default backdrop effect\r\nstyle = MicaStyle.ALT     # Alt backdrop effect\r\n\r\ndef callbackFunction(NewTheme):\r\n    if newTheme == MicaTheme.DARK:\r\n        print(\"Theme has changed to dark!\")\r\n    else:\r\n        print(\"Theme has changed to light!\")\r\n\r\nwin32mica.ApplyMica(HWND=hwnd, Theme=mode, Style=style, OnThemeChange=callbackFunction)\r\n\r\n#    Parameters\r\n#    ----------\r\n#    HWND : int\r\n#        The handle to the window on which the effect has to be applied\r\n#    Theme : MicaTheme, int\r\n#        The theme of the backdrop effect: MicaTheme.DARK, MicaTheme.LIGHT, MicaTheme.AUTO\r\n#    Style : MicaStyle, int\r\n#        The style of the mica backdrop effect: MicaStyle.DEFAULT, MicaStyle.ALT\r\n#    OnThemeChange : function\r\n#        A callback function that receives one parameter to call when the system theme changes (will only work if Theme is set to MicaTheme.AUTO)\r\n#        The passed parameter will be either MicaTheme.DARK or MicaTheme.LIGHT, corresponding to the new system theme\r\n\r\n```\r\n\r\nYou can check out the [examples folder](https://github.com/martinet101/win32mica/tree/main/examples) for detailed use in Tk and PySide/PyQt.\r\n\r\n## Result:\r\n\r\n![image](https://user-images.githubusercontent.com/53119851/188261331-15e17447-590f-452a-be62-07c67a3db673.png)\u003cbr\u003e\r\n![image](https://user-images.githubusercontent.com/53119851/188261398-83f5d904-586f-47ce-b6af-d4521eb3f68f.png)\r\n\r\n_Those are PySide2 windows with custom widgets._\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarticliment%2Fwin32mica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarticliment%2Fwin32mica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarticliment%2Fwin32mica/lists"}