diff options
author | Kunyi Li <55105630+kunyli@users.noreply.github.com> | 2022-03-26 02:34:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-26 02:34:17 +0300 |
commit | 13d7a18c5bbc6f882a1850dfa7afb05ee643aa6a (patch) | |
tree | c54536f6c78add615a17af30561efe55ef5cc8fd /Xwt.XamMac | |
parent | 9bad871dd2ac47f48dbf25a67c023aaa52033f56 (diff) |
Fixed changed handler to detect password autofilled using Apple Keychain and text field wrapping to prevent long passwords appearing as multiple lines (#1098)
Diffstat (limited to 'Xwt.XamMac')
-rw-r--r-- | Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs b/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs index 5e1a74a5..fe25c64c 100644 --- a/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs +++ b/Xwt.XamMac/Xwt.Mac/PasswordEntryBackend.cs @@ -40,7 +40,12 @@ namespace Xwt.Mac public override void Initialize () { base.Initialize (); + var view = new CustomSecureTextField (EventSink, ApplicationContext); + view.Cell.UsesSingleLineMode = true; + view.Cell.Scrollable = true; + view.Cell.Wraps = false; + ViewObject = new CustomAlignedContainer (EventSink, ApplicationContext, (NSView)view) { DrawsBackground = false }; } @@ -109,6 +114,7 @@ namespace Xwt.Mac this.context = context; this.eventSink = eventSink; Activated += (sender, e) => context.InvokeUserCode (eventSink.OnActivated); + Changed += (sender, e) => context.InvokeUserCode (eventSink.OnChanged); } public NSView View { @@ -118,12 +124,6 @@ namespace Xwt.Mac } public ViewBackend Backend { get; set; } - - public override void DidChange (NSNotification notification) - { - base.DidChange (notification); - context.InvokeUserCode (eventSink.OnChanged); - } } } |