Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/BrushTabViewController.cs2
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTabViewController.cs46
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/UnderlinedTextField.cs15
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel.pngbin137 -> 535 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-gradient-16~sel@2x.pngbin225 -> 712 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.pngbin166 -> 602 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.pngbin126 -> 547 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.pngbin0 -> 191 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.pngbin0 -> 349 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.pngbin0 -> 188 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark@2x.pngbin0 -> 344 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel.pngbin0 -> 188 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel@2x.pngbin0 -> 344 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.pngbin0 -> 191 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel@2x.pngbin0 -> 349 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.pngbin110 -> 515 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel@2x.pngbin138 -> 623 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.pngbin104 -> 495 bytes
-rwxr-xr-xXamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel@2x.pngbin124 -> 564 bytes
-rw-r--r--Xamarin.PropertyEditing.Mac/Xamarin.PropertyEditing.Mac.csproj8
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
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-image-16~sel.png
index 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
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-none-16~sel.png
index 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
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.png
new file mode 100644
index 0000000..ce40c8a
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16.png
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.png
new file mode 100644
index 0000000..dd3fbc6
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16@2x.png
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.png
new file mode 100644
index 0000000..5095161
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark.png
Binary files differ
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
new file mode 100644
index 0000000..936f021
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark@2x.png
Binary files differ
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
new file mode 100644
index 0000000..5095161
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel.png
Binary files differ
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
new file mode 100644
index 0000000..936f021
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~dark~sel@2x.png
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.png
new file mode 100644
index 0000000..ce40c8a
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel.png
Binary files differ
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
new file mode 100644
index 0000000..dd3fbc6
--- /dev/null
+++ b/Xamarin.PropertyEditing.Mac/Resources/property-brush-palette-16~sel@2x.png
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-resources-16~sel.png
index 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
Binary files differ
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
index 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
Binary files differ
diff --git a/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.png b/Xamarin.PropertyEditing.Mac/Resources/property-brush-solid-16~sel.png
index 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
Binary files differ
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
index 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
Binary files differ
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