1313from Pages .PageLaunch .PageLaunch import PageLaunch
1414
1515class Ui_FormMain (object ):
16+
1617 def setupUi (self , FormMain : QtWidgets .QWidget ):
1718 # 获取所有需要的设置项
18- setup = Setup ()
19- size = setup . get_settings ( 'size' )
20- corner_radius = setup .get_settings ( 'corner_radius' )
21- bg_color = setup .get_settings ( 'ColorBrush5' )
22- fg_color = setup .get_settings ( 'ColorBrush2' )
23-
19+ size = setup . SIZE
20+
21+ corner_radius = setup .CORNER_RADIUS
22+ bg_color = setup .color_brush_5
23+ fg_color = setup .color_brush_2
24+
2425 FormMain .setObjectName ("FormMain" )
2526 FormMain .resize (* size )
2627 FormMain .setBaseSize (QtCore .QSize (* size ))
2728 FormMain .setStyleSheet (f"background-color: transparent; " )
2829 icon = QtGui .QIcon ()
29- icon .addPixmap (QtGui .QPixmap (":/.ico/icon.ico" ), QtGui .QIcon .Normal , QtGui .QIcon .Off )
30+ icon .addPixmap (
31+ QtGui .QPixmap (":/.ico/icon.ico" ), QtGui .QIcon .Normal , QtGui .QIcon .Off
32+ )
3033 FormMain .setWindowIcon (icon )
31-
34+
3235 # 标题栏 Panel
3336 self .PanTitle = QtWidgets .QFrame (FormMain )
3437 title_height = 48
@@ -42,9 +45,10 @@ def setupUi(self, FormMain: QtWidgets.QWidget):
4245 border-top-right-radius: { corner_radius } px;
4346 border-bottom: none;
4447 }}
45- """ )
46- self .PanTitle .setFrameShape (QtWidgets .QFrame .NoFrame )
47- self .PanTitle .setFrameShadow (QtWidgets .QFrame .Plain )
48+ """
49+ )
50+ self .PanTitle .setFrameShape (QtWidgets .QFrame .NoFrame )
51+ self .PanTitle .setFrameShadow (QtWidgets .QFrame .Plain )
4852 self .PanTitle .setObjectName ("PanTitle" )
4953
5054 # 主 Panel
@@ -57,25 +61,34 @@ def setupUi(self, FormMain: QtWidgets.QWidget):
5761 border-bottom-left-radius: { corner_radius } px;
5862 border-bottom-right-radius: { corner_radius } px;
5963 }}
60- """ )
61- self .PanMain .setFrameShape (QtWidgets .QFrame .NoFrame )
62- self .PanMain .setFrameShadow (QtWidgets .QFrame .Plain )
64+ """
65+ )
66+ self .PanMain .setFrameShape (QtWidgets .QFrame .NoFrame )
67+ self .PanMain .setFrameShadow (QtWidgets .QFrame .Plain )
6368 self .PanMain .setObjectName ("PanMain" )
6469
6570 # 标题栏按钮 -- 退出
66- self .BtnExit = MyRoundButton (self .PanTitle , svg_path = "Images/BtnTitleExit.svg" , size = (36 , 36 ), tooltip = "Exit" )
67- self .BtnExit .setGeometry (QtCore .QRect ((size [0 ] - 72 ), 8 , 36 , 36 ))
71+ self .BtnExit = MyRoundButton (
72+ self .PanTitle ,
73+ svg_path = "Images/BtnTitleClose.svg" ,
74+ size = (14 , 14 ),
75+ tooltip = "Exit" ,
76+ padding = (7 , 7 , - 10 , - 10 ),
77+ )
78+ self .BtnExit .setGeometry (QtCore .QRect ((size [0 ] - 50 ), 15 , 14 , 14 ))
6879 self .BtnExit .setObjectName ("BtnExit" )
6980
7081 # 标题栏按钮 -- 最小化
71- self .BtnMin = MyRoundButton (self .PanTitle , svg_path = "Images/BtnTitleMin.svg" , size = (36 , 36 ), tooltip = "Minisize" )
72- self .BtnMin .setGeometry (QtCore .QRect ((size [0 ] - 120 ), 8 , 36 , 36 ))
82+ self .BtnMin = QtWidgets .QPushButton (self .PanTitle )
83+ self .BtnMin .setGeometry (QtCore .QRect ((size [0 ] - 98 ), 2 , 40 , 40 ))
84+ self .BtnMin .setStyleSheet ("background-color: transparent;" )
85+ self .BtnMin .setText ("—" )
7386 self .BtnMin .setObjectName ("BtnMin" )
7487
7588 # 标题栏标签 -- 标题
7689 self .SVGTitle = QSvgWidget (self .PanTitle )
7790 self .SVGTitle .load ("Images/svgtitle.svg" )
78- self .SVGTitle .setGeometry (QtCore .QRect (8 , 8 , 120 , 40 )) # 缩小尺寸
91+ self .SVGTitle .setGeometry (QtCore .QRect (2 , 14 , 76 , 24 ))
7992 self .SVGTitle .setStyleSheet ("background-color: transparent;" )
8093 self .SVGTitle .setObjectName ("SVGTitle" )
8194
@@ -91,4 +104,5 @@ def retranslateUi(self, FormMain: QtWidgets.QWidget):
91104 _translate = QtCore .QCoreApplication .translate
92105 FormMain .setWindowTitle (_translate ("FormMain" , "Plain Craft Launcher 2" ))
93106
107+
94108from Resources import *
0 commit comments