This commit is contained in:
2025-10-29 22:20:21 +08:00
commit 32b3b7b29a
111 changed files with 344425 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
# coding: utf-8
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QVBoxLayout, QWidget
from qfluentwidgets import ScrollArea
from app.view.components.file_deal_cards import DownloadCard
class DownloadScrollWidget(ScrollArea):
def __init__(self, parent=None):
super().__init__(parent=parent)
self.scrollWidget = QWidget()
self.vBoxLayout = QVBoxLayout(self.scrollWidget)
self.__initWidget()
def __initWidget(self):
self.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
self.setWidget(self.scrollWidget)
self.setWidgetResizable(True)
self.setObjectName("DownloadScrollWidget")
self.scrollWidget.setObjectName("scrollWidget")
self.scrollWidget.setStyleSheet("background:transparent;border:none;")
self.setStyleSheet("background:transparent;border:none;")
self.__initLayout()
def __initLayout(self):
self.vBoxLayout.setContentsMargins(0, 0, 0, 0)
self.vBoxLayout.setAlignment(Qt.AlignmentFlag.AlignTop)
def addDownloadTask(self, suffix, fileName, _id):
self.vBoxLayout.addWidget(
DownloadCard(
suffix,
fileName,
_id,
self.scrollWidget,
)
)