HoYoCenter/interface/init/about.py

17 lines
627 B
Python
Raw Normal View History

from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QSizePolicy
from PyQt5.QtGui import QPixmap
class AboutWidget(QWidget):
def __init__(self, typex="init"):
2024-09-13 22:50:29 +08:00
super().__init__()
self.base = QHBoxLayout()
logo = QPixmap("resources/logo.png")
logo_label = QLabel()
logo_label.setPixmap(logo)
logo_label.setScaledContents(True)
# 自适应图片大小
logo_label.setFixedSize(int(logo_label.height() * 0.4), int(logo_label.height() * 0.4))
# logo_label.setFixedSize(50, 50)
self.base.addWidget(logo_label)
2024-09-13 22:50:29 +08:00
self.setLayout(self.base)