Skip to content

Commit

Permalink
Merge pull request #509 from irihitech/textbox
Browse files Browse the repository at this point in the history
Add default PasswordChar `•` to Textbox
  • Loading branch information
rabbitism authored Dec 29, 2024
2 parents 5f5f9d2 + fe380f9 commit 00b0e01
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 38 deletions.
52 changes: 14 additions & 38 deletions demo/Semi.Avalonia.Demo/Pages/TextBoxDemo.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,80 +4,56 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=netstandard"
d:DesignHeight="800"
d:DesignWidth="800"
mc:Ignorable="d">
<ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20">
<TextBox Width="300" />
<TextBox Width="300" Classes="Large" />
<TextBox Width="300" Classes="Small" />
<TextBox Width="300" Watermark="Please use this" />
<TextBox Width="300" InnerLeftContent="http://" />
<TextBox Width="300" InnerRightContent=".com" />
<TextBox
Width="500"
InnerLeftContent="http://"
InnerRightContent=".com" />
<TextBox Width="300" Classes="clearButton" />
<TextBox Width="300" PasswordChar="*" />
<TextBox Width="300" InnerLeftContent="https://" InnerRightContent=".com" />
<TextBox Width="300" Classes="clearButton" Text="click to clear" />
<TextBox Width="300" Classes="revealPasswordButton" Text="123456" />
<TextBox
Width="300"
Classes="ClearButton RevealPasswordButton"
PasswordChar="*"
Text="123456" />
<TextBox
Width="500"
InnerLeftContent="http://"
InnerLeftContent="https://"
InnerRightContent=".com"
IsEnabled="False" />
<TextBox
Width="500"
Classes="Bordered"
InnerLeftContent="http://"
InnerRightContent=".com" />
<TextBox
Width="500"
Classes="Bordered"
InnerLeftContent="http://"
InnerRightContent=".com"
IsEnabled="False" />
Text="123456" />
<StackPanel Orientation="Horizontal">
<TextBox
Width="150"
Width="100"
Classes="Large"
Watermark="Large" />
<TextBox
Width="150"
Width="100"
Watermark="Default" />
<TextBox
Width="150"
Width="100"
Classes="Small"
Watermark="Small" />
</StackPanel>

<StackPanel Orientation="Horizontal">
<TextBox
Width="150"
Width="100"
IsEnabled="False"
Watermark="Disabled" />
<TextBox
Width="150"
Width="100"
Classes="Bordered"
Watermark="Bordered" />
<TextBox
Width="150"
Width="100"
Classes="Bordered"
IsEnabled="False" />
</StackPanel>
<TextBox Width="300" Classes="TextArea" />
<TextBox Width="300" Classes="TextArea" Watermark="TextArea TextBox" />
<TextBox
Width="300"
Theme="{StaticResource LooklessTextBox}"
Watermark="Lookless TextBox"
InnerLeftContent="http://"
InnerLeftContent="https://"
InnerRightContent=".com" />
</StackPanel>
</ScrollViewer>
</UserControl>
</UserControl>
2 changes: 2 additions & 0 deletions src/Semi.Avalonia/Controls/TextBox.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
</Style>
</Style>
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
<Setter Property="PasswordChar" Value=""/>
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
<Setter Property="IsVisible" Value="True" />
</Style>
Expand Down Expand Up @@ -379,6 +380,7 @@
</Style>
</Style>
<Style Selector="^.revealPasswordButton, ^.RevealPasswordButton">
<Setter Property="PasswordChar" Value=""/>
<Style Selector="^ /template/ ToggleButton#PART_RevealButton">
<Setter Property="IsVisible" Value="True" />
</Style>
Expand Down

0 comments on commit 00b0e01

Please sign in to comment.