initial fluent-widgets ui

This commit is contained in:
2025-08-14 18:45:16 +08:00
parent 746e83ab23
commit 4c66886257
1198 changed files with 805339 additions and 0 deletions

View File

@ -0,0 +1,38 @@
# coding: utf-8
from PySide6.QtGui import QFont
from PySide6.QtWidgets import QWidget
def setFont(widget: QWidget, fontSize=14, weight=QFont.Normal):
""" set the font of widget
Parameters
----------
widget: QWidget
the widget to set font
fontSize: int
font pixel size
weight: `QFont.Weight`
font weight
"""
widget.setFont(getFont(fontSize, weight))
def getFont(fontSize=14, weight=QFont.Normal):
""" create font
Parameters
----------
fontSize: int
font pixel size
weight: `QFont.Weight`
font weight
"""
font = QFont()
font.setFamilies(['Segoe UI', 'Microsoft YaHei', 'PingFang SC'])
font.setPixelSize(fontSize)
font.setWeight(weight)
return font