Skip to content

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

fix:修复低版本 Windows系统下的视觉问题 - 在 main_window.py 中添加对 Windows 8.1 及以下版本的特殊处理,隐藏标题栏按钮 - 在 pop_up_window.py 中根据操作系统版本调整背景颜色 - 由于没有现成的 Qt6ForWindows7 QtMultiMedia 库, 所以禁用 Win 10 以下的声音播放 - 优化了跨平台兼容性,确保在不同操作系统下的一致性

XiaoYouChRcf762bc25fad
diff --git a/app/view/main_window.py b/app/view/main_window.py
index 8b1f4e8e..c4824959 100644
--- a/app/view/main_window.py
+++ b/app/view/main_window.py
@@ -11,7 +11,7 @@ from PySide6.QtWidgets import QApplication, QGraphicsOpacityEffect
from loguru import logger
from qfluentwidgets import FluentIcon as FIF, setTheme, Theme, themeColor
from qfluentwidgets import NavigationItemPosition, MSFluentWindow, SplashScreen
-from qframelesswindow.utils.win32_utils import isGreaterEqualWin10
+from qframelesswindow.utils.win32_utils import isGreaterEqualWin10, isGreaterEqualWin8_1
from .setting_interface import SettingInterface
from .task_interface import TaskInterface
@@ -212,9 +212,17 @@ class MainWindow(MSFluentWindow):
self._isMicaEnabled = True
self.windowEffect.setAeroEffect(self.winId())
self.setStyleSheet("background-color: transparent")
+ if not isGreaterEqualWin8_1():
+ self.titleBar.closeBtn.hide()
+ self.titleBar.minBtn.hide()
+ self.titleBar.maxBtn.hide()
elif cfg.backgroundEffect.value == 'None':
self._isMicaEnabled = False
self.setStyleSheet("")
+ if not isGreaterEqualWin8_1():
+ self.titleBar.closeBtn.show()
+ self.titleBar.minBtn.show()
+ self.titleBar.maxBtn.show()
def initNavigation(self):
# add navigation items
diff --git a/app/view/pop_up_window.py b/app/view/pop_up_window.py
index 73373224..304c8ef6 100644
--- a/app/view/pop_up_window.py
+++ b/app/view/pop_up_window.py
@@ -1,13 +1,14 @@
+import sys
from os.path import dirname, basename
from PySide6.QtCore import Qt, QUrl, QTimer, QEasingCurve, QPropertyAnimation, QRect, QFileInfo, QObject, \
QCoreApplication
from PySide6.QtGui import QPixmap, QPainter, QColor, QPainterPath
-from PySide6.QtMultimedia import QSoundEffect
from PySide6.QtWidgets import QWidget, QFileIconProvider, QPushButton, QToolButton
from qfluentwidgets import FluentIcon as FIF
from qfluentwidgets.common.screen import getCurrentScreenGeometry
from qframelesswindow import WindowEffect
+from qframelesswindow.utils.win32_utils import isGreaterEqualWin10
from app.common.methods import openFile, bringWindowToTop, isAbleToShowToast
from app.view.Ui_PopUpWindow import Ui_PopUpWindow
@@ -96,7 +97,10 @@ class PopUpWindowBase(QWidget, Ui_PopUpWindow):
# 解决鼠标穿透问题
paint = QPainter(self)
paint.setPen(Qt.transparent)
- paint.setBrush(QColor(0, 0, 0, 1))
+ if isGreaterEqualWin10() or sys.platform == "darwin":
+ paint.setBrush(QColor(0, 0, 0, 1))
+ else:
+ paint.setBrush(Qt.white)
paint.drawPath(self.globalPath)
super().paintEvent(e)
@@ -113,10 +117,12 @@ class PopUpWindowBase(QWidget, Ui_PopUpWindow):
def _playSound(self):
# 设置音效
- self.soundEffect = QSoundEffect(self)
- self.soundEffect.setSource(QUrl.fromLocalFile(r":/res/completed_task.wav"))
- self.soundEffect.setVolume(100)
- self.soundEffect.play()
+ if isGreaterEqualWin10():
+ from PySide6.QtMultimedia import QSoundEffect
+ self.soundEffect = QSoundEffect(self)
+ self.soundEffect.setSource(QUrl.fromLocalFile(r":/res/completed_task.wav"))
+ self.soundEffect.setVolume(100)
+ self.soundEffect.play()
def __moveIn(self):
@@ -266,10 +272,12 @@ class ReceivedPopUpWindow(PopUpWindowBase):
def _playSound(self):
# 设置音效
- self.soundEffect = QSoundEffect(self)
- self.soundEffect.setSource(QUrl.fromLocalFile(r":/res/received_info.wav"))
- self.soundEffect.setVolume(100)
- self.soundEffect.play()
+ if isGreaterEqualWin10():
+ from PySide6.QtMultimedia import QSoundEffect
+ self.soundEffect = QSoundEffect(self)
+ self.soundEffect.setSource(QUrl.fromLocalFile(r":/res/received_info.wav"))
+ self.soundEffect.setVolume(100)
+ self.soundEffect.play()
@classmethod
def showPopUpWindow(cls, receiveContent:str, mainWindow=None):