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 | |
parent | 9ea098e431e87513f474c21553b3de6f90678cd1 (diff) |
[Mac] Refactor GetImageNameForTheme to handle ~sel append internally.
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls')
3 files changed, 14 insertions, 14 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; } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/RequestResource/RequestResourceView.cs b/Xamarin.PropertyEditing.Mac/Controls/RequestResource/RequestResourceView.cs index 034a561..8a85e1d 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RequestResource/RequestResourceView.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RequestResource/RequestResourceView.cs @@ -103,7 +103,7 @@ namespace Xamarin.PropertyEditing.Mac break; case 2: this.resourceSelectorPanel.ViewModel.ShowOnlySystemResources = true; - this.segmentedControl.SetImage (PropertyEditorPanel.ThemeManager.GetImageForTheme ("resource-editor-16", "~sel"), 2); + this.segmentedControl.SetImage (PropertyEditorPanel.ThemeManager.GetImageForTheme ("resource-editor-16", true), 2); break; } diff --git a/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs b/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs index 829f405..387e516 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/RequestResource/ResourceTableDelegate.cs @@ -102,7 +102,7 @@ namespace Xamarin.PropertyEditing.Mac if (tableView.SelectedRow != -1 && tableView.GetView (0, tableView.SelectedRow, false) is NSImageView selectedIconColumn) { - selectedIconColumn.Image = PropertyEditorPanel.ThemeManager.GetImageForTheme ("resource-editor-32", "~sel"); + selectedIconColumn.Image = PropertyEditorPanel.ThemeManager.GetImageForTheme ("resource-editor-32", true); previousRow = tableView.SelectedRow; } } |