Archived
1
0

Dark theme, navigation

This commit is contained in:
Michael Gordeev
2018-08-10 20:50:52 +03:00
parent 6969af84a8
commit b712bfb74e
32 changed files with 359 additions and 418 deletions
+36 -8
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
@@ -39,6 +40,19 @@ namespace FoxTube.Pages.SettingsPages
safeSearch.SelectedIndex = (int)settings.Values["safeSearch"];
switch((int)settings.Values["themeMode"])
{
case 0:
light.IsChecked = true;
break;
case 1:
dark.IsChecked = true;
break;
case 2:
system.IsChecked = true;
break;
}
foreach (CultureInfo culture in CultureInfo.GetCultures(CultureTypes.AllCultures))
{
region.Items.Add(culture.DisplayName);
@@ -63,14 +77,9 @@ namespace FoxTube.Pages.SettingsPages
private void notification_IsEnabledChanged(object sender, RoutedEventArgs e)
{
if ((bool)settings.Values["newVideoNotification"] != newVideo.IsOn)
settings.Values["newVideoNotification"] = newVideo.IsOn;
if ((bool)settings.Values["moblieWarning"] != mobileWarning.IsOn)
settings.Values["moblieWarning"] = mobileWarning.IsOn;
if ((bool)settings.Values["videoAutoplay"] != autoplay.IsOn)
settings.Values["videoAutoplay"] = autoplay.IsOn;
settings.Values["newVideoNotification"] = newVideo.IsOn;
settings.Values["moblieWarning"] = mobileWarning.IsOn;
settings.Values["videoAutoplay"] = autoplay.IsOn;
}
private void region_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -82,5 +91,24 @@ namespace FoxTube.Pages.SettingsPages
{
settings.Values["safeSearch"] = safeSearch.SelectedIndex;
}
private void RadioButton_Checked(object sender, RoutedEventArgs e)
{
if (sender == light)
{
settings.Values["themeMode"] = 0;
Application.Current.RequestedTheme = ApplicationTheme.Light;
}
if (sender == dark)
{
settings.Values["themeMode"] = 1;
Application.Current.RequestedTheme = ApplicationTheme.Dark;
}
if (sender == system)
{
settings.Values["themeMode"] = 2;
Application.Current.RequestedTheme = ApplicationTheme.;
}
}
}
}