From a061384ba628a09bf4df91f50321ab22c03129aa Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期二, 18 三月 2025 20:58:36 +0800
Subject: [PATCH] Winform支持遮罩层;
---
HMI.UI/Style/FormStyle.xaml | 78 ++++++++++++++++++++++----------------
1 files changed, 45 insertions(+), 33 deletions(-)
diff --git a/HMI.UI/Style/FormStyle.xaml b/HMI.UI/Style/FormStyle.xaml
index 9056d01..1cd04c2 100644
--- a/HMI.UI/Style/FormStyle.xaml
+++ b/HMI.UI/Style/FormStyle.xaml
@@ -27,7 +27,7 @@
</Setter>
</Trigger>
<Trigger Property="Tag" Value="OK">
- <Setter Property="Background" Value="{StaticResource PrimaryColor}" />
+ <Setter Property="Background" Value="{StaticResource VerBar}" />
<Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
<Setter Property="Padding" Value="20,0" />
<Setter Property="Height" Value="35" />
@@ -48,36 +48,36 @@
</Style.Triggers>
</Style>
-
<Style x:Key="SearchButton" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="pu:ButtonHelper.CornerRadius" Value="0" />
- <Setter Property="Background" Value="{StaticResource PrimaryColor}" />
+ <Setter Property="Width" Value="30" />
+ <Setter Property="Background" Value="{StaticResource VerBar}" />
<Setter Property="Foreground" Value="{StaticResource PrimaryColorContract}" />
<Setter Property="FontFamily" Value="{StaticResource iconfont}" />
<Setter Property="Height" Value="35" />
<Setter Property="Content" Value=""/>
- <Setter Property="pu:ButtonHelper.PendingSpinStyle">
- <Setter.Value>
- <Style TargetType="pu:Spin" BasedOn="{StaticResource {x:Static pu:ButtonHelper.PendingSpinStyleKey}}">
- <Setter Property="SpinStyle" Value="Ring2" />
- </Style>
- </Setter.Value>
- </Setter>
+ <Setter Property="Cursor" Value="Hand"/>
+ </Style>
+
+ <Style x:Key="EditorTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
+ <Setter Property="pu:TextBoxHelper.FocusedBorderBrush" Value="#6CBCEA" />
+ <Setter Property="pu:TextBoxHelper.FocusedShadowColor" Value="#6CBCEA" />
+ <Setter Property="pu:TextBoxHelper.CornerRadius" Value="0" />
+ <Setter Property="pu:TextBoxHelper.WatermarkForeground" Value="#4A4A4A" />
+ <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>
- <Trigger Property="pu:ButtonHelper.IsPending" Value="True">
- <Setter Property="pu:ButtonHelper.ClickEffect" Value="Shake" />
- <Setter Property="ContentTemplate">
- <Setter.Value>
- <DataTemplate>
- <TextBlock Text="Click again ?" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
+ <Trigger Property="IsReadOnly" Value="True">
+ <Setter Property="Background" Value="#e8e8e8"/>
</Trigger>
</Style.Triggers>
</Style>
- <Style x:Key="EditorTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
+ <Style x:Key="FormNumberInput" TargetType="pu:NumberInput" BasedOn="{StaticResource {x:Type pu:NumberInput}}">
<Setter Property="pu:TextBoxHelper.FocusedBorderBrush" Value="#6CBCEA" />
<Setter Property="pu:TextBoxHelper.FocusedShadowColor" Value="#6CBCEA" />
<Setter Property="pu:TextBoxHelper.CornerRadius" Value="0" />
@@ -109,32 +109,30 @@
</Style>
</Style.Resources>
- <Setter Property="HeaderWidth" Value="70" />
- <Setter Property="HeaderHeight" Value="35" />
+ <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" />
+ <ContentControl Content="{Binding}" />
+ </StackPanel>
+ </DataTemplate>
+
<Style x:Key="RequiredInputFormGroupStyle" TargetType="pu:FormGroup" BasedOn="{StaticResource InputFormGroupStyle}">
- <Setter Property="HeaderTemplate">
- <Setter.Value>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="*" Foreground="Red" />
- <ContentControl Content="{Binding}" />
- </StackPanel>
- </DataTemplate>
- </Setter.Value>
- </Setter>
+ <Setter Property="HeaderTemplate" Value="{StaticResource RequiredFormHeader}"/>
</Style>
<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 WindowBar}"/>
+ <Setter Property="pu:ComboBoxHelper.ItemsHoverBackground" Value="{StaticResource 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" />
@@ -145,4 +143,18 @@
<Setter Property="Foreground" Value="Black" />
<Setter Property="SelectedValuePath" Value="Content"/>
</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="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>
+
</ResourceDictionary>
\ No newline at end of file
--
Gitblit v1.9.1