13
13
using System ;
14
14
using System . IO ;
15
15
using System . Windows ;
16
+ using System . Windows . Controls ;
16
17
using System . Windows . Forms ;
17
18
using System . Windows . Input ;
18
19
using System . Windows . Interop ;
20
+ using System . Windows . Media ;
19
21
using System . Windows . Navigation ;
20
22
using Button = System . Windows . Controls . Button ;
21
23
using Control = System . Windows . Controls . Control ;
24
+ using ListViewItem = System . Windows . Controls . ListViewItem ;
22
25
using MessageBox = System . Windows . MessageBox ;
23
26
using TextBox = System . Windows . Controls . TextBox ;
24
27
using ThemeManager = ModernWpf . ThemeManager ;
@@ -44,6 +47,7 @@ public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
44
47
}
45
48
46
49
#region General
50
+
47
51
private void OnLoaded ( object sender , RoutedEventArgs e )
48
52
{
49
53
RefreshMaximizeRestoreButton ( ) ;
@@ -247,6 +251,7 @@ private void OnPluginDirecotyClick(object sender, MouseButtonEventArgs e)
247
251
PluginManager . API . OpenDirectory ( directory ) ;
248
252
}
249
253
}
254
+
250
255
#endregion
251
256
252
257
#region Proxy
@@ -307,7 +312,7 @@ private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)
307
312
308
313
private void OnExternalPluginInstallClick ( object sender , RoutedEventArgs e )
309
314
{
310
- if ( sender is Button { DataContext : UserPlugin plugin } )
315
+ if ( sender is Button { DataContext : UserPlugin plugin } )
311
316
{
312
317
var pluginsManagerPlugin = PluginManager . GetPluginForId ( "9f8f9b14-2518-4907-b211-35ab6290dee7" ) ;
313
318
var actionKeyword = pluginsManagerPlugin . Metadata . ActionKeywords . Count == 0 ? "" : pluginsManagerPlugin . Metadata . ActionKeywords [ 0 ] ;
@@ -326,7 +331,7 @@ private void OnExternalPluginInstallClick(object sender, RoutedEventArgs e)
326
331
textBox . MoveFocus ( tRequest ) ;
327
332
}
328
333
329
- private void ColorSchemeSelectedIndexChanged ( object sender , EventArgs e )
334
+ private void ColorSchemeSelectedIndexChanged ( object sender , EventArgs e )
330
335
=> ThemeManager . Current . ApplicationTheme = settings . ColorScheme switch
331
336
{
332
337
Constant . Light => ApplicationTheme . Light ,
@@ -370,5 +375,13 @@ private void Window_StateChanged(object sender, EventArgs e)
370
375
RefreshMaximizeRestoreButton ( ) ;
371
376
}
372
377
378
+ private void SelectedPluginChanged ( object sender , SelectionChangedEventArgs e )
379
+ {
380
+ Plugins . ScrollIntoView ( Plugins . SelectedItem ) ;
381
+ }
382
+ private void ItemSizeChanged ( object sender , SizeChangedEventArgs e )
383
+ {
384
+ Plugins . ScrollIntoView ( Plugins . SelectedItem ) ;
385
+ }
373
386
}
374
- }
387
+ }
0 commit comments