From dedcf4174c8540ee3a912daad2ff13e014e495b1 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期五, 28 三月 2025 16:28:30 +0800
Subject: [PATCH] 优化UI组件;

---
 HMI.UI/Style/FormStyle.xaml |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/HMI.UI/Style/FormStyle.xaml b/HMI.UI/Style/FormStyle.xaml
index f745834..1043030 100644
--- a/HMI.UI/Style/FormStyle.xaml
+++ b/HMI.UI/Style/FormStyle.xaml
@@ -50,6 +50,7 @@
 
     <Style x:Key="SearchButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
         <Setter Property="pu:ButtonHelper.CornerRadius" Value="0" />
+        <Setter Property="Width" Value="30" />
         <Setter Property="Background" Value="{StaticResource VerBar}" />
         <Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
         <Setter Property="FontFamily" Value="{StaticResource iconfont}" />
@@ -66,7 +67,7 @@
         <Setter Property="pu:TextBoxHelper.FocusedWatermarkForeground" Value="#AAAAAA" />
         <Setter Property="Height" Value="35" />
         <Setter Property="Padding" Value="5,0" />
-        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Background" Value="White" />
         <Setter Property="Foreground" Value="Black" />
         <Setter Property="VerticalContentAlignment" Value="Center"/>
         <Style.Triggers>
@@ -105,18 +106,27 @@
     <Style x:Key="InputFormGroupStyle" TargetType="pu:FormGroup">
         <Style.Resources>
             <Style TargetType="TextBox" BasedOn="{StaticResource EditorTextBoxStyle}">
-                
+
             </Style>
         </Style.Resources>
-        <Setter Property="HeaderWidth" Value="70" />
-        <Setter Property="HeaderHeight" Value="35" />
+        <Setter Property="HeaderTemplate">
+            <Setter.Value>
+                <DataTemplate>
+                    <Border Margin="5,0,5,0">
+                        <ContentControl Content="{Binding}" />
+                    </Border>
+                </DataTemplate>
+            </Setter.Value>
+        </Setter>
+
+        <Setter Property="HeaderWidth" Value="Auto" />
         <Setter Property="Orientation" Value="Horizontal" />
         <Setter Property="Margin" Value="0,10,0,0" />
     </Style>
 
     <DataTemplate x:Key="RequiredFormHeader">
-        <StackPanel Orientation="Horizontal">
-            <TextBlock Text="*" Foreground="Red" />
+        <StackPanel Orientation="Horizontal" Margin="0,0,5,0">
+            <TextBlock Text="*" Width="5" Foreground="Red" />
             <ContentControl Content="{Binding}" />
         </StackPanel>
     </DataTemplate>
@@ -132,6 +142,7 @@
         <Setter Property="pu:ComboBoxHelper.ItemsSelectedForeground" Value="Black"/>
         <Setter Property="pu:ComboBoxHelper.HoverBorderBrush" Value="#007ACC" />
         <Setter Property="pu:ComboBoxHelper.FocusedBorderBrush" Value="#007ACC" />
+        <Setter Property="pu:ComboBoxHelper.ClearButtonVisibility" Value="VisibleOnNonnull" />
         <Setter Property="Height" Value="35" />
         <Setter Property="Margin" Value="0" />
         <Setter Property="Background" Value="#FFF" />
@@ -151,7 +162,7 @@
         <Setter Property="ItemsHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
         <Setter Property="ItemsHoverForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
         <Setter Property="TextStringFormat" Value="yyyy-MM-dd HH:mm:ss"/>
-        <Setter Property="Width" Value="180"/>
+        <Setter Property="MinWidth" Value="180"/>
         <Setter Property="Mode" Value="DateTime"/>
         <Setter Property="SelectedDateTime" Value="{x:Null}"/>
     </Style>

--
Gitblit v1.9.1