Skip to content

Commit

Permalink
NightMode
Browse files Browse the repository at this point in the history
  • Loading branch information
chenguanzhou committed Mar 11, 2016
1 parent bbc6bff commit d1c568d
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 55 deletions.
35 changes: 22 additions & 13 deletions MarkDownEditor.Setup/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define MarkDownEditor_TargetDir=$(var.MarkDownEditor.TargetDir)?>
<Product Id="{A4B884BE-8586-482E-B6EC-3D5D0C044F69}" Name="MarkDownEditor" Language="1033" Version="0.3.4" Manufacturer="Chen Guanzhou" UpgradeCode="5d30c639-0761-41c7-b4ef-e0c1b75eeb3f">
<Package Id="{DB810BE5-1D7F-4B23-9E5A-C712058C6CAD}" InstallerVersion="405" Compressed="yes" InstallScope="perMachine"/>
<Product Id="{EC0950BB-ADC2-4C2C-8202-301132B9D7DF}" Name="MarkDownEditor" Language="1033" Version="0.3.5" Manufacturer="Chen Guanzhou" UpgradeCode="5d30c639-0761-41c7-b4ef-e0c1b75eeb3f">
<Package Id="{DC6CD43F-21AC-4ABB-B424-3D56E7D59A84}" InstallerVersion="405" Compressed="yes" InstallScope="perMachine"/>

<MajorUpgrade Schedule="afterInstallInitialize"
DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit."/>
Expand All @@ -13,7 +13,8 @@
<Feature Id="ProductFeature" Title="MarkDownEditor" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentGroupRef Id="ZH_CN_Components" />
<ComponentGroupRef Id="CSS_Components" />
<ComponentGroupRef Id="Dark_CSS_Components" />
<ComponentGroupRef Id="Light_CSS_Components" />
<ComponentRef Id="RegistryFileAssociation" />
<ComponentRef Id="ApplicationShortcut" />
<ComponentRef Id="DesktopFolderShortcut" />
Expand Down Expand Up @@ -53,7 +54,10 @@
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="MarkDownEditor">
<Directory Id="ZH_CN_FOLDER" Name="zh-CN"></Directory>
<Directory Id="CSS_FOLDER" Name="CSS"></Directory>
<Directory Id="CSS_FOLDER" Name="css">
<Directory Id="LIGHT_CSS_FOLDER" Name="Light"/>
<Directory Id="DARK_CSS_FOLDER" Name="Dark"/>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
Expand Down Expand Up @@ -164,15 +168,20 @@
<File Id="MarkDownEditor.resources.dll" Name="MarkDownEditor.resources.dll" Source="$(var.MarkDownEditor_TargetDir)zh-CN/MarkDownEditor.resources.dll" />
</Component>
</ComponentGroup>
<ComponentGroup Id="CSS_Components" Directory="CSS_FOLDER">
<Component Id="CSS_Component" Guid="{B00E1CEA-71FF-47E1-B305-2932597522BE}">
<File Id="Air.css" Name="Air.css" Source="$(var.MarkDownEditor_TargetDir)css/Air.css" />
<File Id="Default.css" Name="Default.css" Source="$(var.MarkDownEditor_TargetDir)css/Default.css" />
<File Id="Github_andyferra.css" Name="Github_andyferra.css" Source="$(var.MarkDownEditor_TargetDir)css/Github_andyferra.css" />
<File Id="Modest.css" Name="Modest.css" Source="$(var.MarkDownEditor_TargetDir)css/Modest.css" />
<File Id="Retro.css" Name="Retro.css" Source="$(var.MarkDownEditor_TargetDir)css/Retro.css" />
<File Id="Simonlc.css" Name="Simonlc.css" Source="$(var.MarkDownEditor_TargetDir)css/Simonlc.css" />
<File Id="Splendor.css" Name="Splendor.css" Source="$(var.MarkDownEditor_TargetDir)css/Splendor.css" />
<ComponentGroup Id="Light_CSS_Components" Directory="LIGHT_CSS_FOLDER">
<Component Id="Light_CSS_Component" Guid="{CC66453B-BE1B-4599-B71D-7A1DF422B116}">
<File Id="Air.css" Name="Air.css" Source="$(var.MarkDownEditor_TargetDir)css/Light/Air.css" />
<File Id="Default.css" Name="Default.css" Source="$(var.MarkDownEditor_TargetDir)css/Light/Default.css" />
<File Id="Github_andyferra.css" Name="Github_andyferra.css" Source="$(var.MarkDownEditor_TargetDir)css/Light/Github_andyferra.css" />
<File Id="Modest.css" Name="Modest.css" Source="$(var.MarkDownEditor_TargetDir)css/Light/Modest.css" />
<File Id="Simonlc.css" Name="Simonlc.css" Source="$(var.MarkDownEditor_TargetDir)css/Light/Simonlc.css" />
<File Id="Splendor.css" Name="Splendor.css" Source="$(var.MarkDownEditor_TargetDir)css/Light/Splendor.css" />
</Component>
</ComponentGroup>

