smol bug fixes

This commit is contained in:
Assistant 2020-02-17 22:21:21 -07:00
parent 7dd557e6c8
commit afebb611e3
9 changed files with 73 additions and 37 deletions

View file

@ -25,7 +25,6 @@
<ResourceDictionary x:Name="ListView_Style" Source="Styles/ListView.xaml"/>
<ResourceDictionary x:Name="ListViewItem_Style" Source="Styles/ListViewItem.xaml"/>
<ResourceDictionary x:Name="CheckBox_Style" Source="Styles/CheckBox.xaml"/>
<ResourceDictionary x:Name="Rectangle_Style" Source="Styles/Rectangle.xaml"/>
<ResourceDictionary x:Name="ComboBoxItem_Style" Source="Styles/ComboBoxItem.xaml"/>
<ResourceDictionary x:Name="ComboBox_Style" Source="Styles/ComboBox.xaml"/>
<ResourceDictionary x:Name="ToggleButton_Style" Source="Styles/ToggleButton.xaml"/>

View file

@ -7,6 +7,7 @@ using System.Windows.Media;
using ModAssistant.Pages;
using System.Reflection;
using Microsoft.Win32;
using System.Windows.Media.Imaging;
namespace ModAssistant
{
@ -65,11 +66,12 @@ namespace ModAssistant
/// <param name="savedTheme">Theme name retrieved from the settings file.</param>
public static void FirstLoad(string savedTheme)
{
if (savedTheme == "")
if (string.IsNullOrEmpty(savedTheme))
{
Themes.ApplyWindowsTheme();
return;
}
MessageBox.Show("gothere");
try
{
Themes.ApplyTheme(savedTheme, false);
@ -99,6 +101,7 @@ namespace ModAssistant
{
MainWindow.Instance.MainText = string.Format((string)Application.Current.FindResource("Themes:ThemeSet"), theme);
}
LoadWaifu(theme);
ReloadIcons();
}
else
@ -196,6 +199,24 @@ namespace ModAssistant
return dictionary;
}
private static void LoadWaifu(string name)
{
string location = Path.Combine(Environment.CurrentDirectory, "Themes");
BitmapImage background = null;
BitmapImage sidebar = null;
if (File.Exists(Path.Combine(location, name + ".png")))
{
background = new BitmapImage(new Uri(Path.Combine(location, name + ".png")));
}
if (File.Exists(Path.Combine(location, name + ".side.png")))
{
sidebar = new BitmapImage(new Uri(Path.Combine(location, name + ".side.png")));
}
MainWindow.Instance.BackgroundImage.ImageSource = background;
MainWindow.Instance.SideImage.ImageSource = sidebar;
}
/// <summary>
/// Reload the icon colors for the About, Info, Options, and Mods buttons from the currently loaded theme.
/// </summary>

View file

@ -9,7 +9,17 @@
Title="{DynamicResource MainWindow:WindowTitle}" Width="1280" Height="720"
UIElement.PreviewMouseDown="Window_PreviewMouseDown">
<Grid>
<Rectangle/>
<Rectangle Fill="{DynamicResource ModAssistantBackground}"/>
<Rectangle>
<Rectangle.Fill>
<ImageBrush x:Name="BackgroundImage" Stretch="{DynamicResource BackgroundImageStretch}"/>
</Rectangle.Fill>
</Rectangle>
<Rectangle>
<Rectangle.Fill>
<ImageBrush x:Name="SideImage" Stretch="None" AlignmentX="Left" AlignmentY="{DynamicResource SideImageYPosition}"/>
</Rectangle.Fill>
</Rectangle>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
@ -73,7 +83,7 @@
<TextBlock Name="VersionText" HorizontalAlignment="Center" />
</StackPanel>
<Frame Grid.Column="1" Name="Main" NavigationUIVisibility="Hidden" />
<Frame Grid.Column="1" Name="Main" NavigationUIVisibility="Hidden" Background="{DynamicResource FrameBackgroundColor}" />
<Grid Grid.Row="1" Grid.Column="1" >
<Grid.ColumnDefinitions>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
@ -169,10 +169,6 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\Rectangle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\TextBlock.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -231,4 +227,4 @@
<Resource Include="Resources\icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
</Project>

View file

@ -1,5 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Style TargetType="Rectangle">
<Setter Property="Fill" Value="{DynamicResource ModAssistantBackground}"/>
</Style>
</ResourceDictionary>

View file

@ -61,6 +61,7 @@
<!-- Various important elements that need to be controlled independently -->
<SolidColorBrush x:Key="ModAssistantBackground" Color="{DynamicResource ResourceKey=StandardSecondary}" />
<SolidColorBrush x:Key="FrameBackgroundColor" Color="#CC0F0F0F"/>
<SolidColorBrush x:Key="BottomStatusBarBackground" Color="{DynamicResource ResourceKey=StandardPrimary}" />
<SolidColorBrush x:Key="BottomStatusBarOutline" Color="{DynamicResource ResourceKey=StandardBorder}" />
<SolidColorBrush x:Key="DirectoryBackground" Color="{DynamicResource ResourceKey=StandardPrimary}" />
@ -72,4 +73,8 @@
<SolidColorBrush x:Key="AboutIconColor" Color="{DynamicResource ResourceKey=StandardIcon}" />
<SolidColorBrush x:Key="OptionsIconColor" Color="{DynamicResource ResourceKey=StandardIcon}" />
<!--Background and Side image settings.-->
<Stretch x:Key="BackGroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top -->
</ResourceDictionary>

View file

@ -3,11 +3,11 @@
<!-- ModAssistant Light Pink Theme by Caeden117 -->
<!--Default text-->
<!-- Default text -->
<SolidColorBrush x:Key="TextColor" Color="#101010" />
<SolidColorBrush x:Key="TextHighlighted" Color="Black" />
<!--Buttons (Info/Mods/About/Options as well as More Info and Install/Update)-->
<!-- Buttons (Info/Mods/About/Options as well as More Info and Install/Update) -->
<SolidColorBrush x:Key="ButtonBackground" Color="#FFE5A3EC" />
<SolidColorBrush x:Key="ButtonOutline" Color="#FF640052" />
<SolidColorBrush x:Key="ButtonHighlightedBackground" Color="#FFFF84EE" />
@ -22,7 +22,7 @@
<SolidColorBrush x:Key="PageButtonClickedBackground" Color="Magenta" />
<SolidColorBrush x:Key="PageButtonDisabledBackground" Color="#FFD477C8" />
<!--Mod List-->
<!-- Mod List -->
<SolidColorBrush x:Key="ModColumnBackground" Color="#FFFFC1F4"/>
<SolidColorBrush x:Key="ModColumnBorderBrush" Color="Gray"/>
<SolidColorBrush x:Key="ModColumnHeaderHighlighted" Color="#FFFF86FF"/>
@ -30,7 +30,7 @@
<SolidColorBrush x:Key="ModListItemHighlighted" Color="#FFF8B6FF"/>
<SolidColorBrush x:Key="ModListItemSelected" Color="#FFFF88F4"/>
<!--Combo Box (Version select)-->
<!-- Combo Box (Version select) -->
<SolidColorBrush x:Key="ComboBoxBackground" Color="#FFE09EE0"/>
<SolidColorBrush x:Key="ComboBoxOutline" Color="#FF5D0048"/>
<SolidColorBrush x:Key="ComboBoxHighlighted" Color="#FF814D83"/>
@ -38,7 +38,7 @@
<SolidColorBrush x:Key="ComboBoxClicked" Color="#FFFF63EA"/>
<SolidColorBrush x:Key="ComboBoxArrow" Color="Black"/>
<!--Checkboxes (Mod List and Options)-->
<!-- Checkboxes (Mod List and Options) -->
<SolidColorBrush x:Key="CheckboxDefaultBackground" Color="#FFAD55B6"/>
<SolidColorBrush x:Key="CheckboxDefaultOutlineColor" Color="#FFD664D1"/>
<SolidColorBrush x:Key="CheckboxDisabledBackground" Color="#FF8C4693"/>
@ -49,19 +49,20 @@
<SolidColorBrush x:Key="CheckboxTickColor" Color="White"/>
<SolidColorBrush x:Key="CheckboxPressedBackground" Color="#FFFF80FF"/>
<!--Various important elements that need to be controlled independently-->
<!-- Various important elements that need to be controlled independently -->
<SolidColorBrush x:Key="ModAssistantBackground" Color="#FFFAE5FF"/>
<SolidColorBrush x:Key="FrameBackgroundColor" Color="#CCFAE5FF"/>
<SolidColorBrush x:Key="BottomStatusBarBackground" Color="#FFE288D6"/>
<SolidColorBrush x:Key="DirectoryBackground" Color="#FFE288D6"/>
<!--Colors for the corresponding icons.-->
<!--Info Default: #0DCAC8-->
<!-- Colors for the corresponding icons. -->
<SolidColorBrush x:Key="InfoIconColor" Color="White"/>
<!--Mods Default: #833BCE-->
<SolidColorBrush x:Key="ModsIconColor" Color="White"/>
<!--About Default: #FF0000-->
<SolidColorBrush x:Key="AboutIconColor" Color="White"/>
<!--Options Default: #4E3BCE-->
<SolidColorBrush x:Key="OptionsIconColor" Color="White"/>
<!-- Background and Side image settings. -->
<Stretch x:Key="BackGroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top -->
</ResourceDictionary>

View file

@ -60,6 +60,7 @@
<!-- Various important elements that need to be controlled independently -->
<SolidColorBrush x:Key="ModAssistantBackground" Color="{DynamicResource ResourceKey=StandardSecondary}" />
<SolidColorBrush x:Key="FrameBackgroundColor" Color="#CCF3F3F3"/>
<SolidColorBrush x:Key="BottomStatusBarBackground" Color="{DynamicResource ResourceKey=StandardPrimary}" />
<SolidColorBrush x:Key="BottomStatusBarOutline" Color="{DynamicResource ResourceKey=StandardBorder}" />
<SolidColorBrush x:Key="DirectoryBackground" Color="{DynamicResource ResourceKey=StandardPrimary}" />
@ -71,4 +72,8 @@
<SolidColorBrush x:Key="AboutIconColor" Color="#FF0000" />
<SolidColorBrush x:Key="OptionsIconColor" Color="#4E3BCE" />
<!--Background and Side image settings.-->
<Stretch x:Key="BackGroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top -->
</ResourceDictionary>

View file

@ -27,11 +27,11 @@
<Color x:Key="StandardActive">#CA85B1</Color>
<Color x:Key="StandardIcon">#FF51B6</Color>
<!--Default text-->
<!-- Default text -->
<SolidColorBrush x:Key="TextColor" Color="{StaticResource ResourceKey=StandardContent}" />
<SolidColorBrush x:Key="TextHighlighted" Color="Black" />
<!--Buttons (Info/Mods/About/Options as well as More Info and Install/Update)-->
<!-- Buttons (Info/Mods/About/Options as well as More Info and Install/Update) -->
<SolidColorBrush x:Key="ButtonBackground" Color="{DynamicResource ResourceKey=StandardPrimary}" />
<SolidColorBrush x:Key="ButtonOutline" Color="{DynamicResource ResourceKey=StandardBorder}" />
<SolidColorBrush x:Key="ButtonHighlightedBackground" Color="{DynamicResource ResourceKey=StandardHighlight}" />
@ -46,7 +46,7 @@
<SolidColorBrush x:Key="PageButtonClickedBackground" Color="{DynamicResource ResourceKey=StandardActive}" />
<SolidColorBrush x:Key="PageButtonDisabledBackground" Color="{DynamicResource ResourceKey=StandardSecondary}" />
<!--Mod List-->
<!-- Mod List -->
<SolidColorBrush x:Key="ModColumnBackground" Color="{DynamicResource ResourceKey=StandardPrimary}"/>
<SolidColorBrush x:Key="ModColumnBorderBrush" Color="{DynamicResource ResourceKey=StandardPrimary}"/>
<SolidColorBrush x:Key="ModColumnHeaderHighlighted" Color="{DynamicResource ResourceKey=StandardHighlight}"/>
@ -54,7 +54,7 @@
<SolidColorBrush x:Key="ModListItemHighlighted" Color="{DynamicResource ResourceKey=StandardHighlight}"/>
<SolidColorBrush x:Key="ModListItemSelected" Color="{DynamicResource ResourceKey=StandardActive}"/>
<!--Combo Box (Version select)-->
<!-- Combo Box (Version select) -->
<SolidColorBrush x:Key="ComboBoxBackground" Color="{DynamicResource ResourceKey=StandardPrimary}"/>
<SolidColorBrush x:Key="ComboBoxOutline" Color="{DynamicResource ResourceKey=StandardBorder}"/>
<SolidColorBrush x:Key="ComboBoxHighlighted" Color="{DynamicResource ResourceKey=StandardHighlight}"/>
@ -62,7 +62,7 @@
<SolidColorBrush x:Key="ComboBoxClicked" Color="{DynamicResource ResourceKey=StandardPrimary}"/>
<SolidColorBrush x:Key="ComboBoxArrow" Color="{DynamicResource ResourceKey=StandardBorder}"/>
<!--Checkboxes (Mod List and Options)-->
<!-- Checkboxes (Mod List and Options) -->
<SolidColorBrush x:Key="CheckboxDefaultBackground" Color="{DynamicResource ResourceKey=StandardPrimary}"/>
<SolidColorBrush x:Key="CheckboxDefaultOutlineColor" Color="{DynamicResource ResourceKey=StandardBorder}"/>
<SolidColorBrush x:Key="CheckboxDisabledBackground" Color="{DynamicResource ResourceKey=StandardSecondary}"/>
@ -73,19 +73,23 @@
<SolidColorBrush x:Key="CheckboxTickColor" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<SolidColorBrush x:Key="CheckboxPressedBackground" Color="{DynamicResource ResourceKey=StandardActive}"/>
<!--Various important elements that need to be controlled independently-->
<!-- Various important elements that need to be controlled independently -->
<SolidColorBrush x:Key="ModAssistantBackground" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<SolidColorBrush x:Key="FrameBackgroundColor" Color="#CCFF51B6"/>
<SolidColorBrush x:Key="BottomStatusBarBackground" Color="#BF489A"/>
<SolidColorBrush x:Key="DirectoryBackground" Color="#BF489A"/>
<!--Colors for the corresponding icons.-->
<!--Info Default: #0DCAC8-->
<!-- Colors for the corresponding icons. -->
<!-- Info Default: #0DCAC8 -->
<SolidColorBrush x:Key="InfoIconColor" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<!--Mods Default: #833BCE-->
<!-- Mods Default: #833BCE -->
<SolidColorBrush x:Key="ModsIconColor" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<!--About Default: #FF0000-->
<!-- About Default: #FF0000 -->
<SolidColorBrush x:Key="AboutIconColor" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<!--Options Default: #4E3BCE-->
<!-- Options Default: #4E3BCE -->
<SolidColorBrush x:Key="OptionsIconColor" Color="{DynamicResource ResourceKey=StandardIcon}"/>
<Stretch x:Key="BackgroundImageStretch">UniformToFill</Stretch> <!-- Fill, None, Uniform, UniformToFill -->
<AlignmentY x:Key="SideImageYPosition">Bottom</AlignmentY> <!-- Bottom, Center, Top -->
</ResourceDictionary>