@@ -33,6 +33,7 @@ class MainWindow : Window
3333 private static CheckBox s_transparentCheckbox ;
3434 private static CheckBox s_acrylicCheckbox ;
3535 private static DockPanel s_transparentPanel ;
36+ private static Slider s_backgroundBlurIntensitySlider ;
3637
3738 public MainWindow ( object data )
3839 {
@@ -97,7 +98,11 @@ void SetupBackground()
9798 ] ;
9899#if Windows
99100
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 ;
101106#endif
102107 }
103108 }
@@ -379,30 +384,72 @@ private static void ReloadEverything()
379384 ] ) . SetTooltip ( "Makes the window transparent. Uses Mica on Windows and the desktop's blur on Linux.\n Needs restart to take effect." ) ,
380385 } . SetDock ( Dock . Top ) . AddItems
381386 ( [
382- s_transparentPanel = new DockPanel
387+ new SettingsExpanderItem
383388 {
384- IsEnabled = UnityHubNativeNetApp . Config . transparent ,
385- LastChildFill = false ,
386- } . AddChildren
387- ( [
388- new TextBlock
389+ Content = s_transparentPanel = new DockPanel
389390 {
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
394416 {
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+ }
399439 ] )
400440 ] )
401441 }
402442 ] )
403443 ] )
404444 ] ) ;
405445
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+
406453 private static void OnAcrylicCheckboxChanged ( )
407454 {
408455 UnityHubNativeNetApp . Config . acrylic = ! UnityHubNativeNetApp . Config . acrylic ;
0 commit comments