From 4c2f5c05e5d564c1269a5c6b0bf7fd3471cdfe45 Mon Sep 17 00:00:00 2001 From: aj-rosado <109146700+aj-rosado@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:57:01 +0100 Subject: [PATCH] [PS-1188] Add new Solarized Dark Theme (#2141) * PS-1188 Add new Solarized Dark Theme --- .../Pages/Settings/OptionsPageViewModel.cs | 2 + src/App/Resources/AppResources.Designer.cs | 9 +++ src/App/Resources/AppResources.resx | 4 + src/App/Styles/SolarizedDark.xaml | 76 +++++++++++++++++++ src/App/Styles/SolarizedDark.xaml.cs | 12 +++ src/App/Utilities/ThemeManager.cs | 5 ++ 6 files changed, 108 insertions(+) create mode 100644 src/App/Styles/SolarizedDark.xaml create mode 100644 src/App/Styles/SolarizedDark.xaml.cs diff --git a/src/App/Pages/Settings/OptionsPageViewModel.cs b/src/App/Pages/Settings/OptionsPageViewModel.cs index 9a794c58c..2f952aff2 100644 --- a/src/App/Pages/Settings/OptionsPageViewModel.cs +++ b/src/App/Pages/Settings/OptionsPageViewModel.cs @@ -56,12 +56,14 @@ namespace Bit.App.Pages new KeyValuePair(ThemeManager.Dark, AppResources.Dark), new KeyValuePair(ThemeManager.Black, AppResources.Black), new KeyValuePair(ThemeManager.Nord, AppResources.Nord), + new KeyValuePair(ThemeManager.SolarizedDark, AppResources.SolarizedDark), }; AutoDarkThemeOptions = new List> { new KeyValuePair(ThemeManager.Dark, AppResources.Dark), new KeyValuePair(ThemeManager.Black, AppResources.Black), new KeyValuePair(ThemeManager.Nord, AppResources.Nord), + new KeyValuePair(ThemeManager.SolarizedDark, AppResources.SolarizedDark), }; UriMatchOptions = new List> { diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index 452967102..84ff963d6 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -5506,6 +5506,15 @@ namespace Bit.App.Resources { } } + /// + /// Looks up a localized string similar to Solarized Dark. + /// + public static string SolarizedDark { + get { + return ResourceManager.GetString("SolarizedDark", resourceCulture); + } + } + /// /// Looks up a localized string similar to Special characters (!@#$%^&*). /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 34122747e..a803ee150 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -1575,6 +1575,10 @@ Scanning will happen automatically. Nord 'Nord' is the name of a specific color scheme. It should not be translated. + + Solarized Dark + 'Solarized Dark' is the name of a specific color scheme. It should not be translated. + Auto-fill blocked URIs diff --git a/src/App/Styles/SolarizedDark.xaml b/src/App/Styles/SolarizedDark.xaml new file mode 100644 index 000000000..e8402a0d2 --- /dev/null +++ b/src/App/Styles/SolarizedDark.xaml @@ -0,0 +1,76 @@ + + + #eee8d5 + #859900 + #dc322f + #859900 + #859900 + #b58900 + #839496 + #2aa198 + #b58900 + #93a1a1 + #657b83 + #cb4b16 + + #002b36 + #073642 + #073642 + #839496 + #073642 + #859900 + + #073642 + #859900 + + #eee8d5 + #eee8d5 + #657b83 + + #073642 + #073642 + #073642 + #859900 + #073642 + + #eee8d5 + #073642 + #859900 + #073642 + + #859900 + #eee8d5 + + #657b83 + #eee8d5 + + #859900 + #667500 + #4d541c + #e5e9f0 + #ACB5C5 + + #657b83 + #3A4251 + #454951 + #073642 + #eee8d5 + #aaaaaa + #99eee8d5 + + #859900 + #859900 + + #073642 + #eee8d5 + #859900 + + #073642 + #eee8d5 + + #859900 + #F08DC7 + #80BDFF + diff --git a/src/App/Styles/SolarizedDark.xaml.cs b/src/App/Styles/SolarizedDark.xaml.cs new file mode 100644 index 000000000..a8dc19768 --- /dev/null +++ b/src/App/Styles/SolarizedDark.xaml.cs @@ -0,0 +1,12 @@ +using Xamarin.Forms; + +namespace Bit.App.Styles +{ + public partial class SolarizedDark : ResourceDictionary, IThemeResourceDictionary + { + public SolarizedDark() + { + InitializeComponent(); + } + } +} diff --git a/src/App/Utilities/ThemeManager.cs b/src/App/Utilities/ThemeManager.cs index d6a7285f4..65d2d2cfe 100644 --- a/src/App/Utilities/ThemeManager.cs +++ b/src/App/Utilities/ThemeManager.cs @@ -21,6 +21,7 @@ namespace Bit.App.Utilities public const string Dark = "dark"; public const string Black = "black"; public const string Nord = "nord"; + public const string SolarizedDark = "solarizeddark"; public static void SetThemeStyle(string name, string autoDarkName, ResourceDictionary resources) { @@ -102,6 +103,8 @@ namespace Bit.App.Utilities return CheckAndGetThemeForMergedDictionaries(typeof(Nord), resources); case Light: return CheckAndGetThemeForMergedDictionaries(typeof(Light), resources); + case SolarizedDark: + return CheckAndGetThemeForMergedDictionaries(typeof(SolarizedDark), resources); default: if (OsDarkModeEnabled()) { @@ -111,6 +114,8 @@ namespace Bit.App.Utilities return CheckAndGetThemeForMergedDictionaries(typeof(Black), resources); case Nord: return CheckAndGetThemeForMergedDictionaries(typeof(Nord), resources); + case SolarizedDark: + return CheckAndGetThemeForMergedDictionaries(typeof(SolarizedDark), resources); default: return CheckAndGetThemeForMergedDictionaries(typeof(Dark), resources); }