Skip to content

Commit a15b789

Browse files
committed
Cleanup codes
1 parent 8674fca commit a15b789

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.ComponentModel;
43
using System.IO;
54
using System.Linq;
65
using System.Threading.Tasks;
76
using System.Windows;
8-
using System.Windows.Media;
97
using CommunityToolkit.Mvvm.Input;
108
using Flow.Launcher.Core;
119
using Flow.Launcher.Infrastructure;
@@ -271,14 +269,6 @@ private static string BytesToReadableString(long bytes)
271269
return "0 B";
272270
}
273271

274-
public event PropertyChangedEventHandler PropertyChanged;
275-
protected virtual void OnPropertyChanged(string propertyName)
276-
{
277-
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
278-
}
279-
280-
private string _settingWindowFont;
281-
282272
public string SettingWindowFont
283273
{
284274
get => _settings.SettingWindowFont;
@@ -287,34 +277,15 @@ public string SettingWindowFont
287277
if (_settings.SettingWindowFont != value)
288278
{
289279
_settings.SettingWindowFont = value;
290-
OnPropertyChanged(nameof(SettingWindowFont));
280+
OnPropertyChanged();
291281
}
292282
}
293283
}
294284

295285
[RelayCommand]
296286
private void ResetSettingWindowFont()
297287
{
298-
string defaultFont = GetSystemDefaultFont();
288+
string defaultFont = Win32Helper.GetSystemDefaultFont(false);
299289
_settings.SettingWindowFont = defaultFont;
300290
}
301-
302-
public static string GetSystemDefaultFont()
303-
{
304-
try
305-
{
306-
var font = SystemFonts.MessageFontFamily;
307-
if (font.FamilyNames.TryGetValue(System.Windows.Markup.XmlLanguage.GetLanguage("en-US"), out var englishName))
308-
{
309-
return englishName;
310-
}
311-
312-
return font.Source ?? "Segoe UI";
313-
}
314-
catch
315-
{
316-
return "Segoe UI";
317-
}
318-
}
319-
320291
}

0 commit comments

Comments
 (0)