mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-02 15:50:49 +08:00
Add ClearButton support for TextArea with ClearButton class combination
Co-authored-by: zdpcdt <54255897+zdpcdt@users.noreply.github.com>
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
IsEnabled="False" />
|
||||
</StackPanel>
|
||||
<TextBox Width="300" Classes="TextArea" Watermark="TextArea TextBox" />
|
||||
<TextBox Width="300" Classes="TextArea ClearButton" Text="TextArea with ClearButton - text should be clearable" />
|
||||
<TextBox
|
||||
Width="300"
|
||||
Theme="{StaticResource LooklessTextBox}"
|
||||
|
||||
@@ -170,6 +170,14 @@
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.TextArea.clearButton, ^.TextArea.ClearButton">
|
||||
<Style Selector="^[IsReadOnly=False]:focus:not(:empty) /template/ Button#PART_ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^[IsReadOnly=False]:pointerover:not(:empty) /template/ Button#PART_ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
|
||||
<Setter Property="PasswordChar" Value="•" />
|
||||
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
|
||||
@@ -378,6 +386,14 @@
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.TextArea.clearButton, ^.TextArea.ClearButton">
|
||||
<Style Selector="^[IsReadOnly=False]:focus:not(:empty) /template/ Button#PART_ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="^[IsReadOnly=False]:pointerover:not(:empty) /template/ Button#PART_ClearButton">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
|
||||
<Setter Property="PasswordChar" Value="•" />
|
||||
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
|
||||
|
||||
Reference in New Issue
Block a user