Esempio n. 1
0
 public void LoadSettings()
 {
     Top    = Settings.Default.Top;
     Left   = Settings.Default.Left;
     Height = Settings.Default.Height;
     Width  = Settings.Default.Width;
     if (Settings.Default.Maximized)
     {
         WindowState = WindowState.Maximized;
     }
     if (Settings.Default.theme.ToString() == "Dark")
     {
         ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Dark);
     }
     else if (Settings.Default.theme.ToString() == "Light")
     {
         ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Light);
     }
     if (Settings.Default.primary.ToString() != "")
     {
         new PaletteHelper().ReplacePrimaryColor(Settings.Default.primary.ToString());
     }
     if (Settings.Default.accent.ToString() != "")
     {
         new PaletteHelper().ReplaceAccentColor(Settings.Default.accent.ToString());
     }
 }
Esempio n. 2
0
        public LoadingProgress()
        {
            var converter = new BrushConverter();
            var white     = (Brush)converter.ConvertFromString("#FFFFFF");
            var black     = (Brush)converter.ConvertFromString("#000000");

            InitializeComponent();
            if (Settings.Default.theme.ToString() == "Dark")
            {
                ThemeAssist.SetTheme(this, BaseTheme.Dark);
                NumberLeft.Foreground = white;
            }
            else if (Settings.Default.theme.ToString() == "Light")
            {
                ThemeAssist.SetTheme(this, BaseTheme.Light);
                NumberLeft.Foreground = black;
            }
            try
            {
                ld.ProgressGrid.Height = (Application.Current.MainWindow).ActualHeight * 0.9;
                ld.ProgressGrid.Width  = (Application.Current.MainWindow).ActualWidth * 0.9;
                ld.ProgressBar.Height  = (Application.Current.MainWindow).ActualHeight * 0.6;
                ld.ProgressBar.Width   = (Application.Current.MainWindow).ActualWidth * 0.6;
            }
            catch { }
        }
Esempio n. 3
0
        //// Footer Event Handlers ////

        private void ToggleThemeButton_Click(object sender, RoutedEventArgs e)
        {
            var mode = _isLight ? BaseTheme.Dark : BaseTheme.Light;

            ThemeAssist.SetTheme(this, mode);
            _isLight ^= true;
            OutputRichTextBox.ClearFormatting();
        }
 public AddGames()
 {
     InitializeComponent();
     if (Settings.Default.theme.ToString() == "Dark")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Dark);
     }
     else if (Settings.Default.theme.ToString() == "Light")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Light);
     }
 }
Esempio n. 5
0
 public EditGames()
 {
     InitializeComponent();
     if (Settings.Default.theme.ToString() == "Dark")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Dark);
     }
     else if (Settings.Default.theme.ToString() == "Light")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Light);
     }
     installPath = installPath.Replace("\\", "/");
 }
Esempio n. 6
0
 //Load settings
 public void LoadSettings()
 {
     //Theme Light or Dark
     if (Settings.Default.theme.ToString() == "Dark")
     {
         ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Dark);
     }
     else if (Settings.Default.theme.ToString() == "Light")
     {
         ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Light);
     }
     if (Settings.Default.primary.ToString() != "")
     {
         new PaletteHelper().ReplacePrimaryColor(Settings.Default.primary.ToString());
     }
     if (Settings.Default.accent.ToString() != "")
     {
         new PaletteHelper().ReplaceAccentColor(Settings.Default.accent.ToString());
     }
 }
Esempio n. 7
0
 public Loading()
 {
     InitializeComponent();
     if (Settings.Default.theme.ToString() == "Dark")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Dark);
     }
     else if (Settings.Default.theme.ToString() == "Light")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Light);
     }
     try
     {
         ld.ProgressGrid.Height   = (Application.Current.MainWindow).ActualHeight * 0.9;
         ld.ProgressGrid.Width    = (Application.Current.MainWindow).ActualWidth * 0.9;
         ld.LoadingSpinner.Height = (Application.Current.MainWindow).ActualHeight * 0.6;
         ld.LoadingSpinner.Width  = (Application.Current.MainWindow).ActualWidth * 0.6;
     }
     catch { }
 }
Esempio n. 8
0
 public ExeSelection()
 {
     exebw = new BackgroundWorker
     {
         WorkerReportsProgress = true
     };
     exebw.ProgressChanged    += ExeBWProgressChanged;
     exebw.DoWork             += ExeBWDoWork;
     exebw.RunWorkerCompleted += ExeBWRunWorkerCompleted;
     es = this;
     InitializeComponent();
     if (Settings.Default.theme.ToString() == "Dark")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Dark);
     }
     else if (Settings.Default.theme.ToString() == "Light")
     {
         ThemeAssist.SetTheme(this, BaseTheme.Light);
     }
 }
