Skip to content

Commit

Permalink
修复切换 Mica 主题无效的问题 (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyiYo committed Aug 9, 2023
1 parent f1b1ac3 commit 74196f3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qframelesswindow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:license: GPLv3, see LICENSE for more details.
"""

__version__ = "0.3.0"
__version__ = "0.3.1"

import sys

Expand Down
5 changes: 4 additions & 1 deletion qframelesswindow/linux/window_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ def setAcrylicEffect(self, hWnd, gradientColor="F2F2F230", isEnableShadow=True,
"""
pass

def setMicaEffect(self, hWnd):
def setMicaEffect(self, hWnd, isDarkMode=False):
""" Add mica effect to the window (Win11 only)
Parameters
----------
hWnd: int or `sip.voidptr`
Window handle
isDarkMode: bool
whether to use dark mode mica effect
"""
pass

Expand Down
5 changes: 4 additions & 1 deletion qframelesswindow/mac/window_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ def setAcrylicEffect(self, hWnd, gradientColor="F2F2F230", isEnableShadow=True,
content.addSubview_positioned_relativeTo_(
visualEffectView, Cocoa.NSWindowBelow, container)

def setMicaEffect(self, hWnd):
def setMicaEffect(self, hWnd, isDarkMode=False):
""" Add mica effect to the window (Win11 only)
Parameters
----------
hWnd: int or `sip.voidptr`
Window handle
isDarkMode: bool
whether to use dark mode mica effect
"""
self.setAcrylicEffect(hWnd)

Expand Down
2 changes: 2 additions & 0 deletions qframelesswindow/windows/window_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ def setMicaEffect(self, hWnd, isDarkMode=False):
else:
self.DwmSetWindowAttribute(hWnd, 38, byref(c_int(2)), 4)

self.DwmSetWindowAttribute(hWnd, 20, byref(c_int(1*isDarkMode)), 4)

def setAeroEffect(self, hWnd):
""" Add the aero effect to the window
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="PyQt5-Frameless-Window",
version="0.3.0",
version="0.3.1",
keywords="pyqt frameless",
author="zhiyiYo",
author_email="shokokawaii@outlook.com",
Expand Down

0 comments on commit 74196f3

Please sign in to comment.