Beispiel #1
0
 public static void SetWindowFluent(this Window window, Settings settings)
 {
     try
     {
         var disc = RuntimeInformation.OSDescription;
         if (!disc.Contains("Windows", StringComparison.OrdinalIgnoreCase))
         {
             return;
         }
         var ver     = disc.Split(' ')[2];
         var version = Version.Parse(ver);
         if (version.Major < 10)
         {
             return;
         }
         AcrylicWindow.SetEnabled(window, true);
         AcrylicWindow.SetAcrylicWindowStyle(window, AcrylicWindowStyle.NoIcon);
         AcrylicWindow.SetAcrylicAccentState(window, settings.IsEnableAcrylicStyle ? AcrylicAccentState.Default : AcrylicAccentState.Disabled);
         settings.PropertyChanged += (_, args) =>
         {
             if (args.PropertyName == nameof(Settings.IsEnableAcrylicStyle))
             {
                 AcrylicWindow.SetAcrylicAccentState(window, settings.IsEnableAcrylicStyle ? AcrylicAccentState.Default : AcrylicAccentState.Disabled);
             }
         };
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Beispiel #2
0
        public MainWindow()
        {
            AcrylicWindow.SetEnabled(this, true);
            AcrylicWindow.SetTintColor(this, (Color)ColorConverter.ConvertFromString("#FFF7F7F7"));
            AcrylicWindow.SetFallbackColor(this, (Color)ColorConverter.ConvertFromString("#FFF7F7F7"));
            AcrylicWindow.SetTintOpacity(this, 1);
            AcrylicWindow.SetNoiseOpacity(this, 0.001);

            InitializeComponent();
        }
Beispiel #3
0
        public void LoadSettings()
        {
            SettingsController.LoadSettings();
            IniData data = SettingsController.GetCurrentSettings();

            if (data["Hotkeys"]["HotkeysEnable"] == "1")
            {
                SetHotkeysByStrings(data["Hotkeys"]["HotkeyUp"], data["Hotkeys"]["HotkeyDown"]);
            }

            if (data["Misc"]["Blur"] == "1" && Environment.OSVersion.Version.Major == 10)
            {
                Background = null;
                AcrylicWindow.SetEnabled(this, true);
            }

            UpdateCheckTimer.Tick += (sender, e) =>
            {
                CheckForUpdates(false);
            };

            if (data["Updates"]["DisableCheckEveryDay"] != "1")
            {
                UpdateCheckTimer.Start();
            }

            if (data["Updates"]["DisableCheckOnStartup"] != "1")
            {
                CheckForUpdates(false);
            }

            //AutoBrightness
            if (data["AutoBrightness"]["Enabled"] == "1")
            {
                CheckForSunriset.Start();
            }

            SetupAutoBrightnessTimer();

            TrayIcon.TrayBalloonTipClicked += (senderB, eB) => new Update().Window_Loaded();
        }
 private void StyleCheckBox_Checked(object sender, RoutedEventArgs e)
 {
     AcrylicWindow.SetEnabled(this, false);             // Doesn't work? :(
 }