<commit_before>using Xwt.Backends;

#if MONOMAC
using nint = System.Int32;
using nfloat = System.Single;
using MonoMac.Foundation;
using MonoMac.AppKit;
#else
using Foundation;
using AppKit;
#endif


namespace Xwt.Mac
{
	public class PasswordEntryBackend : ViewBackend<NSView, IPasswordEntryEventSink>, IPasswordEntryBackend
	{
		public PasswordEntryBackend ()
		{
		}

		public override void Initialize ()
		{
			base.Initialize ();
			var view = new CustomSecureTextField (EventSink, ApplicationContext);
			ViewObject = new CustomAlignedContainer (EventSink, ApplicationContext, (NSView)view);
		}

		protected override void OnSizeToFit ()
		{
			Container.SizeToFit ();
		}

		CustomAlignedContainer Container {
			get { return (CustomAlignedContainer)base.Widget; }
		}

		public new NSSecureTextField Widget {
			get { return (NSSecureTextField)Container.Child; }
		}

		protected override Size GetNaturalSize ()
		{
			var s = base.GetNaturalSize ();
			return new Size (EventSink.GetDefaultNaturalSize ().Width, s.Height);
		}

		public string Password {
			get {
				return Widget.StringValue;
			}
			set {
				Widget.StringValue = value ?? string.Empty;
			}
		}<commit_msg>WIN-821: Password field is using wrong font.<commit_after>using Xwt.Backends;

#if MONOMAC
using nint = System.Int32;
using nfloat = System.Single;
using MonoMac.Foundation;
using MonoMac.AppKit;
#else
using Foundation;
using AppKit;
#endif


namespace Xwt.Mac
{
	public class PasswordEntryBackend : ViewBackend<NSView, IPasswordEntryEventSink>, IPasswordEntryBackend
	{
		public PasswordEntryBackend ()
		{
		}

		public override void Initialize ()
		{
			base.Initialize ();
			var view = new CustomSecureTextField (EventSink, ApplicationContext);
			ViewObject = new CustomAlignedContainer (EventSink, ApplicationContext, (NSView)view);
			((NSTextFieldCell)Widget.Cell).BezelStyle = NSTextFieldBezelStyle.Square;
			((NSTextFieldCell)Widget.Cell).Bezeled = true;
		}

		protected override void OnSizeToFit ()
		{
			Container.SizeToFit ();
		}

		CustomAlignedContainer Container {
			get { return (CustomAlignedContainer)base.Widget; }
		}

		public new NSSecureTextField Widget {
			get { return (NSSecureTextField)Container.Child; }
		}

		protected override Size GetNaturalSize ()
		{
			var s = base.GetNaturalSize ();
			return new Size (EventSink.GetDefaultNaturalSize ().Width, s.Height);
		}

		public string Password {
			get {
				return Widget.StringValue;
			}
			set {
				Widget.StringValue = value ?? string.Empty;
			}
		}
{'fraction_non_alphanumeric': 0.09414556962025317, 'fraction_numerical': 0.002768987341772152, 'mean_word_length': 4.140243902439025, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2754464', 'n_tokens_mistral': 902, 'n_tokens_neox': 784, 'n_words': 184}