private void applyButton_Click(object sender, EventArgs e)
        {
            applyButton.Enabled = false;

            if (selectedIndex > 0)
            {
                ThemeManager.currentTheme = ThemeManager.themeSettings[selectedIndex - 1];
            }
            else
            {
                ThemeManager.currentTheme = null;
            }

            JsonConfig.settings.themeName = ThemeManager.currentTheme?.themeId;
            JsonConfig.settings.darkMode  = darkModeCheckbox.Checked;
            MainMenu.darkModeItem.Checked = JsonConfig.settings.darkMode;

            if (selectedIndex == 0)
            {
                WallpaperApi.SetWallpaper(windowsWallpaper);
            }
            else if (LocationManager.isReady)
            {
                AppContext.wpEngine.RunScheduler();
            }

            applyButton.Enabled = true;
        }
        private void applyButton_Click(object sender, EventArgs e)
        {
            applyButton.Enabled = false;

            if (selectedIndex > 0)
            {
                ThemeManager.currentTheme = ThemeManager.themeSettings[selectedIndex - 1];
            }
            else
            {
                ThemeManager.currentTheme = null;
            }

            JsonConfig.settings.themeName = ThemeManager.currentTheme?.themeId;

            if (selectedIndex == 0)
            {
                WallpaperApi.SetWallpaper(windowsWallpaper);
            }
            else
            {
                AppContext.wpEngine.RunScheduler();
            }

            applyButton.Enabled = true;
        }
        public override void SetWallpaper(string imageFilename)
        {
            string imagePath = Path.Combine(Directory.GetCurrentDirectory(), "themes",
                                            ThemeManager.currentTheme.themeId, imageFilename);

            WallpaperApi.SetWallpaper(imagePath);
        }
Beispiel #4
0
        private void ApplySelectedTheme()
        {
            if (selectedIndex > 0)
            {
                ThemeManager.currentTheme = ThemeManager.themeSettings[selectedIndex - 1];
            }
            else
            {
                ThemeManager.currentTheme = null;
            }

            JsonConfig.settings.themeName = ThemeManager.currentTheme?.themeId;

            if (selectedIndex == 0)
            {
                WallpaperApi.SetWallpaper(windowsWallpaper);
            }
            else
            {
                WallpaperShuffler.AddThemeToHistory(ThemeManager.currentTheme.themeId);
                AppContext.wpEngine.RunScheduler();
                AppContext.ShowPopup(string.Format(_("New theme applied: {0}"),
                                                   ThemeManager.GetThemeName(ThemeManager.currentTheme)));
            }
        }
        private void SetWallpaper(int imageId)
        {
            string imageFilename = ThemeManager.currentTheme.imageFilename.Replace("*",
                                                                                   imageId.ToString());
            string imagePath = Path.Combine(Directory.GetCurrentDirectory(), "images",
                                            imageFilename);

            WallpaperApi.SetWallpaper(imagePath);
            lastImageId = imageId;
        }
Beispiel #6
0
        private void SetWallpaper(int imageId)
        {
            string imageFilename = ThemeManager.currentTheme.imageFilename.Replace("*",
                                                                                   imageId.ToString());
            string imagePath = Path.Combine(Directory.GetCurrentDirectory(), "themes",
                                            ThemeManager.currentTheme.themeName, imageFilename);

            WallpaperApi.SetWallpaper(imagePath);

            if (UwpDesktop.IsRunningAsUwp() && JsonConfig.settings.changeLockScreen)
            {
                UwpHelper.SetLockScreenImage(imagePath);
            }

            lastImageId = imageId;
        }
Beispiel #7
0
        private void ApplySelectedTheme()
        {
            if (selectedIndex > 0)
            {
                ThemeManager.currentTheme = ThemeManager.themeSettings[selectedIndex - 1];
            }
            else
            {
                ThemeManager.currentTheme = null;
            }

            JsonConfig.settings.themeName = ThemeManager.currentTheme?.themeId;

            if (selectedIndex == 0)
            {
                WallpaperApi.SetWallpaper(windowsWallpaper);
            }
            else
            {
                AppContext.wpEngine.RunScheduler();
            }
        }
Beispiel #8
0
        private void okButton_Click(object sender, EventArgs e)
        {
            okButton.Enabled = false;

            string themeName = listView1.SelectedItems[0].Text.Replace(' ', '_');

            JsonConfig.settings.themeName = themeName;
            JsonConfig.settings.darkMode  = darkModeCheckbox.Checked;

            if (selectedIndex > 0)
            {
                ThemeManager.currentTheme = ThemeManager.themeSettings[selectedIndex - 1];
            }
            else
            {
                ThemeManager.currentTheme = null;
            }

            MainMenu.darkModeItem.Checked = JsonConfig.settings.darkMode;
            this.Hide();

            if (selectedIndex > 0)
            {
                AppContext.wcsService.LoadImageLists();

                if (LocationManager.isReady)
                {
                    AppContext.wcsService.RunScheduler();
                }
            }
            else
            {
                WallpaperApi.SetWallpaper(windowsWallpaper);
            }

            okButton.Enabled = true;
            this.Close();
        }
 public override void SetWallpaper(string imagePath)
 {
     WallpaperApi.SetWallpaper(imagePath);
 }