Skip to content

Commit

Permalink
Merge pull request #1593 from GF-Huang/fix-TextBox-disabled-opacity
Browse files Browse the repository at this point in the history
Fix hc:TextBox disabled opacity.
  • Loading branch information
NaBian authored Jul 6, 2024
2 parents 3d75956 + 0e6b610 commit e7ebe47
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 37 deletions.
19 changes: 6 additions & 13 deletions src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6547,8 +6547,7 @@
</hc:SimplePanel>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -6577,9 +6576,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" TargetName="Placeholder" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand All @@ -6605,9 +6602,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" TargetName="Placeholder" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -6653,8 +6648,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="root" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="root">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -6695,8 +6689,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="root" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="root">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -14364,4 +14357,4 @@
</Style>
<Style BasedOn="{StaticResource RangeSliderBaseStyle}" TargetType="hc:RangeSlider" />
<Style BasedOn="{StaticResource SliderBaseStyle}" TargetType="Slider" />
</ResourceDictionary>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<hc:TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False"/>

<hc:TextBox hc:InfoElement.ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
<hc:TextBox hc:InfoElement.ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,16,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" IsEnabled="False"/>
<hc:TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterEmail}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0">
<hc:TextBox.Text>
<Binding Path="Email1" UpdateSourceTrigger="PropertyChanged">
Expand All @@ -31,6 +32,7 @@
<hc:TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False" Style="{StaticResource TextBoxPlus.Small}"/>

<hc:TextBox hc:InfoElement.ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Style="{StaticResource TextBoxPlus.Small}"/>
<hc:TextBox hc:InfoElement.ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,16,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Style="{StaticResource TextBoxPlus.Small}" IsEnabled="False"/>
<hc:TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterEmail}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0" Style="{StaticResource TextBoxPlus.Small}">
<hc:TextBox.Text>
<Binding Path="Email2" UpdateSourceTrigger="PropertyChanged">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False"/>

<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend}" Margin="0,16,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" IsEnabled="False"/>
<TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource TextBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource TextBoxExtend}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend}" Margin="0,16,0,0"/>
Expand All @@ -22,6 +23,7 @@
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False" Style="{StaticResource TextBox.Small}"/>

<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend.Small}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend.Small}" Margin="0,16,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" IsEnabled="False"/>
<TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource TextBoxExtend.Small}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource TextBoxExtend.Small}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend.Small}" Margin="0,16,0,0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
</hc:SimplePanel>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -70,9 +69,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" TargetName="Placeholder" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand All @@ -99,9 +96,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" TargetName="Placeholder" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -149,8 +144,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4"/>
<Setter Property="Opacity" TargetName="root" Value="0.4"/>
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="root">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
Expand Down Expand Up @@ -192,8 +186,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4"/>
<Setter Property="Opacity" TargetName="root" Value="0.4"/>
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="root">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}"/>
Expand Down
17 changes: 5 additions & 12 deletions src/Shared/HandyControl_Shared/Themes/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6631,8 +6631,7 @@
</hc:SimplePanel>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -6661,9 +6660,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" TargetName="Placeholder" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand All @@ -6689,9 +6686,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="PART_ContentHost" Value="0.4" />
<Setter Property="Opacity" TargetName="Placeholder" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="PART_ContentHost">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -6737,8 +6732,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="root" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="root">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down Expand Up @@ -6779,8 +6773,7 @@
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" TargetName="border" Value="0.4" />
<Setter Property="Opacity" TargetName="root" Value="0.4" />
<Setter Property="Opacity" Value="0.4" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true" SourceName="root">
<Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
Expand Down

0 comments on commit e7ebe47

Please sign in to comment.