From 4cac1b533e133fdc8b3def90a0f998820f51907a Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期三, 26 三月 2025 17:57:59 +0800
Subject: [PATCH] 优化UI,新增日志自动删除;

---
 Plugin.TestResult/Scanner.xaml |   60 +++++++++++++++++++++++++++++++++---------------------------
 1 files changed, 33 insertions(+), 27 deletions(-)

diff --git a/Plugin.TestResult/Scanner.xaml b/Plugin.TestResult/Scanner.xaml
index a8a13e6..d9daae5 100644
--- a/Plugin.TestResult/Scanner.xaml
+++ b/Plugin.TestResult/Scanner.xaml
@@ -16,9 +16,10 @@
              xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
              xmlns:cc="clr-namespace:HMI.Core;assembly=HMI.Core"
             InteropOwnersMask="False"
+            SizeToContent="Height"
             
             pu:WindowXModalDialog.Buttons="{x:Null}"
-        Title="{Binding title}" Height="300" Width="600">
+        Title="{Binding title}" Width="600">
     <Window.Resources>
         <local:FontSizeConverter x:Key="FontSizeConverter"/>
         <Style TargetType="Label">
@@ -32,42 +33,47 @@
         </Style>
         <Style TargetType="Button" BasedOn="{StaticResource PrimaryButton}">
             <Setter Property="FontSize" Value="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=Window}, 
-Converter={StaticResource FontSizeConverter}, ConverterParameter='100,1920'}" />
+Converter={StaticResource FontSizeConverter}, ConverterParameter='20,1920'}" />
         </Style>
     </Window.Resources>
 
-    <Grid Margin="20">
+    <Grid Margin="10">
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto"/>
-            <RowDefinition />
+            <RowDefinition Height="Auto"/>
             <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
 
-        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Padding="0"
-               Content="{Binding Converter={StaticResource lc},ConverterParameter='Tr.PleaseScanSnr'}"
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition/>
+            <ColumnDefinition/>
+        </Grid.ColumnDefinitions>
+
+        <!--<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" Padding="0"
+               Content="{DynamicResource Tr.PleaseScanSnr}"
                Margin="0,0,0,20"
-               />
-        <StackPanel Grid.Row="1">
-            <pu:FormGroup 
-                dp:FormGroupHelper.IsRequired="True"
-                Header="{Binding Converter={StaticResource lc},ConverterParameter='Tr.PositionSnr'}">
-                <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="positionText" TextWrapping="NoWrap"/>
-            </pu:FormGroup>
+               />-->
+        <GroupBox Grid.Row="1" Header="{DynamicResource Tr.PleaseScanSnr}" Padding="0,0,0,10" Grid.ColumnSpan="2" >
+            <StackPanel>
+                <pu:FormGroup 
+         Header="{DynamicResource Tr.PositionSnr}"
+         dp:FormGroupHelper.IsRequired="True"
+         Style="{StaticResource InputFormGroupStyle}">
+                    <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="positionText" TextWrapping="NoWrap"/>
+                </pu:FormGroup>
 
-            <pu:FormGroup 
-                dp:FormGroupHelper.IsRequired="True"
-                Header="{Binding Converter={StaticResource lc},ConverterParameter='Tr.ProductSnr'}">
-                <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="snrText" TextWrapping="NoWrap"/>
-            </pu:FormGroup>
-        </StackPanel>
+                <pu:FormGroup 
+         Header="{DynamicResource Tr.ProductSnr}"
+         dp:FormGroupHelper.IsRequired="True" Style="{StaticResource InputFormGroupStyle}">
+                    <TextBox Style="{StaticResource EditorTextBoxStyle}" x:Name="snrText" TextWrapping="NoWrap"/>
+                </pu:FormGroup>
+            </StackPanel>
 
-        <StackPanel Style="{StaticResource ButtonGroup}" 
-                    dp:StackPanelHelper.ChildSpace="50"
-                    HorizontalAlignment="Center" Grid.Row="2">
-            <Button Click="Con_Click" 
-                    Content="{Binding Converter={StaticResource lc},ConverterParameter='Tr.ContinueScan'}"/>
-            <Button Click="Ok_Click" 
-                    Content="{Binding Converter={StaticResource lc},ConverterParameter='Tr.FinishScan'}"/>
-        </StackPanel>
+        </GroupBox>
+
+        <Button Grid.Row="2" Click="Con_Click" Style="{StaticResource PrimaryButton}"
+        Content="{DynamicResource Tr.ContinueScan}"/>
+        <Button Grid.Row="2" Grid.Column="1" Click="Ok_Click" Style="{StaticResource SuccessButton}"
+        Content="{DynamicResource Tr.FinishScan}"/>
     </Grid>
 </pu:WindowX>

--
Gitblit v1.9.1