1
1
using System ;
2
2
using System . Collections . Generic ;
3
- using System . ComponentModel ;
4
3
using System . IO ;
5
4
using System . Linq ;
6
5
using System . Threading . Tasks ;
7
6
using System . Windows ;
8
- using System . Windows . Media ;
9
7
using CommunityToolkit . Mvvm . Input ;
10
8
using Flow . Launcher . Core ;
11
9
using Flow . Launcher . Infrastructure ;
@@ -271,14 +269,6 @@ private static string BytesToReadableString(long bytes)
271
269
return "0 B" ;
272
270
}
273
271
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
-
282
272
public string SettingWindowFont
283
273
{
284
274
get => _settings . SettingWindowFont ;
@@ -287,34 +277,15 @@ public string SettingWindowFont
287
277
if ( _settings . SettingWindowFont != value )
288
278
{
289
279
_settings . SettingWindowFont = value ;
290
- OnPropertyChanged ( nameof ( SettingWindowFont ) ) ;
280
+ OnPropertyChanged ( ) ;
291
281
}
292
282
}
293
283
}
294
284
295
285
[ RelayCommand ]
296
286
private void ResetSettingWindowFont ( )
297
287
{
298
- string defaultFont = GetSystemDefaultFont ( ) ;
288
+ string defaultFont = Win32Helper . GetSystemDefaultFont ( false ) ;
299
289
_settings . SettingWindowFont = defaultFont ;
300
290
}
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
-
320
291
}
0 commit comments