mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
@@ -375,15 +375,15 @@ namespace Wox
|
||||
UserSettingStorage.Instance.QueryBoxFontStretch
|
||||
));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(UserSettingStorage.Instance.ResultItemFont) &&
|
||||
Fonts.SystemFontFamilies.Count(o => o.FamilyNames.Values.Contains(UserSettingStorage.Instance.ResultItemFont)) > 0)
|
||||
if (!string.IsNullOrEmpty(UserSettingStorage.Instance.ResultFont) &&
|
||||
Fonts.SystemFontFamilies.Count(o => o.FamilyNames.Values.Contains(UserSettingStorage.Instance.ResultFont)) > 0)
|
||||
{
|
||||
cbResultItemFont.Text = UserSettingStorage.Instance.ResultItemFont;
|
||||
ResultFontComboBox.Text = UserSettingStorage.Instance.ResultFont;
|
||||
|
||||
cbResultItemFontFaces.SelectedItem = SyntaxSugars.CallOrRescueDefault(() => ((FontFamily)cbResultItemFont.SelectedItem).ConvertFromInvariantStringsOrNormal(
|
||||
UserSettingStorage.Instance.ResultItemFontStyle,
|
||||
UserSettingStorage.Instance.ResultItemFontWeight,
|
||||
UserSettingStorage.Instance.ResultItemFontStretch
|
||||
ResultFontFacesComboBox.SelectedItem = SyntaxSugars.CallOrRescueDefault(() => ((FontFamily)ResultFontComboBox.SelectedItem).ConvertFromInvariantStringsOrNormal(
|
||||
UserSettingStorage.Instance.ResultFontStyle,
|
||||
UserSettingStorage.Instance.ResultFontWeight,
|
||||
UserSettingStorage.Instance.ResultFontStretch
|
||||
));
|
||||
}
|
||||
|
||||
@@ -502,30 +502,30 @@ namespace Wox
|
||||
}
|
||||
}
|
||||
|
||||
private void CbResultItemFont_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
private void OnResultFontSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!settingsLoaded) return;
|
||||
string resultItemFont = cbResultItemFont.SelectedItem.ToString();
|
||||
UserSettingStorage.Instance.ResultItemFont = resultItemFont;
|
||||
cbResultItemFontFaces.SelectedItem = ((FontFamily)cbResultItemFont.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
string resultItemFont = ResultFontComboBox.SelectedItem.ToString();
|
||||
UserSettingStorage.Instance.ResultFont = resultItemFont;
|
||||
ResultFontFacesComboBox.SelectedItem = ((FontFamily)ResultFontComboBox.SelectedItem).ChooseRegularFamilyTypeface();
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
|
||||
private void CbResultItemFontFaces_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
private void OnResultFontFacesSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!settingsLoaded) return;
|
||||
FamilyTypeface typeface = (FamilyTypeface)cbResultItemFontFaces.SelectedItem;
|
||||
FamilyTypeface typeface = (FamilyTypeface)ResultFontFacesComboBox.SelectedItem;
|
||||
if (typeface == null)
|
||||
{
|
||||
if (cbResultItemFontFaces.Items.Count > 0)
|
||||
cbResultItemFontFaces.SelectedIndex = 0;
|
||||
if (ResultFontFacesComboBox.Items.Count > 0)
|
||||
ResultFontFacesComboBox.SelectedIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
UserSettingStorage.Instance.ResultItemFontStretch = typeface.Stretch.ToString();
|
||||
UserSettingStorage.Instance.ResultItemFontWeight = typeface.Weight.ToString();
|
||||
UserSettingStorage.Instance.ResultItemFontStyle = typeface.Style.ToString();
|
||||
UserSettingStorage.Instance.ResultFontStretch = typeface.Stretch.ToString();
|
||||
UserSettingStorage.Instance.ResultFontWeight = typeface.Weight.ToString();
|
||||
UserSettingStorage.Instance.ResultFontStyle = typeface.Style.ToString();
|
||||
UserSettingStorage.Instance.Save();
|
||||
ThemeManager.Theme.ChangeTheme(UserSettingStorage.Instance.Theme);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user