From 771a0e7b6b1276087515bbe94de28358cb92963b Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 04 六月 2026 10:32:27 +0800
Subject: [PATCH] 优化老化;
---
HMI.UI/Style/FormStyle.xaml | 59 ++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 44 insertions(+), 15 deletions(-)
diff --git a/HMI.UI/Style/FormStyle.xaml b/HMI.UI/Style/FormStyle.xaml
index 8664b17..d6407ac 100644
--- a/HMI.UI/Style/FormStyle.xaml
+++ b/HMI.UI/Style/FormStyle.xaml
@@ -4,7 +4,7 @@
xmlns:pu="https://opensource.panuon.com/wpf-ui">
<ResourceDictionary.MergedDictionaries>
- <pu:StyleDictionary Includes="TextBox,ComboBox,Button" />
+ <pu:StyleDictionary Includes="TextBox,ComboBox,Button,PasswordBox" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ModalButton" TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXModalDialog.ButtonStyleKey}}">
@@ -27,8 +27,8 @@
</Setter>
</Trigger>
<Trigger Property="Tag" Value="OK">
- <Setter Property="Background" Value="{StaticResource VerBar}" />
- <Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
+ <Setter Property="Background" Value="{DynamicResource VerBar}" />
+ <Setter Property="Foreground" Value="{DynamicResource PrimaryColorContract}" />
<Setter Property="Padding" Value="20,0" />
<Setter Property="Height" Value="35" />
</Trigger>
@@ -51,8 +51,8 @@
<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="Background" Value="{DynamicResource VerBar}" />
+ <Setter Property="Foreground" Value="{DynamicResource PrimaryColorContract}" />
<Setter Property="FontFamily" Value="{StaticResource iconfont}" />
<Setter Property="Height" Value="35" />
<Setter Property="Content" Value=""/>
@@ -67,7 +67,9 @@
<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="BorderThickness" Value="1" />
+ <Setter Property="BorderBrush" Value="Gray" />
+ <Setter Property="Background" Value="White" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
@@ -85,7 +87,6 @@
<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="Foreground" Value="Black" />
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
@@ -106,17 +107,26 @@
<Style x:Key="InputFormGroupStyle" TargetType="pu:FormGroup">
<Style.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource EditorTextBoxStyle}">
-
</Style>
</Style.Resources>
+ <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>
@@ -127,11 +137,12 @@
<Style x:Key="FormComboxStyle" TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
<Setter Property="pu:ComboBoxHelper.CornerRadius" Value="0"/>
- <Setter Property="pu:ComboBoxHelper.ItemsHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
+ <Setter Property="pu:ComboBoxHelper.ItemsHoverBackground" Value="{DynamicResource SecondPrimaryColor}"/>
<Setter Property="pu:ComboBoxHelper.ItemsHoverForeground" Value="#FFF"/>
<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" />
@@ -141,19 +152,37 @@
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="Foreground" Value="Black" />
<Setter Property="SelectedValuePath" Value="Content"/>
+ <Setter Property="BorderThickness" Value="1" />
+ <Setter Property="BorderBrush" Value="Gray" />
+ <Style.Triggers>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="Background" Value="#e8e8e8"/>
+ <Setter Property="Opacity" Value="1"/>
+ </Trigger>
+ </Style.Triggers>
</Style>
<Style x:Key="TimePicker" TargetType="pu:DateTimePicker">
<Setter Property="Height" Value="35"/>
<Setter Property="ClearButtonVisibility" Value="Visible"/>
- <Setter Property="ItemsCheckedBackground" Value="{StaticResource PrimaryColor}"/>
- <Setter Property="ItemsCheckedForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
- <Setter Property="ItemsHoverBackground" Value="{StaticResource SecondPrimaryColor}"/>
- <Setter Property="ItemsHoverForeground" Value="{StaticResource SecondPrimaryColorContract}"/>
+ <Setter Property="ItemsCheckedBackground" Value="{DynamicResource PrimaryColor}"/>
+ <Setter Property="ItemsCheckedForeground" Value="{DynamicResource SecondPrimaryColorContract}"/>
+ <Setter Property="ItemsHoverBackground" Value="{DynamicResource SecondPrimaryColor}"/>
+ <Setter Property="ItemsHoverForeground" Value="{DynamicResource SecondPrimaryColorContract}"/>
<Setter Property="TextStringFormat" Value="yyyy-MM-dd HH:mm:ss"/>
<Setter Property="MinWidth" Value="180"/>
<Setter Property="Mode" Value="DateTime"/>
<Setter Property="SelectedDateTime" Value="{x:Null}"/>
</Style>
+ <Style x:Key="SignInPasswordBoxStyle" TargetType="PasswordBox" BasedOn="{StaticResource {x:Type PasswordBox}}">
+ <Setter Property="pu:PasswordBoxHelper.FocusedBorderBrush" Value="#6CBCEA" />
+ <Setter Property="pu:PasswordBoxHelper.FocusedShadowColor" Value="#6CBCEA" />
+ <Setter Property="pu:PasswordBoxHelper.CornerRadius" Value="2" />
+ <Setter Property="pu:PasswordBoxHelper.WatermarkForeground" Value="#4A4A4A" />
+ <Setter Property="pu:PasswordBoxHelper.FocusedWatermarkForeground" Value="#AAAAAA" />
+ <Setter Property="pu:PasswordBoxHelper.PlainButtonVisibility" Value="VisibleOnHover" />
+ <Setter Property="VerticalContentAlignment" Value="Center" />
+ <Setter Property="Height" Value="35" />
+ </Style>
</ResourceDictionary>
\ No newline at end of file
--
Gitblit v1.9.1