19
19
using Flow . Launcher . Infrastructure . UserSettings ;
20
20
using Flow . Launcher . Plugin ;
21
21
using Flow . Launcher . Plugin . SharedModels ;
22
+ using System . Collections . ObjectModel ;
22
23
23
24
namespace Flow . Launcher . ViewModel
24
25
{
@@ -117,7 +118,10 @@ public List<LastQueryMode> LastQueryModes
117
118
{
118
119
var key = $ "LastQuery{ e } ";
119
120
var display = _translater . GetTranslation ( key ) ;
120
- var m = new LastQueryMode { Display = display , Value = e , } ;
121
+ var m = new LastQueryMode
122
+ {
123
+ Display = display , Value = e ,
124
+ } ;
121
125
modes . Add ( m ) ;
122
126
}
123
127
return modes ;
@@ -165,12 +169,17 @@ public List<string> QuerySearchPrecisionStrings
165
169
}
166
170
}
167
171
168
- public List < string > OpenResultModifiersList => new List < string > { KeyConstant . Alt , KeyConstant . Ctrl , $ "{ KeyConstant . Ctrl } +{ KeyConstant . Alt } " } ;
172
+ public List < string > OpenResultModifiersList => new List < string >
173
+ {
174
+ KeyConstant . Alt ,
175
+ KeyConstant . Ctrl ,
176
+ $ "{ KeyConstant . Ctrl } +{ KeyConstant . Alt } "
177
+ } ;
169
178
private Internationalization _translater => InternationalizationManager . Instance ;
170
179
public List < Language > Languages => _translater . LoadAvailableLanguages ( ) ;
171
180
public IEnumerable < int > MaxResultsRange => Enumerable . Range ( 2 , 16 ) ;
172
181
173
- public List < ShortCutModel > ShortCuts => Settings . ShortCuts ;
182
+ public ObservableCollection < KeyValuePair < string , string > > ShortCuts => Settings . ShortCuts ;
174
183
175
184
public string TestProxy ( )
176
185
{
@@ -230,7 +239,10 @@ public IList<PluginViewModel> PluginViewModels
230
239
var metadatas = PluginManager . AllPlugins
231
240
. OrderBy ( x => x . Metadata . Disabled )
232
241
. ThenBy ( y => y . Metadata . Name )
233
- . Select ( p => new PluginViewModel { PluginPair = p } )
242
+ . Select ( p => new PluginViewModel
243
+ {
244
+ PluginPair = p
245
+ } )
234
246
. ToList ( ) ;
235
247
return metadatas ;
236
248
}
@@ -269,8 +281,6 @@ public async Task RefreshExternalPluginsAsync()
269
281
OnPropertyChanged ( nameof ( ExternalPlugins ) ) ;
270
282
}
271
283
272
-
273
-
274
284
#endregion
275
285
276
286
#region theme
@@ -284,7 +294,7 @@ public string SelectedTheme
284
294
{
285
295
Settings . Theme = value ;
286
296
ThemeManager . Instance . ChangeTheme ( value ) ;
287
-
297
+
288
298
if ( ThemeManager . Instance . BlurEnabled && Settings . UseDropShadowEffect )
289
299
DropShadowEffect = false ;
290
300
}
@@ -333,7 +343,10 @@ public List<ColorScheme> ColorSchemes
333
343
{
334
344
var key = $ "ColorScheme{ e } ";
335
345
var display = _translater . GetTranslation ( key ) ;
336
- var m = new ColorScheme { Display = display , Value = e , } ;
346
+ var m = new ColorScheme
347
+ {
348
+ Display = display , Value = e ,
349
+ } ;
337
350
modes . Add ( m ) ;
338
351
}
339
352
return modes ;
@@ -376,7 +389,10 @@ public Brush PreviewBackground
376
389
bitmap . BeginInit ( ) ;
377
390
bitmap . StreamSource = memStream ;
378
391
bitmap . EndInit ( ) ;
379
- var brush = new ImageBrush ( bitmap ) { Stretch = Stretch . UniformToFill } ;
392
+ var brush = new ImageBrush ( bitmap )
393
+ {
394
+ Stretch = Stretch . UniformToFill
395
+ } ;
380
396
return brush ;
381
397
}
382
398
else
@@ -404,19 +420,19 @@ public ResultsViewModel PreviewResults
404
420
{
405
421
Title = "WebSearch" ,
406
422
SubTitle = "Search the web with different search engine support" ,
407
- IcoPath = Path . Combine ( Constant . ProgramDirectory , @"Plugins\Flow.Launcher.Plugin.WebSearch\Images\web_search.png" )
423
+ IcoPath = Path . Combine ( Constant . ProgramDirectory , @"Plugins\Flow.Launcher.Plugin.WebSearch\Images\web_search.png" )
408
424
} ,
409
425
new Result
410
426
{
411
427
Title = "Program" ,
412
428
SubTitle = "Launch programs as admin or a different user" ,
413
- IcoPath = Path . Combine ( Constant . ProgramDirectory , @"Plugins\Flow.Launcher.Plugin.Program\Images\program.png" )
429
+ IcoPath = Path . Combine ( Constant . ProgramDirectory , @"Plugins\Flow.Launcher.Plugin.Program\Images\program.png" )
414
430
} ,
415
431
new Result
416
432
{
417
433
Title = "ProcessKiller" ,
418
434
SubTitle = "Terminate unwanted processes" ,
419
- IcoPath = Path . Combine ( Constant . ProgramDirectory , @"Plugins\Flow.Launcher.Plugin.ProcessKiller\Images\app.png" )
435
+ IcoPath = Path . Combine ( Constant . ProgramDirectory , @"Plugins\Flow.Launcher.Plugin.ProcessKiller\Images\app.png" )
420
436
}
421
437
} ;
422
438
var vm = new ResultsViewModel ( Settings ) ;
@@ -430,8 +446,8 @@ public FontFamily SelectedQueryBoxFont
430
446
get
431
447
{
432
448
if ( Fonts . SystemFontFamilies . Count ( o =>
433
- o . FamilyNames . Values != null &&
434
- o . FamilyNames . Values . Contains ( Settings . QueryBoxFont ) ) > 0 )
449
+ o . FamilyNames . Values != null &&
450
+ o . FamilyNames . Values . Contains ( Settings . QueryBoxFont ) ) > 0 )
435
451
{
436
452
var font = new FontFamily ( Settings . QueryBoxFont ) ;
437
453
return font ;
@@ -458,7 +474,7 @@ public FamilyTypeface SelectedQueryBoxFontFaces
458
474
Settings . QueryBoxFontStyle ,
459
475
Settings . QueryBoxFontWeight ,
460
476
Settings . QueryBoxFontStretch
461
- ) ) ;
477
+ ) ) ;
462
478
return typeface ;
463
479
}
464
480
set
@@ -475,8 +491,8 @@ public FontFamily SelectedResultFont
475
491
get
476
492
{
477
493
if ( Fonts . SystemFontFamilies . Count ( o =>
478
- o . FamilyNames . Values != null &&
479
- o . FamilyNames . Values . Contains ( Settings . ResultFont ) ) > 0 )
494
+ o . FamilyNames . Values != null &&
495
+ o . FamilyNames . Values . Contains ( Settings . ResultFont ) ) > 0 )
480
496
{
481
497
var font = new FontFamily ( Settings . ResultFont ) ;
482
498
return font ;
@@ -503,7 +519,7 @@ public FamilyTypeface SelectedResultFontFaces
503
519
Settings . ResultFontStyle ,
504
520
Settings . ResultFontWeight ,
505
521
Settings . ResultFontStretch
506
- ) ) ;
522
+ ) ) ;
507
523
return typeface ;
508
524
}
509
525
set
@@ -534,6 +550,7 @@ public FamilyTypeface SelectedResultFontFaces
534
550
public string Github => Constant . GitHub ;
535
551
public static string Version => Constant . Version ;
536
552
public string ActivatedTimes => string . Format ( _translater . GetTranslation ( "about_activate_times" ) , Settings . ActivateTimes ) ;
553
+
537
554
#endregion
538
555
}
539
- }
556
+ }
0 commit comments