diff --git a/qframelesswindow/__init__.py b/qframelesswindow/__init__.py index d321999..f966aba 100644 --- a/qframelesswindow/__init__.py +++ b/qframelesswindow/__init__.py @@ -12,7 +12,7 @@ :license: GPLv3, see LICENSE for more details. """ -__version__ = "0.3.0" +__version__ = "0.3.1" import sys diff --git a/qframelesswindow/linux/window_effect.py b/qframelesswindow/linux/window_effect.py index d33541d..485e296 100644 --- a/qframelesswindow/linux/window_effect.py +++ b/qframelesswindow/linux/window_effect.py @@ -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 diff --git a/qframelesswindow/mac/window_effect.py b/qframelesswindow/mac/window_effect.py index fbce218..b266b38 100644 --- a/qframelesswindow/mac/window_effect.py +++ b/qframelesswindow/mac/window_effect.py @@ -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) diff --git a/qframelesswindow/windows/window_effect.py b/qframelesswindow/windows/window_effect.py index 4180bc9..ba92c61 100644 --- a/qframelesswindow/windows/window_effect.py +++ b/qframelesswindow/windows/window_effect.py @@ -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 diff --git a/setup.py b/setup.py index 0af4d11..1882446 100644 --- a/setup.py +++ b/setup.py @@ -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",