提交 2159dc1b 编写于 作者: 之一Yo's avatar 之一Yo

添加更换侧边导航栏字体的功能

上级 a120ca30
......@@ -3,13 +3,14 @@ from typing import Union, List
from PyQt5.QtCore import (Qt, pyqtSignal, QRect, QRectF, QPropertyAnimation, pyqtProperty, QMargins,
QEasingCurve, QPoint, QEvent)
from PyQt5.QtGui import QColor, QPainter, QPen, QIcon, QCursor
from PyQt5.QtGui import QColor, QPainter, QPen, QIcon, QCursor, QFont
from PyQt5.QtWidgets import QWidget, QVBoxLayout
from ...common.config import isDarkTheme
from ...common.style_sheet import themeColor
from ...common.icon import drawIcon, toQIcon
from ...common.icon import FluentIcon as FIF
from ...common.font import setFont
class NavigationWidget(QWidget):
......@@ -93,8 +94,7 @@ class NavigationPushButton(NavigationWidget):
self._icon = icon
self._text = text
self.setStyleSheet(
"NavigationPushButton{font: 14px 'Segoe UI', 'Microsoft YaHei'}")
setFont(self)
def text(self):
return self._text
......@@ -350,6 +350,10 @@ class NavigationTreeWidget(NavigationTreeWidgetBase):
def setIcon(self, icon: Union[str, QIcon, FIF]):
self.itemWidget.setIcon(icon)
def setFont(self, font: QFont):
super().setFont(font)
self.itemWidget.setFont(font)
def insertChild(self, index, child):
if child in self.treeChildren:
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册