Skip to content

Commit

Permalink
add color theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasZJ committed Feb 10, 2020
1 parent 5c9d225 commit aa96114
Show file tree
Hide file tree
Showing 10 changed files with 268 additions and 30 deletions.
6 changes: 6 additions & 0 deletions Excel2Json/Excel2Json/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<setting name="TSRadioBtnChecked" serializeAs="String">
<value>False</value>
</setting>
<setting name="Color" serializeAs="String">
<value>DeepOrange</value>
</setting>
<setting name="Theme" serializeAs="String">
<value>Dark</value>
</setting>
</Excel2.Properties.Settings>
</userSettings>
</configuration>
10 changes: 5 additions & 5 deletions Excel2Json/Excel2Json/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>

<!-- MahApps -->
<!-- MahApps --><!--
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Buttons.xaml"/>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.Buttons.xaml"/>-->

<!--設定主題背景色-->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Dark.xaml" />
Expand All @@ -19,11 +19,11 @@
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.DeepOrange.xaml" />

<!-- Material Design: MahApps Compatibility -->
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Defaults.xaml"/>
<!--<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.Defaults.xaml"/>-->
</ResourceDictionary.MergedDictionaries>

<!-- MahApps Brushes -->
<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource Primary700}"/>
<!--<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource Primary700}"/>
<SolidColorBrush x:Key="AccentColorBrush" Color="{DynamicResource Primary500}"/>
<SolidColorBrush x:Key="AccentColorBrush2" Color="{DynamicResource Primary400}"/>
<SolidColorBrush x:Key="AccentColorBrush3" Color="{DynamicResource Primary300}"/>
Expand All @@ -33,7 +33,7 @@
<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource Primary700}"/>
<SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{DynamicResource Primary500Foreground}"/>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{DynamicResource Primary500Foreground}"/>
<SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{DynamicResource Primary500}" Opacity="0.4"/>
<SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{DynamicResource Primary500}" Opacity="0.4"/>-->
</ResourceDictionary>
</Application.Resources>
</Application>
4 changes: 4 additions & 0 deletions Excel2Json/Excel2Json/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,9 @@ namespace Excel2
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
}
}
}
8 changes: 7 additions & 1 deletion Excel2Json/Excel2Json/Excel2Json.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</Win32Resource>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\icon2.ico</ApplicationIcon>
<ApplicationIcon>Resources\icon3.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup />
Expand Down Expand Up @@ -218,5 +218,11 @@
<ItemGroup>
<Resource Include="Resources\icon2.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\icon3.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\icon4.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
96 changes: 87 additions & 9 deletions Excel2Json/Excel2Json/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,98 @@
<mahApps:MetroWindow x:Class="Excel2.MainWindow"
<Window x:Class="Excel2.MainWindow"
Icon="Resources/icon3.ico" Title="Excel 2 . . ."
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mahApps="http://metro.mahapps.com/winfx/xaml/controls" TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.FontWeight="Regular" TextElement.FontSize="13" TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{DynamicResource MaterialDesignFont}"
MinWidth="610" Width="1220" MinHeight="400" Height="860" WindowStartupLocation="CenterScreen">
TextElement.Foreground="{DynamicResource MaterialDesignBody}" TextElement.FontWeight="Regular" TextElement.FontSize="13" TextOptions.TextFormattingMode="Ideal" TextOptions.TextRenderingMode="Auto" Background="{DynamicResource MaterialDesignPaper}" FontFamily="{DynamicResource MaterialDesignFont}"
MinWidth="610" Width="1220" MinHeight="400" Height="860"
WindowStartupLocation="CenterScreen">

<Grid Loaded="Grid_Loaded">
<Grid>
<materialDesign:ColorZone Mode="PrimaryDark" Padding="11">
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Toolbox" Width="32" Height="32" />
<TextBlock FontSize="32" VerticalAlignment="Center" Margin="16 0 0 0">
<DockPanel>
<materialDesign:PopupBox DockPanel.Dock="Right" PlacementMode="BottomAndAlignRightEdges">
<ListBox >
<ListBoxItem x:Name="Light" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Light
</ListBoxItem>
<ListBoxItem x:Name="Dark" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Dark
</ListBoxItem>
<ListBoxItem Style="{StaticResource MaterialDesignListBoxItem}">

</ListBoxItem>
<ListBoxItem x:Name="Yellow" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Yellow
</ListBoxItem>
<ListBoxItem x:Name="Amber" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Amber
</ListBoxItem>
<ListBoxItem x:Name="DeepOrange" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
DeepOrange
</ListBoxItem>
<ListBoxItem x:Name="Lightblue" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Lightblue
</ListBoxItem>
<ListBoxItem x:Name="Teal" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Teal
</ListBoxItem>
<ListBoxItem x:Name="Cyan" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Cyan
</ListBoxItem>
<ListBoxItem x:Name="Pink" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Pink
</ListBoxItem>
<ListBoxItem x:Name="Green" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Green
</ListBoxItem>
<ListBoxItem x:Name="DeepPurple" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
DeepPurple
</ListBoxItem>
<ListBoxItem x:Name="Indigo" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Indigo
</ListBoxItem>
<ListBoxItem x:Name="LightGreen" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
LightGreen
</ListBoxItem>
<ListBoxItem x:Name="Blue" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Blue
</ListBoxItem>
<ListBoxItem x:Name="Lime" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Lime
</ListBoxItem>
<ListBoxItem x:Name="Red" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Red
</ListBoxItem>
<ListBoxItem x:Name="Orange" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Orange
</ListBoxItem>
<ListBoxItem x:Name="Purple" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Purple
</ListBoxItem>
<ListBoxItem x:Name="BlueGrey" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
BlueGrey
</ListBoxItem>
<ListBoxItem x:Name="Grey" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Grey
</ListBoxItem>
<ListBoxItem x:Name="Brown" MouseLeftButtonUp="ListBoxItem_MouseClick" Style="{StaticResource MaterialDesignListBoxItem}">
Brown
</ListBoxItem>
</ListBox>
</materialDesign:PopupBox>
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Toolbox" Width="32" Height="32" >
<materialDesign:PackIcon.Background>
<ImageBrush/>
</materialDesign:PackIcon.Background>
</materialDesign:PackIcon>
<TextBlock FontSize="32" VerticalAlignment="Center" Margin="16 0 0 0">
Excel to . . .
</TextBlock>
</StackPanel>
</TextBlock>
</StackPanel>
</DockPanel>
</materialDesign:ColorZone>
</Grid>
<Grid Margin="0,65,0,0">
Expand Down Expand Up @@ -74,4 +152,4 @@
</Grid>
</Grid>
</Grid>
</mahApps:MetroWindow>
</Window>
Loading

0 comments on commit aa96114

Please sign in to comment.