@@ -33,6 +33,7 @@ class MainWindow : Window
33
33
private static CheckBox s_transparentCheckbox ;
34
34
private static CheckBox s_acrylicCheckbox ;
35
35
private static DockPanel s_transparentPanel ;
36
+ private static Slider s_backgroundBlurIntensitySlider ;
36
37
37
38
public MainWindow ( object data )
38
39
{
@@ -97,7 +98,11 @@ void SetupBackground()
97
98
] ;
98
99
#if Windows
99
100
100
- Background = Brushes . Transparent ;
101
+ Background = UnityHubNativeNetApp . Config . acrylic
102
+ ? new SolidColorBrush (
103
+ ActualThemeVariant == Avalonia . Styling . ThemeVariant . Dark ? Colors . Black : Colors . White ,
104
+ 1 - UnityHubNativeNetApp . Config . blurIntensity )
105
+ : Brushes . Transparent ;
101
106
#endif
102
107
}
103
108
}
@@ -379,30 +384,72 @@ private static void ReloadEverything()
379
384
] ) . SetTooltip ( "Makes the window transparent. Uses Mica on Windows and the desktop's blur on Linux.\n Needs restart to take effect." ) ,
380
385
} . SetDock ( Dock . Top ) . AddItems
381
386
( [
382
- s_transparentPanel = new DockPanel
387
+ new SettingsExpanderItem
383
388
{
384
- IsEnabled = UnityHubNativeNetApp . Config . transparent ,
385
- LastChildFill = false ,
386
- } . AddChildren
387
- ( [
388
- new TextBlock
389
+ Content = s_transparentPanel = new DockPanel
389
390
{
390
- Text = "Acrilyc" ,
391
- VerticalAlignment = VerticalAlignment . Center ,
392
- } . SetTooltip ( "Use Acrylic blur. Only works on Windows.\n Needs restart to take effect." ) . SetDock ( Dock . Left ) ,
393
- s_acrylicCheckbox = new CheckBox
391
+ IsEnabled = UnityHubNativeNetApp . Config . transparent ,
392
+ LastChildFill = false ,
393
+ } . AddChildren
394
+ ( [
395
+ new DockPanel
396
+ {
397
+ LastChildFill = false
398
+ } . AddChildren
399
+ ( [
400
+ new TextBlock
401
+ {
402
+ Text = "Acrilyc" ,
403
+ VerticalAlignment = VerticalAlignment . Center ,
404
+ } . SetTooltip ( "Use Acrylic blur. Only works on Windows.\n Needs restart to take effect." ) . SetDock ( Dock . Left ) ,
405
+ s_acrylicCheckbox = new CheckBox
406
+ {
407
+ IsChecked = UnityHubNativeNetApp . Config . transparent ,
408
+ VerticalAlignment = VerticalAlignment . Center ,
409
+ } . OnCheckChanged ( OnAcrylicCheckboxChanged ) . SetDock ( Dock . Right ) ,
410
+ ] ) . SetDock ( Dock . Top ) ,
411
+ ] ) ,
412
+ } ,
413
+ new SettingsExpanderItem
414
+ {
415
+ Content = new DockPanel
394
416
{
395
- IsChecked = UnityHubNativeNetApp . Config . transparent ,
396
- VerticalAlignment = VerticalAlignment . Center ,
397
- } . OnCheckChanged ( OnAcrylicCheckboxChanged ) . SetDock ( Dock . Right )
398
- ] )
417
+ LastChildFill = false ,
418
+ IsEnabled = UnityHubNativeNetApp . Config . transparent && UnityHubNativeNetApp . Config . acrylic ,
419
+ } . AddChildren
420
+ ( [
421
+ new TextBlock
422
+ {
423
+ Text = "Background Blur Intensity" ,
424
+ VerticalAlignment = VerticalAlignment . Center ,
425
+ } . SetTooltip ( "Changes the intensity of the background blur." ) . SetDock ( Dock . Left ) ,
426
+ s_backgroundBlurIntensitySlider = new Slider
427
+ {
428
+ VerticalAlignment = VerticalAlignment . Center ,
429
+ Minimum = 0 ,
430
+ Maximum = 1 ,
431
+ Width = 100 ,
432
+ TickFrequency = 0.1 ,
433
+ TickPlacement = TickPlacement . BottomRight ,
434
+ IsSnapToTickEnabled = true ,
435
+ Value = UnityHubNativeNetApp . Config . blurIntensity
436
+ } . OnValueChanged ( OnAcrylicIntensitySliderValueChanged ) . SetDock ( Dock . Right )
437
+ ] ) . SetDock ( Dock . Top )
438
+ }
399
439
] )
400
440
] )
401
441
}
402
442
] )
403
443
] )
404
444
] ) ;
405
445
446
+ private static void OnAcrylicIntensitySliderValueChanged ( )
447
+ {
448
+ UnityHubNativeNetApp . Config . blurIntensity = ( float ) s_backgroundBlurIntensitySlider . Value ;
449
+ s_instance . SetupBackground ( ) ;
450
+ UnityHubNativeNetApp . SaveConfig ( UnityHubNativeNetApp . Config ) ;
451
+ }
452
+
406
453
private static void OnAcrylicCheckboxChanged ( )
407
454
{
408
455
UnityHubNativeNetApp . Config . acrylic = ! UnityHubNativeNetApp . Config . acrylic ;
0 commit comments