Prechádzať zdrojové kódy

refactor(ui): 统一输入框与下拉框内容垂直居中

为 ComboBox 和 TextBox 添加 VerticalContentAlignment="Center",优化表单控件视觉对齐效果。
yangkaixiang 1 mesiac pred
rodič
commit
d84363a21a

+ 5 - 4
windows/QuickIP.Client/DeviceDetailsWindow.xaml

@@ -72,6 +72,7 @@
                 <ComboBox x:Name="RemoteTargetInterfaceComboBox"
                           Margin="0,10,0,0"
                           MinHeight="36"
+                          VerticalContentAlignment="Center"
                           DisplayMemberPath="DisplayName"
                           SelectionChanged="RemoteTargetInterfaceComboBox_OnSelectionChanged" />
                 <TextBlock x:Name="RemoteSummaryTextBlock"
@@ -132,19 +133,19 @@
                 <UniformGrid Grid.Row="2" Margin="0,12,0,0" Columns="2">
                     <StackPanel Margin="0,0,12,12">
                         <TextBlock FontSize="12" Foreground="#6B7280" Text="IP 地址" />
-                        <TextBox x:Name="NewIpTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
+                        <TextBox x:Name="NewIpTextBox" Margin="0,8,0,0" MinHeight="32" VerticalContentAlignment="Center" TextChanged="ConfigInputChanged_OnChanged" />
                     </StackPanel>
                     <StackPanel Margin="0,0,0,12">
                         <TextBlock FontSize="12" Foreground="#6B7280" Text="子网掩码" />
-                        <TextBox x:Name="NewMaskTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
+                        <TextBox x:Name="NewMaskTextBox" Margin="0,8,0,0" MinHeight="32" VerticalContentAlignment="Center" TextChanged="ConfigInputChanged_OnChanged" />
                     </StackPanel>
                     <StackPanel Margin="0,0,12,0">
                         <TextBlock FontSize="12" Foreground="#6B7280" Text="网关" />
-                        <TextBox x:Name="NewGatewayTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
+                        <TextBox x:Name="NewGatewayTextBox" Margin="0,8,0,0" MinHeight="32" VerticalContentAlignment="Center" TextChanged="ConfigInputChanged_OnChanged" />
                     </StackPanel>
                     <StackPanel Margin="0,0,0,0">
                         <TextBlock FontSize="12" Foreground="#6B7280" Text="首选 DNS" />
-                        <TextBox x:Name="NewDnsTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
+                        <TextBox x:Name="NewDnsTextBox" Margin="0,8,0,0" MinHeight="32" VerticalContentAlignment="Center" TextChanged="ConfigInputChanged_OnChanged" />
                     </StackPanel>
                 </UniformGrid>
 

+ 1 - 0
windows/QuickIP.Client/MainWindow.xaml

@@ -76,6 +76,7 @@
                                     </Grid.ColumnDefinitions>
                                     <ComboBox x:Name="AdapterComboBox"
                                               MinHeight="36"
+                                              VerticalContentAlignment="Center"
                                               DisplayMemberPath="DisplayName"
                                               SelectionChanged="AdapterComboBox_OnSelectionChanged" />
                                     <Button x:Name="RefreshAdaptersButton"