Forráskód Böngészése

refactor(ui): 优化设备详情窗口布局及按钮禁用样式

设置窗口默认最大化,调整接口配置区域网格布局,并为应用配置按钮添加禁用状态视觉反馈。
yangkaixiang 1 hónapja
szülő
commit
3cb65863ad
1 módosított fájl, 36 hozzáadás és 15 törlés
  1. 36 15
      windows/QuickIP.Client/DeviceDetailsWindow.xaml

+ 36 - 15
windows/QuickIP.Client/DeviceDetailsWindow.xaml

@@ -6,6 +6,7 @@
         Width="1100"
         MinHeight="680"
         MinWidth="1000"
+        WindowState="Maximized"
         ShowInTaskbar="False"
         WindowStartupLocation="CenterOwner">
     <Grid Background="#F5F7FB">
@@ -46,27 +47,35 @@
 
             <Border Grid.Row="1" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
                 <Grid>
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="Auto" />
+                        <RowDefinition Height="Auto" />
+                    </Grid.RowDefinitions>
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="*" />
                         <ColumnDefinition Width="Auto" />
                     </Grid.ColumnDefinitions>
 
-                    <StackPanel>
-                        <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="目标接口" />
-                        <ComboBox x:Name="RemoteTargetInterfaceComboBox"
-                                  Margin="0,10,0,0"
-                                  MinHeight="36"
-                                  VerticalContentAlignment="Center"
-                                  DisplayMemberPath="DisplayName"
-                                  SelectionChanged="RemoteTargetInterfaceComboBox_OnSelectionChanged" />
-                    </StackPanel>
+                    <TextBlock FontSize="13"
+                               FontWeight="SemiBold"
+                               Foreground="#111827"
+                               Text="目标接口" />
+
+                    <ComboBox x:Name="RemoteTargetInterfaceComboBox"
+                              Grid.Row="1"
+                              Margin="0,10,0,0"
+                              MinHeight="36"
+                              VerticalContentAlignment="Center"
+                              DisplayMemberPath="DisplayName"
+                              SelectionChanged="RemoteTargetInterfaceComboBox_OnSelectionChanged" />
 
                     <Button x:Name="ReloadInterfaceConfigButton"
+                            Grid.Row="1"
                             Grid.Column="1"
-                            Margin="14,22,0,0"
+                            Margin="14,10,0,0"
                             MinHeight="36"
                             Padding="14,0"
-                            VerticalAlignment="Top"
+                            VerticalAlignment="Center"
                             Click="ReloadInterfaceConfigButton_OnClick"
                             Content="1. 读取当前配置" />
                 </Grid>
@@ -140,11 +149,23 @@
                                     MinHeight="36"
                                     Padding="14,0"
                                     FontWeight="SemiBold"
-                                    Background="#2563EB"
-                                    Foreground="White"
-                                    BorderBrush="#2563EB"
                                     Click="ApplyConfigButton_OnClick"
-                                    Content="3. 应用配置" />
+                                    Content="3. 应用配置">
+                                <Button.Style>
+                                    <Style TargetType="Button">
+                                        <Setter Property="Background" Value="#2563EB" />
+                                        <Setter Property="Foreground" Value="White" />
+                                        <Setter Property="BorderBrush" Value="#2563EB" />
+                                        <Style.Triggers>
+                                            <Trigger Property="IsEnabled" Value="False">
+                                                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
+                                                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+                                                <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
+                                            </Trigger>
+                                        </Style.Triggers>
+                                    </Style>
+                                </Button.Style>
+                            </Button>
                         </StackPanel>
                     </Grid>