mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Fixed theming, this closes #51
This commit is contained in:
parent
dd5889ec3e
commit
ef6e6459f2
@ -15,7 +15,6 @@
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
|
||||
<!-- Accent and AppTheme setting -->
|
||||
<ResourceDictionary Source="pack://application:,,,/Styles/Accents/CorsairYellow.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Teal.xaml" />
|
||||
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
|
||||
<ResourceDictionary Source="/Resources/Icons.xaml" />
|
||||
|
||||
@ -10,11 +10,11 @@ namespace Artemis.Settings
|
||||
{
|
||||
public class GeneralSettings
|
||||
{
|
||||
private readonly Accent _artemisAccent = ThemeManager.GetAccent("Teal");
|
||||
private readonly Accent _corsairAccent = new Accent("CorsairYellow",
|
||||
new Uri("pack://application:,,,/Styles/Accents/CorsairYellow.xaml"));
|
||||
private readonly AppTheme _darkTheme = ThemeManager.GetAppTheme("BaseDark");
|
||||
private readonly AppTheme _lightTheme = ThemeManager.GetAppTheme("BaseLight");
|
||||
public GeneralSettings()
|
||||
{
|
||||
ThemeManager.AddAccent("CorsairYellow", new Uri("pack://application:,,,/Styles/Accents/CorsairYellow.xaml"));
|
||||
ApplyTheme();
|
||||
}
|
||||
|
||||
public int GamestatePort
|
||||
{
|
||||
@ -105,22 +105,25 @@ namespace Artemis.Settings
|
||||
ApplyGamestatePort();
|
||||
}
|
||||
|
||||
// TODO: http://visionarycoder.com/2015/01/06/setting-themeaccent-with-mahapps-metro/
|
||||
private void ApplyTheme()
|
||||
{
|
||||
switch (Theme)
|
||||
{
|
||||
case "Light":
|
||||
ThemeManager.ChangeAppStyle(Application.Current, _artemisAccent, _lightTheme);
|
||||
ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent("Teal"),
|
||||
ThemeManager.GetAppTheme("BaseLight"));
|
||||
break;
|
||||
case "Dark":
|
||||
ThemeManager.ChangeAppStyle(Application.Current, _artemisAccent, _darkTheme);
|
||||
ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent("Teal"),
|
||||
ThemeManager.GetAppTheme("BaseDark"));
|
||||
break;
|
||||
case "Corsair Light":
|
||||
ThemeManager.ChangeAppStyle(Application.Current, _corsairAccent, _lightTheme);
|
||||
ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent("CorsairYellow"),
|
||||
ThemeManager.GetAppTheme("BaseLight"));
|
||||
break;
|
||||
case "Corsair Dark":
|
||||
ThemeManager.ChangeAppStyle(Application.Current, _corsairAccent, _darkTheme);
|
||||
ThemeManager.ChangeAppStyle(Application.Current, ThemeManager.GetAccent("CorsairYellow"),
|
||||
ThemeManager.GetAppTheme("BaseDark"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,13 +8,13 @@
|
||||
|
||||
<Color x:Key="AccentBaseColor">#FFF0CF1E</Color>
|
||||
<!--80%-->
|
||||
<Color x:Key="AccentColor">#FFF0CF1E</Color>
|
||||
<Color x:Key="AccentColor">#CDF0CF1E</Color>
|
||||
<!--60%-->
|
||||
<Color x:Key="AccentColor2">#FFF0CF1E</Color>
|
||||
<Color x:Key="AccentColor2">#99F0CF1E</Color>
|
||||
<!--40%-->
|
||||
<Color x:Key="AccentColor3">#FFF0CF1E</Color>
|
||||
<Color x:Key="AccentColor3">#66F0CF1E</Color>
|
||||
<!--20%-->
|
||||
<Color x:Key="AccentColor4">#FFF0CF1E</Color>
|
||||
<Color x:Key="AccentColor4">#32F0CF1E</Color>
|
||||
|
||||
<!-- re-set brushes too -->
|
||||
<SolidColorBrush x:Key="HighlightBrush" Color="{StaticResource HighlightColor}" options:Freeze="True" />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user