diff options
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/Controls/Custom')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs b/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs index 6158cdf..fab17c6 100644 --- a/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs +++ b/Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs @@ -56,6 +56,14 @@ namespace Xamarin.PropertyEditing.Mac }; } + public override void ViewDidChangeEffectiveAppearance () + { + base.ViewDidChangeEffectiveAppearance (); + ToggleFocusImage (); + } + + private readonly IHostResourceProvider hostResources; + private void PopUpContextMenu () { if (this.popUpContextMenu == null) { @@ -110,14 +118,6 @@ namespace Xamarin.PropertyEditing.Mac NSMenu.PopUpContextMenu (popUpContextMenu, popupMenuEvent, this); } - public override void ViewDidChangeEffectiveAppearance () - { - base.ViewDidChangeEffectiveAppearance (); - ToggleFocusImage (); - } - - private readonly IHostResourceProvider hostResources; - private void ToggleFocusImage (bool focused = false) { if (viewModel != null) { @@ -200,22 +200,28 @@ namespace Xamarin.PropertyEditing.Mac private void OnCustomExpression (object sender, EventArgs e) { - var customExpressionView = new CustomExpressionView (this.hostResources, viewModel); + var customExpressionView = new CustomExpressionView (this.hostResources, viewModel) { + Appearance = EffectiveAppearance + }; var customExpressionPopOver = new AutoClosePopOver { ContentViewController = new NSViewController (null, null) { View = customExpressionView }, }; + customExpressionPopOver.SetAppearance (this.hostResources.GetVibrantAppearance (EffectiveAppearance)); customExpressionPopOver.Show (customExpressionView.Frame, (NSView)this, NSRectEdge.MinYEdge); } private void OnResourceRequested (object sender, EventArgs e) { - var requestResourceView = new RequestResourceView (this.hostResources, this.viewModel); + var requestResourceView = new RequestResourceView (this.hostResources, this.viewModel) { + Appearance = EffectiveAppearance + }; var resourceSelectorPopOver = new AutoClosePopOver { ContentViewController = new NSViewController (null, null) { View = requestResourceView }, }; + resourceSelectorPopOver.SetAppearance (this.hostResources.GetVibrantAppearance (EffectiveAppearance)); requestResourceView.PopOver = resourceSelectorPopOver; |