@@ -36,6 +36,9 @@ private void FrmMain_Load_1(object sender, EventArgs e)
3636 /// </summary>
3737 private void ApplyModernTheme ( )
3838 {
39+ // 调整窗体尺寸以容纳更多功能
40+ this . ClientSize = new Size ( 420 , 500 ) ;
41+
3942 // 窗体基础样式
4043 UITheme . ApplyTheme ( this ) ;
4144
@@ -44,25 +47,41 @@ private void ApplyModernTheme()
4447 var titleBar = UITheme . CreateTitleBar ( this , "网络配置工具" ) ;
4548 this . Controls . Add ( titleBar ) ;
4649
47- // 添加工具栏面板
48- var toolPanel = new FlowLayoutPanel
50+ // 添加工具栏面板 - 第一行
51+ var toolPanel1 = new FlowLayoutPanel
4952 {
5053 Dock = DockStyle . Top ,
51- Height = 36 ,
54+ Height = 32 ,
5255 BackColor = UITheme . CardBackground ,
53- Padding = new Padding ( UITheme . Padding , 4 , UITheme . Padding , 4 ) ,
56+ Padding = new Padding ( UITheme . Padding , 4 , UITheme . Padding , 0 ) ,
5457 WrapContents = false
5558 } ;
5659
5760 var btnUsing = UITheme . CreateToolButton ( "正在使用" , tsBtnUsingNetwork_Click ) ;
5861 var btnDisable = UITheme . CreateToolButton ( "禁用所有" , tsBtnDisableAdapters_Click ) ;
5962 var btnEnable = UITheme . CreateToolButton ( "启用所有" , tsBtnEnableAdapters_Click ) ;
6063 var btnReport = UITheme . CreateToolButton ( "生成报表" , tsBtnAllIPReport_Click ) ;
64+
65+ toolPanel1 . Controls . AddRange ( new Control [ ] { btnUsing , btnDisable , btnEnable , btnReport } ) ;
66+ this . Controls . Add ( toolPanel1 ) ;
67+
68+ // 添加工具栏面板 - 第二行(新功能)
69+ var toolPanel2 = new FlowLayoutPanel
70+ {
71+ Dock = DockStyle . Top ,
72+ Height = 32 ,
73+ BackColor = UITheme . CardBackground ,
74+ Padding = new Padding ( UITheme . Padding , 0 , UITheme . Padding , 4 ) ,
75+ WrapContents = false
76+ } ;
77+
6178 var btnDiagnose = UITheme . CreateToolButton ( "网络诊断" , BtnDiagnose_Click ) ;
6279 var btnProfile = UITheme . CreateToolButton ( "配置方案 ▼" , BtnProfile_Click ) ;
80+ btnProfile . BackColor = UITheme . Primary ;
81+ btnProfile . ForeColor = Color . White ;
6382
64- toolPanel . Controls . AddRange ( new Control [ ] { btnUsing , btnDisable , btnEnable , btnReport , btnDiagnose , btnProfile } ) ;
65- this . Controls . Add ( toolPanel ) ;
83+ toolPanel2 . Controls . AddRange ( new Control [ ] { btnDiagnose , btnProfile } ) ;
84+ this . Controls . Add ( toolPanel2 ) ;
6685
6786 // 样式化所有标签
6887 foreach ( Control ctrl in this . Controls )
@@ -97,7 +116,7 @@ private void ApplyModernTheme()
97116 /// </summary>
98117 private void AdjustControlPositions ( )
99118 {
100- int offsetY = 50 ; // 新标题栏 + 工具栏的偏移
119+ int offsetY = 80 ; // 标题栏 40 + 工具栏两行 64 - 原工具栏 25 ≈ 80
101120 foreach ( Control ctrl in this . Controls )
102121 {
103122 if ( ctrl is Panel ) continue ;
0 commit comments