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:
authorEric Maupin <ermaup@microsoft.com>2019-01-18 20:48:04 +0300
committerEric Maupin <ermaup@microsoft.com>2019-01-18 20:48:04 +0300
commitea3ffb25b52cc576ebd4ab2418d15ed07b2a8cd5 (patch)
tree9ff2bff7fd302299916a6a4d79ffeac9c539c9a6 /Xamarin.PropertyEditing.Mac
parent738f6caf093651e52da2d597f17cea60c3859934 (diff)
[mac] Inherit appearance in custom exp/resources
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r--Xamarin.PropertyEditing.Mac/Controls/Custom/PropertyButton.cs26
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;