Esempio n. 9
0
        public ImageDownload(string gametitle, string searchstring, string imagetype)
        {
            id = this;
            int offset = 0;

            ImageType = imagetype;
            PosterViewModel pvm = new PosterViewModel();

            pvm.LoadSearch(gametitle, imagetype, searchstring, offset);
            InitializeComponent();
            if (Settings.Default.theme.ToString() == "Dark")
            {
                ThemeAssist.SetTheme(this, BaseTheme.Dark);
            }
            else if (Settings.Default.theme.ToString() == "Light")
            {
                ThemeAssist.SetTheme(this, BaseTheme.Light);
            }
            DownloadGrid.Height = ((MainWindow)Application.Current.MainWindow).ActualHeight * 0.8;
            DownloadGrid.Width  = ((MainWindow)Application.Current.MainWindow).ActualWidth * 0.8;
            windowTitle.Text    = searchstring.ToUpperInvariant();
        }
Esempio n. 10
0
        public void LoadSettings()
        {
            Regex  regexColourCode8 = new Regex("^#[a-fA-F0-9]{8}$");
            Regex  regexColourCode6 = new Regex("^#[a-fA-F0-9]{6}$");
            string launcher         = Settings.Default.launchercolour;
            string genre            = Settings.Default.genrecolour;
            string titles           = Settings.Default.gametitles;
            string banner           = Settings.Default.bannertitles;
            string list             = Settings.Default.listtitles;

            try
            {
                if (regexColourCode6.IsMatch(launcher) || regexColourCode8.IsMatch(launcher))
                {
                }
                else
                {
                    Settings.Default.launchercolour = "#3369e8";
                }
            }
            catch (Exception e) { Trace.WriteLine("Error: " + e); }
            try
            {
                if (regexColourCode6.IsMatch(genre) || regexColourCode8.IsMatch(genre))
                {
                    var converter = new BrushConverter();
                    AllGenreBtn.Foreground = (Brush)converter.ConvertFromString(genre);
                }
                else
                {
                    Settings.Default.genrecolour = "#3369e8";
                    genre = "#3369e8";
                    var converter = new BrushConverter();
                    AllGenreBtn.Foreground = (Brush)converter.ConvertFromString(genre);
                }
            }
            catch (Exception e) { Trace.WriteLine("Error: " + e); }
            try
            {
                if (regexColourCode6.IsMatch(titles) || regexColourCode8.IsMatch(titles))
                {
                }
                else
                {
                    Settings.Default.gametitles = "#3369e8";
                }
            }
            catch (Exception e) { Trace.WriteLine("Error: " + e); }
            try
            {
                if (regexColourCode6.IsMatch(banner) || regexColourCode8.IsMatch(banner))
                {
                }
                else
                {
                    Settings.Default.bannertitles = "#3369e8";
                }
            }
            catch (Exception e) { Trace.WriteLine("Error: " + e); }
            try
            {
                if (regexColourCode6.IsMatch(list) || regexColourCode8.IsMatch(list))
                {
                }
                else
                {
                    Settings.Default.listtitles = "#3369e8";
                }
            }
            catch (Exception e) { Trace.WriteLine("Error: " + e); }
            Top    = Settings.Default.Top;
            Left   = Settings.Default.Left;
            Height = Settings.Default.Height;
            Width  = Settings.Default.Width;
            if (Settings.Default.Maximized)
            {
                WindowState = WindowState.Maximized;
            }
            if (Settings.Default.autotheme != true)
            {
                if (Settings.Default.theme.ToString() == "Dark")
                {
                    ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Dark);
                }
                else if (Settings.Default.theme.ToString() == "Light")
                {
                    ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Light);
                }
            }
            if (Settings.Default.primary.ToString() != "")
            {
                new PaletteHelper().ReplacePrimaryColor(Settings.Default.primary.ToString());
            }
            if (Settings.Default.accent.ToString() != "")
            {
                new PaletteHelper().ReplaceAccentColor(Settings.Default.accent.ToString());
            }
            if (Settings.Default.fabcolour == "primary")
            {
                AddGameButton.Style = Application.Current.Resources["MaterialDesignFloatingActionButton"] as Style;
            }
            if (Settings.Default.fabcolour == "accent")
            {
                AddGameButton.Style = Application.Current.Resources["MaterialDesignFloatingActionAccentButton"] as Style;
            }
            UpdateLauncherButtons();
        }
Esempio n. 11
0
 private void DarkModeToggle_Unchecked(object sender, RoutedEventArgs e)
 {
     ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Light);
     Settings.Default.theme = "Light";
     SaveSettings();
 }
Esempio n. 12
0
 private void DarkModeToggle_Checked(object sender, RoutedEventArgs e)
 {
     ThemeAssist.SetTheme(Application.Current.MainWindow, BaseTheme.Dark);
     Properties.Settings.Default.theme = "Dark";
     SaveSettings();
 }