diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
20 files changed, 48 insertions, 23 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs index c9f04d6..87242df 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs @@ -48,7 +48,7 @@ namespace Xamarin.PropertyEditing.Mac var material = new MaterialBrushEditorViewController (); material.ViewModel = ViewModel; item.ViewController = material; - item.Image = NSImage.ImageNamed ("property-brush-none-16"); + item.Image = NSImage.ImageNamed ("property-brush-palette-16"); break; case CommonBrushType.Resource: var resource = new ResourceBrushViewController (); diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs index 3526287..ca6a829 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs @@ -70,10 +70,6 @@ namespace Xamarin.PropertyEditing.Mac internal class UnderlinedTabViewController<TViewModel> : NotifyingTabViewController<TViewModel> where TViewModel : NotifyingObject { - private NSStackView tabStack = new NSStackView () { - Spacing = 4f, - }; - public override void NumberOfItemsChanged (NSTabView tabView) { base.NumberOfItemsChanged (tabView); @@ -85,7 +81,8 @@ namespace Xamarin.PropertyEditing.Mac foreach (var item in TabViewItems) { if (item.Image != null) { this.tabStack.AddView (new UnderlinedImageView (item.Image.Name) { - Selected = i == SelectedTabViewItemIndex + Selected = i == SelectedTabViewItemIndex, + ToolTip = item.Label, }, NSStackViewGravity.Leading); } else { this.tabStack.AddView (new UnderlinedTextField () { @@ -100,10 +97,28 @@ namespace Xamarin.PropertyEditing.Mac } } + private NSStackView outerStack; + private NSStackView innerStack; + private NSStackView tabStack = new NSStackView () { + Spacing = 4f, + }; + + private NSEdgeInsets edgeInsets = new NSEdgeInsets (0, 12, 12, 12); + public NSEdgeInsets EdgeInsets { + get => this.edgeInsets; + set { + this.edgeInsets = value; + if (this.outerStack != null) { + this.outerStack.EdgeInsets = value; + this.innerStack.EdgeInsets = value; + } + } + } + public override void MouseDown (NSEvent theEvent) { NSView hit = View.HitTest (View.Superview.ConvertPointFromView (theEvent.LocationInWindow, null)); - if (!(hit is ISelectable)) + if (!(hit is IUnderliningTabView)) return; int i = 0; @@ -120,7 +135,7 @@ namespace Xamarin.PropertyEditing.Mac { base.DidSelect (tabView, item); for (int i = 0; i < this.tabStack.Views.Length; i++) { - var tabItem = this.tabStack.Views[i] as ISelectable; + var tabItem = this.tabStack.Views[i] as IUnderliningTabView; if (tabItem != null) tabItem.Selected = SelectedTabViewItemIndex == i; } @@ -128,15 +143,22 @@ namespace Xamarin.PropertyEditing.Mac public override void LoadView () { - var stack = new NSStackView () { + this.outerStack = new NSStackView () { + Orientation = NSUserInterfaceLayoutOrientation.Horizontal, + EdgeInsets = EdgeInsets + }; + + this.innerStack = new NSStackView () { Spacing = 0, Alignment = NSLayoutAttribute.Left, - Orientation = NSUserInterfaceLayoutOrientation.Vertical + Orientation = NSUserInterfaceLayoutOrientation.Vertical, + EdgeInsets = EdgeInsets }; - stack.AddView (this.tabStack, NSStackViewGravity.Top); - stack.AddView (TabView, NSStackViewGravity.Bottom); - View = stack; + this.outerStack.AddView (this.innerStack, NSStackViewGravity.Leading); + this.innerStack.AddView (this.tabStack, NSStackViewGravity.Top); + this.innerStack.AddView (TabView, NSStackViewGravity.Bottom); + View = this.outerStack; } } } diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs index 39deb43..fcc4134 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs @@ -3,12 +3,11 @@ using CoreGraphics; namespace Xamarin.PropertyEditing.Mac { - - internal interface ISelectable { + internal interface IUnderliningTabView { bool Selected { get; set; } } - internal class UnderlinedImageView : NSImageView, ISelectable + internal class UnderlinedImageView : NSImageView, IUnderliningTabView { public UnderlinedImageView (string name) { @@ -22,14 +21,13 @@ namespace Xamarin.PropertyEditing.Mac { get => selected; set { - //if (selected == value) - // return; + if (selected == value && Image != null) + return; selected = value; var version = PropertyEditorPanel.ThemeManager.Theme == Themes.PropertyEditorTheme.Dark ? $"{name}~dark" : name; Image = NSImage.ImageNamed (selected ? $"{version}~sel" : version); - //Enabled = value; NeedsDisplay = true; } } @@ -55,7 +53,7 @@ namespace Xamarin.PropertyEditing.Mac } } - internal class UnderlinedTextField : NSTextField, ISelectable + internal class UnderlinedTextField : NSTextField, IUnderliningTabView { public UnderlinedTextField () { @@ -70,12 +68,9 @@ namespace Xamarin.PropertyEditing.Mac get => selected; set { - //if (selected == value) - // return; selected = value; TextColor = selected ? NSColor.Text : NSColor.DisabledControlText; - //Enabled = value; NeedsDisplay = true; } } diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel.png Binary files differindex 00b89eb..594e7e6 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel@2x.png Binary files differindex 01e5392..933cb3c 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel@2x.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.png Binary files differindex bb74dd5..8f36425 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.png Binary files differindex b8e1080..209a125 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.png Binary files differnew file mode 100644 index 0000000..ce40c8a --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.png Binary files differnew file mode 100644 index 0000000..dd3fbc6 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.png Binary files differnew file mode 100644 index 0000000..5095161 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark@2x.png Binary files differnew file mode 100644 index 0000000..936f021 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel.png Binary files differnew file mode 100644 index 0000000..5095161 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel@2x.png Binary files differnew file mode 100644 index 0000000..936f021 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.png Binary files differnew file mode 100644 index 0000000..ce40c8a --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel@2x.png Binary files differnew file mode 100644 index 0000000..dd3fbc6 --- /dev/null +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.png Binary files differindex 1b3520b..5f51f84 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel@2x.png Binary files differindex 5e2fd96..bd4993d 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel@2x.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.png Binary files differindex 3bbdbb0..d15fb76 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.png diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel@2x.png Binary files differindex 0aa1109..dcaea5a 100755 --- a/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel@2x.png +++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel@2x.png diff --git a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj index 3fa13b6..c2f7a98 100644 --- a/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj +++ b/Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj @@ -240,6 +240,14 @@ <BundleResource Include="Resources\property-brush-solid-16~dark~sel%402x.png" /> <BundleResource Include="Resources\property-brush-solid-16~sel.png" /> <BundleResource Include="Resources\property-brush-solid-16~sel%402x.png" /> + <BundleResource Include="Resources\property-brush-palette-16.png" /> + <BundleResource Include="Resources\property-brush-palette-16%402x.png" /> + <BundleResource Include="Resources\property-brush-palette-16~dark.png" /> + <BundleResource Include="Resources\property-brush-palette-16~dark%402x.png" /> + <BundleResource Include="Resources\property-brush-palette-16~sel.png" /> + <BundleResource Include="Resources\property-brush-palette-16~sel%402x.png" /> + <BundleResource Include="Resources\property-brush-palette-16~dark~sel.png" /> + <BundleResource Include="Resources\property-brush-palette-16~dark~sel%402x.png" /> </ItemGroup> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Mac\Xamarin.Mac.CSharp.targets" /> </Project>
\ No newline at end of file |