Skip to content

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

将 macOS 的三大键移到左上角

XiaoYouChR7daa068ad129
diff --git a/app/view/main_window.py b/app/view/main_window.py
index 4e7d81b6..509b07fb 100644
--- a/app/view/main_window.py
+++ b/app/view/main_window.py
@@ -6,7 +6,7 @@ from ctypes import byref, c_int
from pathlib import Path
import darkdetect
-from PySide6.QtCore import QSize, QThread, Signal, QTimer, QPropertyAnimation
+from PySide6.QtCore import QSize, QThread, Signal, QTimer, QPropertyAnimation, QRect
from PySide6.QtGui import QIcon, QDragEnterEvent, QDropEvent, QKeySequence
from PySide6.QtWidgets import QApplication, QGraphicsOpacityEffect
from loguru import logger
@@ -114,6 +114,10 @@ class MainWindow(MSFluentWindow):
self.urlsText = ''
+ def systemTitleBarRect(self, size: QSize) -> QRect:
+ """重写 macOS 三大件到左上角"""
+ return QRect(0, 0 if self.isFullScreen() else 9, 75, size.height())
+
def __onCustomThemeModeChanged(self, value: str):
if value == 'System':
# 创建检测主题色更改线程
@@ -237,6 +241,9 @@ class MainWindow(MSFluentWindow):
self.setWindowIcon(QIcon(':/image/logo.png'))
self.setWindowTitle('Ghost Downloader')
+ if sys.platform == 'darwin':
+ self.titleBar.hBoxLayout.insertSpacing(0, 58)
+
if sys.platform == 'darwin':
self.titleBar.maxBtn.hide()