You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def resetAcrylicEffect(self, hWnd):
if not isGreaterEqualWin10():
warnings.warn("The acrylic effect is only available on Win10+")
return
hWnd = int(hWnd)
self.accentPolicy.AccentState = ACCENT_STATE.ACCENT_ENABLE_TRANSPARENTGRADIENT.value
self.winCompAttrData.Attribute = WINDOWCOMPOSITIONATTRIB.WCA_ACCENT_POLICY.value
self.SetWindowCompositionAttribute(hWnd, pointer(self.winCompAttrData))
去除导致卡顿的函数
"""def eventFilter(self, watched: QObject, event: QEvent) -> bool:
print(event)
if event.type() == QEvent.Type.MouseButtonPress:
if event.button() == Qt.MouseButton.LeftButton:
self.windowEffect.resetAcrylicEffect(self.winId())
elif event.type() == QEvent.Type.MouseButtonRelease:
if event.button() == Qt.MouseButton.LeftButton:
self.windowEffect.setAcrylicEffect(self.winId())
return super().eventFilter(watched, event)"""
def nativeEvent(self, eventType, message):
""" Handle the Windows message """
msg = MSG.from_address(message.__int__())
# handle Alt+F4
if msg.message==win32con.WM_ENTERSIZEMOVE or msg.message == win32con.WM_ENTERSIZEMOVE:
self.windowEffect.resetAcrylicEffect(self.winId())
if msg.message==win32con.WM_EXITSIZEMOVE or msg.message == win32con.WM_EXITSIZEMOVE:
self.windowEffect.setAcrylicEffect(self.winId())
return super().nativeEvent(eventType, message)
在demo中检测相关事件并设置亚克力效果
The text was updated successfully, but these errors were encountered:
class AcrylicWindow(WindowsFramelessWindow):
""" A frameless window with acrylic effect """
注册titleBar的事件
去除导致卡顿的函数
在demo中检测相关事件并设置亚克力效果
The text was updated successfully, but these errors were encountered: