diff options
author | Dominique Louis <dominique@Dominiques-MacBook-Pro-2.local> | 2018-11-26 18:23:46 +0300 |
---|---|---|
committer | Dominique Louis <dominique@Dominiques-MacBook-Pro-2.local> | 2018-11-26 18:23:46 +0300 |
commit | 3d0379ef33d96d4f7ad6752d2e155bafcffdeb0c (patch) | |
tree | 96c95ceebc12e1c42260a3f6abcdd93d8443cf29 /Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs | |
parent | 9ea098e431e87513f474c21553b3de6f90678cd1 (diff) |
[Mac] Refactor GetImageNameForTheme to handle ~sel append internally.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs index 9683159..0c5f921 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs @@ -35,10 +35,10 @@ namespace Xamarin.PropertyEditing.Mac { get => lineWidth; set { - if (lineWidth == value) + if (this.lineWidth == value) return; - lineWidth = value; + this.lineWidth = value; NeedsLayout = true; } } @@ -46,14 +46,14 @@ namespace Xamarin.PropertyEditing.Mac private string VersionName { get { - return PropertyEditorPanel.ThemeManager.GetImageNameForTheme (name, selected ? "~sel" : string.Empty); + return PropertyEditorPanel.ThemeManager.GetImageNameForTheme (this.name, this.selected); } } public override void DrawRect (CGRect dirtyRect) { if (Image?.Name != VersionName) { - Image = PropertyEditorPanel.ThemeManager.GetImageForTheme (name, selected ? "~sel" : string.Empty); + Image = PropertyEditorPanel.ThemeManager.GetImageForTheme (this.name, this.selected); } base.DrawRect (dirtyRect); @@ -61,7 +61,7 @@ namespace Xamarin.PropertyEditing.Mac return; NSBezierPath path = new NSBezierPath (); - path.AppendPathWithRect (new CGRect (Bounds.X, Bounds.Top + lineWidth, Bounds.Width, lineWidth)); + path.AppendPathWithRect (new CGRect (Bounds.X, Bounds.Top + this.lineWidth, Bounds.Width, this.lineWidth)); (selected? NSColor.Text: NSColor.DisabledControlText).Set (); path.Fill (); } @@ -70,7 +70,7 @@ namespace Xamarin.PropertyEditing.Mac { get { var size = base.IntrinsicContentSize; - return new CGSize (size.Width + lineWidth + 10, size.Height + lineWidth + 10); + return new CGSize (size.Width + this.lineWidth + 10, size.Height + this.lineWidth + 10); } } } @@ -88,11 +88,11 @@ namespace Xamarin.PropertyEditing.Mac private bool selected; public bool Selected { - get => selected; + get => this.selected; set { - selected = value; - TextColor = selected ? NSColor.Text : NSColor.DisabledControlText; + this.selected = value; + TextColor = this.selected ? NSColor.Text : NSColor.DisabledControlText; ///NeedsDisplay = true; } @@ -100,12 +100,12 @@ namespace Xamarin.PropertyEditing.Mac private int lineWidth = 2; public int LineWidth { - get => lineWidth; + get =>this.lineWidth; set { - if (lineWidth == value) + if (this.lineWidth == value) return; - lineWidth = value; + this.lineWidth = value; NeedsLayout = true; } } |