@@ -5,8 +5,7 @@ using namespace WorkbenchPagePrivate;
55
66QWidget *WorkbenchPage::createConnectionSection ()
77{
8- auto *section = new HeaderCardWidget (this );
9- hideCardHeader (section);
8+ auto *section = new ExpandSettingCard (FluentIcon::Connect, QStringLiteral (" 连接" ), QString (), this );
109 auto *root = cardBody (section);
1110
1211 m_portCombo = new ComboBox (section);
@@ -79,13 +78,13 @@ QWidget *WorkbenchPage::createConnectionSection()
7978 settings.setValue (QStringLiteral (" serial/autoOpen" ), checked);
8079 });
8180
81+ makeCollapsibleCard (section, QStringLiteral (" connection" ));
8282 return section;
8383}
8484
8585QWidget *WorkbenchPage::createReceiveSettingsSection ()
8686{
87- auto *section = new HeaderCardWidget (this );
88- hideCardHeader (section);
87+ auto *section = new ExpandSettingCard (FluentIcon::Download, QStringLiteral (" 接收设置" ), QString (), this );
8988 auto *root = cardBody (section);
9089
9190 m_displayModeSegment = new SegmentedWidget (section);
@@ -251,13 +250,13 @@ QWidget *WorkbenchPage::createReceiveSettingsSection()
251250 connect (m_exportCsvButton, &PushButton::clicked, this , [this ]() { exportRecords (ExportFormat::Csv); });
252251 connect (m_exportBinButton, &PushButton::clicked, this , [this ]() { exportRecords (ExportFormat::Bin); });
253252
253+ makeCollapsibleCard (section, QStringLiteral (" receive" ));
254254 return section;
255255}
256256
257257QWidget *WorkbenchPage::createSendSettingsSection ()
258258{
259- auto *section = new HeaderCardWidget (this );
260- hideCardHeader (section);
259+ auto *section = new ExpandSettingCard (FluentIcon::Send, QStringLiteral (" 发送设置" ), QString (), this );
261260 auto *root = cardBody (section);
262261
263262 m_lineEndingCombo = new ComboBox (section);
@@ -373,12 +372,13 @@ QWidget *WorkbenchPage::createSendSettingsSection()
373372 }
374373 });
375374
375+ makeCollapsibleCard (section, QStringLiteral (" send" ));
376376 return section;
377377}
378378
379379QWidget *WorkbenchPage::createPacketSection ()
380380{
381- auto *section = new HeaderCardWidget ( QStringLiteral (" 常用包" ), this );
381+ auto *section = new ExpandSettingCard (FluentIcon::Library, QStringLiteral (" 常用包" ), QString ( ), this );
382382 auto *root = cardBody (section);
383383
384384 m_packetNameEdit = new LineEdit (section);
@@ -459,12 +459,13 @@ QWidget *WorkbenchPage::createPacketSection()
459459 connect (m_packetDownButton, &ToolButton::clicked, this , [this ]() { moveSelectedPacket (1 ); });
460460
461461 updatePacketTable ();
462+ makeCollapsibleCard (section, QStringLiteral (" packets" ));
462463 return section;
463464}
464465
465466QWidget *WorkbenchPage::createFileSendSection ()
466467{
467- auto *section = new HeaderCardWidget ( QStringLiteral (" 文件发送" ), this );
468+ auto *section = new ExpandSettingCard (FluentIcon::Folder, QStringLiteral (" 文件发送" ), QString ( ), this );
468469 auto *root = cardBody (section);
469470
470471 m_filePathEdit = new LineEdit (section);
@@ -513,5 +514,6 @@ QWidget *WorkbenchPage::createFileSendSection()
513514 connect (m_fileCancelButton, &PushButton::clicked, this , &WorkbenchPage::cancelFileSend);
514515
515516 updateFileSendUi (false );
517+ makeCollapsibleCard (section, QStringLiteral (" fileSend" ));
516518 return section;
517519}
0 commit comments