@@ -52,18 +52,16 @@ def setupUi(self, FormMain: QtWidgets.QWidget):
5252 self .PanTitle .setObjectName ("PanTitle" )
5353
5454 # 主 Panel
55- self .PanMain = QtWidgets .QFrame (FormMain )
55+ self .PanMain = QtWidgets .QStackedWidget (FormMain )
5656 self .PanMain .setGeometry (QtCore .QRect (0 , title_height , size [0 ], (size [1 ] - title_height )))
5757 self .PanMain .setStyleSheet (f"""
58- QFrame #PanMain {{
58+ QStackedWidget #PanMain {{
5959 background-color: qlineargradient(spread:pad, x1:0.9, y1:0.1, x2:0, y2:1,
6060 stop:0 { setup .get_settings ('ColorBrush5' )} , stop:1 { setup .get_settings ('ColorBrush6' )} );
6161 border-bottom-left-radius: { corner_radius } px;
6262 border-bottom-right-radius: { corner_radius } px;
6363 }}
6464 """ )
65- self .PanMain .setFrameShape (QtWidgets .QFrame .NoFrame )
66- self .PanMain .setFrameShadow (QtWidgets .QFrame .Plain )
6765 self .PanMain .setObjectName ("PanMain" )
6866
6967 # 标题栏按钮 -- 退出
@@ -77,9 +75,9 @@ def setupUi(self, FormMain: QtWidgets.QWidget):
7775 self .BtnMin .setObjectName ("BtnMin" )
7876
7977 # 标题栏按钮 -- 切换到下载页面
78+ # 标题栏按钮 -- 切换到启动页面
8079 self .BtnPageLaunch = MyIconTextButton (self .PanTitle , svg_path = "Images/BtnTitlePageLaunch.svg" ,
81- text = "Launch" ,
82- command = lambda : self .page_manager .switch_page (self .PanMain , 0 ))
80+ text = "Launch" , command = lambda : self .page_manager .switch_page (self .PanMain , 0 ))
8381 self .BtnPageLaunch .setGeometry (QtCore .QRect (500 , 8 , 0 , 0 ))
8482 self .BtnPageLaunch .setObjectName ("BtnPageDownload" )
8583
@@ -90,10 +88,18 @@ def setupUi(self, FormMain: QtWidgets.QWidget):
9088 self .SVGTitle .setStyleSheet ("background-color: transparent;" )
9189 self .SVGTitle .setObjectName ("SVGTitle" )
9290
93- self .page = PageLaunch (self .PanMain )
94- self .page .setGeometry (QtCore .QRect (0 , 0 , size [0 ], (size [1 ] - title_height )))
95- self .page .setObjectName ("PageLaunch" )
96- self .page .raise_ ()
91+ # 添加页面到 QStackedWidget
92+ self .page_launch = PageLaunch ()
93+ self .PanMain .addWidget (self .page_launch )
94+
95+ # 如果有 PageDownload,也添加进来
96+ from Pages .PageDownload .PageDownload import PageDownload
97+ self .page_download = PageDownload ()
98+ self .PanMain .addWidget (self .page_download )
99+
100+ # 默认显示第一个页面
101+ self .PanMain .setCurrentIndex (0 )
102+
97103
98104 self .retranslateUi (FormMain )
99105 QtCore .QMetaObject .connectSlotsByName (FormMain )
0 commit comments