feat(ui): 历史记录功能升级

This commit is contained in:
DLmaster361
2025-04-25 22:47:00 +08:00
parent 86d72aec39
commit 6f540036a0
4 changed files with 316 additions and 184 deletions

View File

@@ -26,6 +26,7 @@ v4.3
"""
from PySide6.QtWidgets import (
QApplication,
QWidget,
QWidget,
QLabel,
@@ -60,6 +61,7 @@ from qfluentwidgets import (
TransparentToolButton,
TeachingTipTailPosition,
ExpandSettingCard,
ExpandGroupSettingCard,
ToolButton,
PushButton,
PrimaryPushButton,
@@ -1068,6 +1070,41 @@ class QuantifiedItemCard(CardWidget):
self.Layout.addWidget(self.Numb)
class QuickExpandGroupCard(ExpandGroupSettingCard):
"""全局配置"""
def __init__(
self,
icon: Union[str, QIcon, FluentIcon],
title: str,
content: str = None,
parent=None,
):
super().__init__(icon, title, content, parent)
def setExpand(self, isExpand: bool):
"""set the expand status of card"""
if self.isExpand == isExpand:
return
# update style sheet
self.isExpand = isExpand
self.setProperty("isExpand", isExpand)
self.setStyle(QApplication.style())
# start expand animation
if isExpand:
h = self.viewLayout.sizeHint().height()
self.verticalScrollBar().setValue(h)
self.expandAni.setStartValue(h)
self.expandAni.setEndValue(0)
self.expandAni.start()
else:
self.setFixedHeight(self.viewportMargins().top())
self.card.expandButton.setExpand(isExpand)
class IconButton(TransparentToolButton):
"""包含下拉框的自定义设置卡片类。"""