mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
ux: add a toggle button to reveal password
This commit is contained in:
parent
c16bed1d9f
commit
51a68027c8
2 changed files with 19 additions and 1 deletions
|
@ -62,7 +62,15 @@
|
||||||
Height="32"
|
Height="32"
|
||||||
Text="{Binding Passphrase, Mode=TwoWay}"
|
Text="{Binding Passphrase, Mode=TwoWay}"
|
||||||
PasswordChar="*"
|
PasswordChar="*"
|
||||||
HorizontalAlignment="Stretch"/>
|
RevealPassword="{Binding ShowPassword, Mode=OneWay}"
|
||||||
|
HorizontalAlignment="Stretch">
|
||||||
|
<TextBox.InnerRightContent>
|
||||||
|
<ToggleButton Grid.Column="6"
|
||||||
|
Classes="toggle_untracked"
|
||||||
|
Width="26" Height="14"
|
||||||
|
IsChecked="{Binding ShowPassword, Mode=TwoWay}"/>
|
||||||
|
</TextBox.InnerRightContent>
|
||||||
|
</TextBox>
|
||||||
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
<Button Classes="flat primary"
|
<Button Classes="flat primary"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
using Avalonia;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
|
|
||||||
|
@ -7,6 +8,15 @@ namespace SourceGit.Views
|
||||||
{
|
{
|
||||||
public partial class Askpass : ChromelessWindow
|
public partial class Askpass : ChromelessWindow
|
||||||
{
|
{
|
||||||
|
public static readonly StyledProperty<bool> ShowPasswordProperty =
|
||||||
|
AvaloniaProperty.Register<Askpass, bool>(nameof(ShowPassword), false);
|
||||||
|
|
||||||
|
public bool ShowPassword
|
||||||
|
{
|
||||||
|
get => GetValue(ShowPasswordProperty);
|
||||||
|
set => SetValue(ShowPasswordProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public string KeyName
|
public string KeyName
|
||||||
{
|
{
|
||||||
get;
|
get;
|
||||||
|
|
Loading…
Reference in a new issue