Skip to content

Commit

Permalink
Merge pull request #84 from AvaloniaUtils/fixMaterial
Browse files Browse the repository at this point in the history
Swap background and overlay brushes names to fix Material.Avalonia
  • Loading branch information
SKProCH authored Jan 6, 2025
2 parents a3e80cb + 65fbf5c commit d688347
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions DialogHost.Avalonia/DialogHostStyles.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ public DialogHostStyles(IResourceHost owner) : base(owner) {
/// <summary>
/// Lists of resource keys which will be used as defaults for DialogHost.Background property
/// </summary>
public static IReadOnlyList<string> BackgroundColorKeys { get; } = ["SystemControlPageBackgroundChromeLowBrush"];
public static IReadOnlyList<string> BackgroundColorKeys { get; } =
["SystemControlBackgroundAltHighBrush", "MaterialDesignPaper", "MaterialPaperBrush"];

/// <summary>
/// Lists of resource keys which will be used as defaults for DialogHost.OverlayBackground property
/// </summary>
public static IReadOnlyList<string> OverlayBackgroundColorKeys { get; } =
["SystemControlBackgroundAltHighBrush", "MaterialDesignPaper", "MaterialPaperBrush"];
["SystemControlPageBackgroundChromeLowBrush"];

bool IResourceNode.HasResources => true;

Expand All @@ -57,7 +58,7 @@ public DialogHostStyles(IResourceHost owner) : base(owner) {
/// if the key is found; otherwise, null.
/// </param>
/// <returns>
/// True if the resource if found, otherwise false.
/// True if the resource is found, otherwise false.
/// </returns>
bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? value) {
if (key is "DialogHostBackgroundMixinBrush") {
Expand All @@ -66,7 +67,7 @@ bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? v
return true;
}
}

value = Brushes.Black;
return true;
}
Expand All @@ -77,7 +78,7 @@ bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? v
return true;
}
}

value = Brushes.Black;
return true;
}
Expand Down

0 comments on commit d688347

Please sign in to comment.