<ComponentGroup Id="Dark_CSS_Components" Directory="DARK_CSS_FOLDER">
<Component Id="Dark_CSS_Component" Guid="{FA202CC1-E35A-4B1E-82F5-B260223B4B6F}">
<File Id="Retro.css" Name="Retro.css" Source="$(var.MarkDownEditor_TargetDir)css/Dark/Retro.css" />
</Component>
</ComponentGroup>
</Fragment>
Expand Down
3 changes: 3 additions & 0 deletions MarkDownEditor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
<setting name="LastLatestVersion" serializeAs="String">
<value />
</setting>
<setting name="NightMode" serializeAs="String">
<value>False</value>
</setting>
</MarkDownEditor.Properties.Settings>
</userSettings>
<applicationSettings>
Expand Down
14 changes: 7 additions & 7 deletions MarkDownEditor/MarkDownEditor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,25 +289,25 @@
</Content>
<Content Include="WkHtmlToXDotNet.dll" />
<Resource Include="alipay.jpg" />
<Content Include="css\Modest.css">
<Content Include="css\Light\Modest.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="css\Default.css">
<Content Include="css\Light\Default.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="css\Github_andyferra.css">
<Content Include="css\Light\Github_andyferra.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="css\Air.css">
<Content Include="css\Light\Air.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="css\Retro.css">
<Content Include="css\Dark\Retro.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="css\Splendor.css">
<Content Include="css\Light\Splendor.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="css\Simonlc.css">
<Content Include="css\Light\Simonlc.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Resource Include="MarkdownEditorLogo.ico" />
Expand Down
2 changes: 1 addition & 1 deletion MarkDownEditor/Model/DocumentExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void Export(string markdownType, string sourceCodePath, string cssFile, s
var tmpFile = Path.GetTempFileName();
if (cssFile!=null)
{
StreamReader sr = new StreamReader($"css/{cssFile}");
StreamReader sr = new StreamReader(cssFile);
var cssContent = sr.ReadToEnd();
sr.Close();
StreamWriter sw = new StreamWriter(tmpFile);
Expand Down
4 changes: 2 additions & 2 deletions MarkDownEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.3.4.0")]
[assembly: AssemblyFileVersion("0.3.4.0")]
[assembly: AssemblyVersion("0.3.5.0")]
[assembly: AssemblyFileVersion("0.3.5.0")]
13 changes: 11 additions & 2 deletions MarkDownEditor/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions MarkDownEditor/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
<value>Uploading</value>
</data>
<data name="UploadLocalImage2IMGUR" xml:space="preserve">
<value>Upload Local Image To Imgur(Outside Mainland China)</value>
<value>Upload Local Image To Imgur(Outside PRC)</value>
</data>
<data name="Find" xml:space="preserve">
<value>Find</value>
Expand Down Expand Up @@ -547,7 +547,7 @@
<value>Images</value>
</data>
<data name="UploadLocalImage2Qiniu" xml:space="preserve">
<value>Upload Local Image To Qiniu(Mainland China)</value>
<value>Upload Local Image To Qiniu(PRC)</value>
</data>
<data name="Editor" xml:space="preserve">
<value>Editor</value>
Expand All @@ -567,4 +567,7 @@
<data name="Warning" xml:space="preserve">
<value>Warning</value>
</data>
<data name="NightMode" xml:space="preserve">
<value>Night Mode</value>
</data>
</root>
7 changes: 5 additions & 2 deletions MarkDownEditor/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
<value>正在上传</value>
</data>
<data name="UploadLocalImage2IMGUR" xml:space="preserve">
<value>上传本地图片至Imgur(非中国大陆地区)</value>
<value>上传本地图片至Imgur(国内无法上传)</value>
</data>
<data name="Find" xml:space="preserve">
<value>查找</value>
Expand Down Expand Up @@ -547,7 +547,7 @@
<value>图片影像</value>
</data>
<data name="UploadLocalImage2Qiniu" xml:space="preserve">
<value>上传本地图片至七牛(中国大陆地区)</value>
<value>上传本地图片至七牛</value>
</data>
<data name="Editor" xml:space="preserve">
<value>编辑器</value>
Expand All @@ -567,4 +567,7 @@
<data name="Warning" xml:space="preserve">
<value>警告</value>
</data>
<data name="NightMode" xml:space="preserve">
<value>夜间模式</value>
</data>
</root>
12 changes: 12 additions & 0 deletions MarkDownEditor/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions MarkDownEditor/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@
<Setting Name="LastLatestVersion" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="NightMode" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
8 changes: 5 additions & 3 deletions MarkDownEditor/View/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

<Controls:MetroWindow.Flyouts>
<Controls:FlyoutsControl>
<Controls:Flyout Position="Right" IsModal="True" Theme="Accent" Width="300" IsOpen="{Binding AboutViewModel.ShowAboutControl}">
<Controls:Flyout Position="Right" IsModal="True" Theme="Adapt" Width="300" IsOpen="{Binding AboutViewModel.ShowAboutControl}">
<view:AboutControl DataContext="{Binding AboutViewModel}"></view:AboutControl>
</Controls:Flyout>
<Controls:Flyout Position="Right" IsModal="True" Theme="Adapt" Width="500" IsOpen="{Binding SettingsViewModel.ShowSettingsControl}">
Expand Down Expand Up @@ -99,7 +99,9 @@
</i:EventTrigger>
</i:Interaction.Triggers>
<view:MvvmTextEditor
SyntaxHighlighting="MarkDown"
SyntaxHighlighting="MarkDown"
Background="{DynamicResource WhiteBrush}"
Foreground="{DynamicResource BlackBrush}"
Document="{Binding SourceCode}"
SelectionStart="{Binding SelectionStart,Mode=TwoWay}"
SelectionLength="{Binding SelectionLength,Mode=TwoWay}"
Expand Down Expand Up @@ -146,7 +148,7 @@
</Grid>
</Grid>
</Border>
<GridSplitter IsEnabled="False" Width="10"></GridSplitter>
<GridSplitter IsEnabled="False" Width="10" Background="{DynamicResource GrayBrush8}"></GridSplitter>
<Border Grid.Column="2" Margin="5,5,0,5" >
<Grid>
<Grid.RowDefinitions>
Expand Down
11 changes: 6 additions & 5 deletions MarkDownEditor/View/SettingsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,18 @@
<DockPanel Margin="0,5,0,5">
<TextBlock DockPanel.Dock="Left" Text="{x:Static p:Resources.Language}" Style="{StaticResource SettingKeyStyle}"/>
<TextBlock Text="(Language)" Style="{StaticResource SettingKeyStyle}"/>
<Controls:SplitButton DockPanel.Dock="Right" HorizontalContentAlignment="Left" HorizontalAlignment="Right" FontSize="14"
<Controls:SplitButton DockPanel.Dock="Right" Margin="5" HorizontalContentAlignment="Left" HorizontalAlignment="Right" FontSize="14"
ItemsSource="{Binding AllLanguages}" SelectedItem="{Binding CultureInfo}" DisplayMemberPath="NativeName">
</Controls:SplitButton>
</DockPanel>
</StackPanel>
</Expander>
<Expander IsExpanded="True" Header="{x:Static p:Resources.Theme}">
<StackPanel>
<Controls:ToggleSwitch Header="{x:Static p:Resources.NightMode}" IsChecked="{Binding IsNightMode}"></Controls:ToggleSwitch>
<DockPanel Margin="0,5,0,5">
<TextBlock Text="{x:Static p:Resources.Accent}" Style="{StaticResource SettingKeyStyle}"/>
<Menu DockPanel.Dock="Right" HorizontalContentAlignment="Left" HorizontalAlignment="Right"
<Menu DockPanel.Dock="Right" Margin="5" HorizontalContentAlignment="Left" HorizontalAlignment="Right"
Background="{DynamicResource AccentColorBrush}">
<MenuItem Header="Accent" BorderThickness="0" Opacity="0"
ItemsSource="{Binding AccentColors, Mode=OneWay}">
Expand Down Expand Up @@ -74,7 +75,7 @@
<StackPanel>
<DockPanel Margin="0,5,0,5">
<TextBlock Text="{x:Static p:Resources.FontFamily}" Style="{StaticResource SettingKeyStyle}"/>
<Controls:SplitButton DockPanel.Dock="Right" HorizontalContentAlignment="Left" HorizontalAlignment="Right" Width="150" FontSize="14"
<Controls:SplitButton DockPanel.Dock="Right" Margin="5" HorizontalContentAlignment="Left" HorizontalAlignment="Right" Width="150" FontSize="14"
ItemsSource="{Binding Source={StaticResource sysFonts}}" SelectedItem="{Binding EditorFont,Mode=TwoWay}">
<Controls:SplitButton.ItemsPanel>
<ItemsPanelTemplate>
Expand All @@ -92,7 +93,7 @@
</DockPanel>
<DockPanel Margin="0,5,0,5">
<TextBlock Text="{x:Static p:Resources.FontSize}" Style="{StaticResource SettingKeyStyle}"/>
<Controls:NumericUpDown DockPanel.Dock="Right" HorizontalContentAlignment="Left" HorizontalAlignment="Right" Width="100" FontSize="14" Minimum="1" Maximum="96" Value="{Binding EditorFontSize}">
<Controls:NumericUpDown DockPanel.Dock="Right" Margin="5" HorizontalContentAlignment="Left" HorizontalAlignment="Right" Width="100" FontSize="14" Minimum="1" Maximum="96" Value="{Binding EditorFontSize}">
</Controls:NumericUpDown>
</DockPanel>
</StackPanel>
Expand All @@ -116,7 +117,7 @@
<Controls:ToggleSwitch Header="{x:Static p:Resources.ShowColumnRuler}" IsChecked="{Binding ShowColumnRuler}"></Controls:ToggleSwitch>
<DockPanel Margin="0,5,0,5">
<TextBlock Text="{x:Static p:Resources.RulerPosition}" Style="{StaticResource SettingKeyStyle}"/>
<Controls:NumericUpDown DockPanel.Dock="Right" HorizontalContentAlignment="Left"
<Controls:NumericUpDown DockPanel.Dock="Right" Margin="5" HorizontalContentAlignment="Left"
HorizontalAlignment="Right" Width="100" FontSize="14"
Minimum="1" Value="{Binding RulerPosition}" IsEnabled="{Binding ShowColumnRuler}">
</Controls:NumericUpDown>
Expand Down
2 changes: 1 addition & 1 deletion MarkDownEditor/View/StatusBarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ComboBox>
</StatusBarItem>
<StatusBarItem>
<ComboBox ItemsSource="{Binding CssFiles}" FontSize="12" BorderThickness="0"
<ComboBox ItemsSource="{Binding CurrentCssFiles}" FontSize="12" BorderThickness="0"
SelectedIndex="{Binding CurrentCssFileIndex}"
Background="{Binding Path=Background, RelativeSource={RelativeSource AncestorType=StatusBarItem}}"
Foreground="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=StatusBarItem}}">
Expand Down
2 changes: 1 addition & 1 deletion MarkDownEditor/ViewModel/AboutViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class AboutViewModel : ViewModelBase
/// </summary>
public AboutViewModel()
{
CheckForUpdate();
//CheckForUpdate();
}

public override void Cleanup()
Expand Down
Loading

0 comments on commit d1c568d

Please sign in to comment.