Skip to content

Commit

Permalink
Merge pull request #7 from ghost1372/patch-1
Browse files Browse the repository at this point in the history
Fix SuggestionForeground for Dark Mode #5
Fix vertical alignment difference between Text and Placeholder
  • Loading branch information
AndrewKeepCoding authored May 4, 2022
2 parents 0f06f6c + d824635 commit 716d727
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using Windows.System;
using Windows.UI;

namespace AK.Toolkit.WinUI3;

Expand Down Expand Up @@ -142,10 +143,11 @@ protected override void OnApplyTemplate()
{
base.OnApplyTemplate();

if (Resources.TryGetValue("extControlPlaceholderForeground", out var value) is true)
if (Resources.TryGetValue("SystemColorGrayTextColor", out var value) is true)
{
if (value is Brush defaultBrush)
if (value is Color defaultColor)
{
var defaultBrush = new SolidColorBrush(defaultColor);
SuggestionForegroundDefaultBrush = defaultBrush;
}
}
Expand Down Expand Up @@ -181,7 +183,7 @@ private void InitializeSuggestionControl()
SuggestionControl.VerticalScrollBarVisibility = ScrollViewer.GetVerticalScrollBarVisibility(this);
SuggestionControl.VerticalScrollMode = ScrollViewer.GetVerticalScrollMode(this);
SuggestionControl.ZoomMode = ZoomMode.Disabled;
SuggestionControl.Margin = new Thickness(0, 0, 0, 0);
SuggestionControl.Margin = new Thickness(0, -1, 0, 0);

if (SuggestionForeground is null && SuggestionForegroundDefaultBrush is not null)
{
Expand Down Expand Up @@ -304,4 +306,4 @@ private void ShowSuggestion()
DismissSuggestion();
}
}
}
}

0 comments on commit 716d727

Please sign in to comment.