Skip to content

The only downloader you need. 下载器的集大成者。

Fix #541

XiaoYouChR93341315bac4
diff --git a/app/view/shell/tray.py b/app/view/shell/tray.py
index 16238c6b..0b230d0e 100644
--- a/app/view/shell/tray.py
+++ b/app/view/shell/tray.py
@@ -40,6 +40,7 @@ if sys.platform == "win32":
from typing import TYPE_CHECKING
from PySide6.QtWidgets import QProxyStyle, QStyle, QStyleFactory
+ from app.platform.windows import isGreaterEqualWin11
from qfluentwidgets.common.screen import getCurrentScreenGeometry
from qfluentwidgets.components.widgets.menu import MenuActionListWidget
from qframelesswindow import WindowEffect
@@ -153,7 +154,7 @@ if sys.platform == "win32":
painter.setBrush(QColor(0, 0, 0, 1))
painter.drawRect(self.rect())
- TrayMenu = AcrylicMenu
+ TrayMenu = AcrylicMenu if isGreaterEqualWin11() else RoundMenu
else:
TrayMenu = RoundMenu
diff --git a/app/view/windows/main_window.py b/app/view/windows/main_window.py
index 39b6b99c..0a5978d5 100644
--- a/app/view/windows/main_window.py
+++ b/app/view/windows/main_window.py
@@ -345,22 +345,29 @@ if sys.platform == "win32":
self.winCompAttrData.Attribute = WINDOWCOMPOSITIONATTRIB.WCA_ACCENT_POLICY.value
self.SetWindowCompositionAttribute(hWnd, pointer(self.winCompAttrData))
- def _win10NativeEvent(self, eventType, message):
+ def _nativeEvent(self, eventType, message):
if eventType == "windows_generic_MSG":
from ctypes.wintypes import MSG
msg = MSG.from_address(message.__int__())
+ if cfg.backgroundEffect.value != "Acrylic":
+ return FramelessWindow.nativeEvent(self, eventType, message)
+
WM_ENTERSIZEMOVE = 561
WM_EXITSIZEMOVE = 562
- if msg.message == WM_ENTERSIZEMOVE and cfg.backgroundEffect.value == "Acrylic":
+ if msg.message == WM_ENTERSIZEMOVE:
self.windowEffect.resetAcrylicEffect(self.winId())
- elif msg.message == WM_EXITSIZEMOVE and cfg.backgroundEffect.value == "Acrylic":
+ elif msg.message == WM_EXITSIZEMOVE:
from qfluentwidgets import isDarkTheme
+ isDark = isDarkTheme() if cfg.themeMode.value == Theme.AUTO else cfg.themeMode.value == Theme.DARK
self.windowEffect.setAcrylicEffect(
- self.winId(), "00000030" if isDarkTheme() else "FFFFFF30",
+ self.winId(), "00000030" if isDark else "FFFFFF30",
)
return FramelessWindow.nativeEvent(self, eventType, message)
+ from qframelesswindow import AcrylicWindow
+
WindowEffect.resetAcrylicEffect = _resetAcrylicEffect
- MainWindow.nativeEvent = _win10NativeEvent
+ MainWindow.updateFrameless = AcrylicWindow.updateFrameless
+ MainWindow.nativeEvent = _nativeEvent