Skip to content

Commit

Permalink
Add the new Tsunamods Theme and use it as fallback default
Browse files Browse the repository at this point in the history
  • Loading branch information
julianxhokaxhiu committed Feb 28, 2022
1 parent 59a5e8a commit ea7a609
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 6 deletions.
1 change: 1 addition & 0 deletions SeventhHeavenUI/Classes/Themes/ITheme.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public enum AppTheme
LightMode,
LightModeWithBackground,
Classic7H,
Tsunamods
}

public interface ITheme
Expand Down
3 changes: 3 additions & 0 deletions SeventhHeavenUI/Classes/Themes/ThemeSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public static ITheme GetThemeFromEnum(AppTheme appTheme)
case AppTheme.Custom:
return new ThemeSettings();

case AppTheme.Tsunamods:
return new TsunamodsTheme();

default:
return null;
}
Expand Down
91 changes: 91 additions & 0 deletions SeventhHeavenUI/Classes/Themes/TsunamodsTheme.cs

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions SeventhHeavenUI/Resources/SharedStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,18 @@

<Color x:Key="ClassicControlDisabledBackground">#FF696969</Color>
<Color x:Key="ClassicControlDisabledForeground">#FFCADCD3</Color>



<!-- COLORS - Tsunamods Theme -->
<Color x:Key="TsunamodsBackgroundColor">#FF181818</Color>
<Color x:Key="TsunamodsSecondaryBackgroundColor">#FF0C0C0C</Color>

<Color x:Key="TsunamodsControlBackground">#FF333333</Color>
<Color x:Key="TsunamodsControlForeground">#FFFFECDB</Color>
<Color x:Key="TsunamodsControlPressed">#FF78A7AF</Color>
<Color x:Key="TsunamodsControlMouseOver">#FF78A7AF</Color>

<Color x:Key="TsunamodsControlDisabledBackground">#FFFFECDB</Color>
<Color x:Key="TsunamodsControlDisabledForeground">#FFFFECDB</Color>

<!-- APP BRUSHES - These are used in all the below styles to have a consistent color theme across all controls. The color of these brushes can be changed in the "Color Theme" settings of the app -->
<Color x:Key="PrimaryControlMouseOverColor">#5e5e5e</Color>
Expand Down
1 change: 1 addition & 0 deletions SeventhHeavenUI/SeventhHeavenUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@
<Compile Include="Classes\Themes\DarkTheme.cs" />
<Compile Include="Classes\Themes\ITheme.cs" />
<Compile Include="Classes\Themes\ThemeSettings.cs" />
<Compile Include="Classes\Themes\TsunamodsTheme.cs" />
<Compile Include="Classes\UpdateChecker.cs" />
<Compile Include="Classes\GameDiscMounter.cs" />
<Compile Include="Classes\WCF\ServiceHost.cs" />
Expand Down
9 changes: 5 additions & 4 deletions SeventhHeavenUI/ViewModels/ThemeSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public Dictionary<string, AppTheme> DropDownOptionEnums
{
return new Dictionary<string, AppTheme>
{
{ "Tsunamods", AppTheme.Tsunamods },
{ "Dark Mode", AppTheme.DarkMode },
{ "Dark Mode w/ Background", AppTheme.DarkModeWithBackground },
{ "Light Mode", AppTheme.LightMode },
Expand Down Expand Up @@ -249,7 +250,7 @@ internal static void LoadThemeFromFile()
// dark theme w/ background will be applied as the default when theme.xml file does not exist
if (!File.Exists(pathToThemeFile))
{
new ThemeSettingsViewModel(loadThemeXml: false).ApplyBuiltInTheme(AppTheme.DarkModeWithBackground);
new ThemeSettingsViewModel(loadThemeXml: false).ApplyBuiltInTheme(AppTheme.Tsunamods);
return;
}

Expand All @@ -265,7 +266,7 @@ internal static ITheme GetThemeSettingsFromFile()

if (!File.Exists(pathToThemeFile))
{
return ThemeSettings.GetThemeFromEnum(AppTheme.DarkModeWithBackground);
return ThemeSettings.GetThemeFromEnum(AppTheme.Tsunamods);
}

try
Expand All @@ -276,7 +277,7 @@ internal static ITheme GetThemeSettingsFromFile()
catch (Exception e)
{
Logger.Error(e);
return ThemeSettings.GetThemeFromEnum(AppTheme.DarkModeWithBackground);
return ThemeSettings.GetThemeFromEnum(AppTheme.Tsunamods);
}
}

Expand Down Expand Up @@ -533,7 +534,7 @@ private void InitColorTextInput()

if (!File.Exists(pathToThemeFile))
{
savedTheme = ThemeSettings.GetThemeFromEnum(AppTheme.DarkModeWithBackground) as ThemeSettings;
savedTheme = ThemeSettings.GetThemeFromEnum(AppTheme.Tsunamods) as ThemeSettings;
}
else
{
Expand Down

0 comments on commit ea7a609

Please sign in to comment.